@samitouri / QOSamiQemu / commits / 87d50e8049

target/arm/ptw: Flip sense of pmsav8_mpu_lookup return value

Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260515142541.571911-9-peter.maydell@linaro.org

Peter Maydell committed May 15, 2026 at 15:25 UTC 87d50e8049d08eb2fa41121753c6347db83e8125
1 file changed +5 -4
target/arm/ptw.c
+5 -4
@@ -2844,6 +2844,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
2844 * If the region hit doesn't cover the entire TARGET_PAGE the address
2845 * is within, then we set the result page_size to 1 to force the
2846 * memory system to use a subpage.
2847 + * Return true on success, false on fault.
2848 */
2849 ARMCPU *cpu = env_archcpu(env);
2850 bool is_user = regime_is_user(mmu_idx);
@@ -2944,7 +2945,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
2945 if (arm_feature(env, ARM_FEATURE_M)) {
2946 fi->level = 1;
2947 }
2947 - return true;
2948 + return false;
2949 }
2950
2951 matchregion = n;
@@ -2958,7 +2959,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
2959 } else {
2960 fi->type = ARMFault_Permission;
2961 }
2961 - return true;
2962 + return false;
2963 }
2964
2965 if (matchregion == -1) {
@@ -3020,7 +3021,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
3021 if (arm_feature(env, ARM_FEATURE_M)) {
3022 fi->level = 1;
3023 }
3023 - return (prot_check & ~result->f.prot) != 0;
3024 + return (prot_check & ~result->f.prot) == 0;
3025 }
3026
3027 static bool v8m_is_sau_exempt(CPUARMState *env,
@@ -3222,7 +3223,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env,
3223 }
3224 }
3225
3225 - ret = !pmsav8_mpu_lookup(env, address, access_type, ptw->in_prot_check,
3226 + ret = pmsav8_mpu_lookup(env, address, access_type, ptw->in_prot_check,
3227 mmu_idx, secure, result, fi, NULL);
3228 /*
3229 * For two-stage PMSA translations, s2prot holds the stage 2