mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
restore: flush caches during restore
See the previous commit for rationale and architecture-specific details. [ avagin: tweak code comment ] Signed-off-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
04012eac7f
commit
6f0e4e848b
@ -2569,6 +2569,17 @@ static int remap_restorer_blob(void *addr)
|
|||||||
restorer_setup_c_header_desc(&pbd, true);
|
restorer_setup_c_header_desc(&pbd, true);
|
||||||
compel_relocs_apply(addr, addr, &pbd);
|
compel_relocs_apply(addr, addr, &pbd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ensure the infected thread sees the updated code.
|
||||||
|
*
|
||||||
|
* On architectures like ARM64, the Data Cache (D-cache) and
|
||||||
|
* Instruction Cache (I-cache) are not automatically coherent.
|
||||||
|
* Modifications land in the D-cache, so we must flush (clean) the
|
||||||
|
* D-cache to push changes to RAM to ensure the CPU fetches the updated
|
||||||
|
* instructions.
|
||||||
|
*/
|
||||||
|
__builtin___clear_cache(addr, addr + pbd.hdr.bsize);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user