代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/criu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1f760a8bbb539e81b1ef48aeedbebb792d7b74b2 Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Fri, 14 Jan 2022 16:39:32 +0800
Subject: [PATCH 17/72] 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>
---
test/zdtm/static/maps00.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/zdtm/static/maps00.c b/test/zdtm/static/maps00.c
index 10a4cac..5ef8f1a 100644
--- a/test/zdtm/static/maps00.c
+++ b/test/zdtm/static/maps00.c
@@ -158,7 +158,8 @@ 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);
+ __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;
@@ -169,14 +170,15 @@ static int check_map(struct map *map)
}
}
}
- if (!(map->flag & MAP_ANONYMOUS) || map->prot & PROT_WRITE)
+ if (!(map->flag & MAP_ANONYMOUS) || (map->prot & PROT_WRITE))
/* Function body has been copied into the mapping */
((int (*)(void))map->ptr)(); /* perform exec access */
- else
+ else {
/* No way to copy function body into mapping,
* clear exec bit from effective protection
*/
prot &= PROT_WRITE | PROT_READ | !PROT_EXEC;
+ }
} else
prot &= PROT_WRITE | PROT_READ | !PROT_EXEC;
--
2.34.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。