mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
zdtm: fix zdtm/static/maps00 case in arm64
This case sometimes will cause SIGILL signal in arm64 platform. <<ARM Coretex-A series Programmer's Guide for ARMv8-A>> notes: The ARM architecture does not require the hardware to ensure coherency between instruction caches and memory, even for locations of shared memory. Therefore, we need flush dcache and icache for self-modifying code. - https://developer.arm.com/documentation/den0024/a/Caches/Point-of-coherency-and-unification Signed-off-by: fu.lin <fulin10@huawei.com>
This commit is contained in:
parent
6cfad77f00
commit
6be10a232d
1 changed files with 7 additions and 1 deletions
|
|
@ -158,7 +158,13 @@ static int check_map(struct map *map)
|
|||
|
||||
if (!sigsetjmp(segv_ret, 1)) {
|
||||
if (map->prot & PROT_WRITE) {
|
||||
memcpy(map->ptr, test_func, getpagesize());
|
||||
memcpy(map->ptr, test_func, ONE_MAP_SIZE);
|
||||
/* The ARM ARM architecture does not require the
|
||||
* hardware to ensure coherency between instruction
|
||||
* caches and memory, flushing dcache and icache is
|
||||
* necessory to prevent SIGILL signal.
|
||||
*/
|
||||
__builtin___clear_cache(map->ptr, map->ptr + ONE_MAP_SIZE);
|
||||
} else {
|
||||
if (!(map->flag & MAP_ANONYMOUS)) {
|
||||
uint8_t funlen = (uint8_t *)check_map - (uint8_t *)test_func;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue