summaryrefslogtreecommitdiffstats
path: root/target-arm/helper.c
diff options
context:
space:
mode:
authorSergey Sorokin2016-05-12 14:22:26 +0200
committerPeter Maydell2016-05-12 14:22:26 +0200
commitdfda68377e20943f474505e75238cb96bc6874bf (patch)
tree77e980de70bd7cdbdcf7176c9d7b1cf20344df78 /target-arm/helper.c
parenthw/arm/nseries: Allocating Large sized arrays to heap (diff)
downloadqemu-dfda68377e20943f474505e75238cb96bc6874bf.tar.gz
qemu-dfda68377e20943f474505e75238cb96bc6874bf.tar.xz
qemu-dfda68377e20943f474505e75238cb96bc6874bf.zip
target-arm: Stage 2 permission fault was fixed in AArch32 state
As described in AArch32.CheckS2Permission an instruction fetch fails if XN bit is set or there is no read permission for the address. Signed-off-by: Sergey Sorokin <afarallax@yandex.ru> Message-id: 1461002400-3187-1-git-send-email-afarallax@yandex.ru Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r--target-arm/helper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 09638b2e7d..59efb90366 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -6708,7 +6708,9 @@ static int get_S2prot(CPUARMState *env, int s2ap, int xn)
prot |= PAGE_WRITE;
}
if (!xn) {
- prot |= PAGE_EXEC;
+ if (arm_el_is_aa64(env, 2) || prot & PAGE_READ) {
+ prot |= PAGE_EXEC;
+ }
}
return prot;
}