mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +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
95d5e2e59b
commit
64276874d8
1 changed files with 11 additions and 0 deletions
|
|
@ -2569,6 +2569,17 @@ static int remap_restorer_blob(void *addr)
|
|||
restorer_setup_c_header_desc(&pbd, true);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue