aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/aarch64/mte.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-04-06 10:40:20 -0700
committerPeter Maydell <peter.maydell@linaro.org>2021-04-12 11:06:24 +0100
commiteb42297a59e103500bdd2c352c5b52f54b1c33cd (patch)
treeaf7603fdfa104013fc2ef405f69533c996c55df5 /tests/tcg/aarch64/mte.h
parent017a913af4dff47ac5e62be613b9f8b88fc8fa96 (diff)
accel/tcg: Preserve PAGE_ANON when changing page permissions
Using mprotect() to change PROT_* does not change the MAP_ANON previously set with mmap(). Our linux-user version of MTE only works with MAP_ANON pages, so losing PAGE_ANON caused MTE to stop working. Reported-by: Stephen Long <steplong@quicinc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/tcg/aarch64/mte.h')
-rw-r--r--tests/tcg/aarch64/mte.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/tcg/aarch64/mte.h b/tests/tcg/aarch64/mte.h
index 141cef522c..0805676b11 100644
--- a/tests/tcg/aarch64/mte.h
+++ b/tests/tcg/aarch64/mte.h
@@ -48,7 +48,8 @@ static void enable_mte(int tcf)
}
}
-static void *alloc_mte_mem(size_t size)
+static void * alloc_mte_mem(size_t size) __attribute__((unused));
+static void * alloc_mte_mem(size_t size)
{
void *p = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_MTE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);