linux-user/aarch64: Do not clear PROT_MTE on mprotect
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 11 Jul 2022 03:14:20 +0000 (08:44 +0530)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 18 Jul 2022 12:20:13 +0000 (13:20 +0100)
commit7f2cf760fe649972dba0948f8e3fc5618cb1fb37
tree544f7f7d215d392eb88d75ff4a9be9d32507b45d
parent6a775fd6e0423e76d3e3cb751b4b468d68f19ca5
linux-user/aarch64: Do not clear PROT_MTE on mprotect

The documentation for PROT_MTE says that it cannot be cleared
by mprotect.  Further, the implementation of the VM_ARCH_CLEAR bit,
contains PROT_BTI confiming that bit should be cleared.

Introduce PAGE_TARGET_STICKY to allow target/arch/cpu.h to control
which bits may be reset during page_set_flags.  This is sort of the
opposite of VM_ARCH_CLEAR, but works better with qemu's PAGE_* bits
that are separate from PROT_* bits.

Reported-by: Vitaly Buka <vitalybuka@google.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220711031420.17820-1-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
accel/tcg/translate-all.c
target/arm/cpu.h