For the ARM_FEATURE_V6 case, it seems like we retrieve AP and XN bits in
get_phys_addr_v6() but we don't check the XN bit in get_S1prot().

Change the `if (arm_feature(env, ARM_FEATURE_V7))` check in get_S1prot()
to `if (arm_feature(env, ARM_FEATURE_V6))` since v7 implies v6.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4367
Signed-off-by: Manos Pitsidianakis <[email protected]>
---
 target/arm/ptw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 
2e67d02493bd463cfd2d31ecf1316272ac3f1d99..b8b22b014e0574340a85abe73f3d9611d2360219
 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -1595,7 +1595,7 @@ static int get_S1prot(CPUARMState *env, ARMMMUIdx 
mmu_idx, bool is_aa64,
         if (regime_has_2_ranges(mmu_idx) && !is_user) {
             xn = pxn || (user_rw & PAGE_WRITE);
         }
-    } else if (arm_feature(env, ARM_FEATURE_V7)) {
+    } else if (arm_feature(env, ARM_FEATURE_V6)) {
         switch (regime_el(mmu_idx)) {
         case 1:
         case 3:

---
base-commit: f29ccc287a6cfdd51d3a4fd17fbe9af3310a0ac5
change-id: 20261105-armv6-xn-check-ebdd507ca5ab

Best regards,
-- 
Manos Pitsidianakis <[email protected]>


Reply via email to