]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm/ptw: Flip sense of get_phys_addr_twostage return value
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 15 May 2026 14:25:36 +0000 (15:25 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 26 May 2026 09:16:36 +0000 (10:16 +0100)
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-10-peter.maydell@linaro.org

target/arm/ptw.c

index ca4b638c43df6e803d523f74724b32b7f448d1e0..fec24f08fd9b2372d7b3442a40f2f1f85d17deaf 100644 (file)
@@ -3571,7 +3571,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
 
     /* If S1 fails, return early.  */
     if (ret) {
-        return ret;
+        return !ret;
     }
 
     ipa = result->f.phys_addr;
@@ -3602,7 +3602,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
 
     /* If S2 fails, return early.  */
     if (ret) {
-        return ret;
+        return !ret;
     }
 
     /*
@@ -3656,7 +3656,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
         result->f.attrs.space = arm_secure_to_space(result->f.attrs.secure);
     }
 
-    return false;
+    return true;
 }
 
 static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
@@ -3724,7 +3724,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
         ptw->in_mmu_idx = mmu_idx = s1_mmu_idx;
         if (arm_feature(env, ARM_FEATURE_EL2) &&
             !regime_translation_disabled(env, ARMMMUIdx_Stage2, ptw->in_space)) {
-            return get_phys_addr_twostage(env, ptw, address, access_type,
+            return !get_phys_addr_twostage(env, ptw, address, access_type,
                                           memop, result, fi);
         }
         /* fall through */