@samitouri / QOSamiQemu / commits / 29c6f25924

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

We want to bring all the get_phys_addr* functions in ptw.c into line with the sense that translate_for_debug() has and which seems more logical: true on success, and false on failure. Start with get_phys_addr_disabled(). 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-2-peter.maydell@linaro.org

Peter Maydell committed May 15, 2026 at 15:25 UTC 29c6f25924d91bfc273a201fa896075343e50af0
1 file changed +4 -4
target/arm/ptw.c
+4 -4
@@ -3506,7 +3506,7 @@ static bool get_phys_addr_disabled(CPUARMState *env,
3506 fi->type = ARMFault_AddressSize;
3507 fi->level = 0;
3508 fi->stage2 = false;
3509 - return 1;
3509 + return false;
3510 }
3511
3512 /*
@@ -3548,7 +3548,7 @@ static bool get_phys_addr_disabled(CPUARMState *env,
3548 result->f.lg_page_size = TARGET_PAGE_BITS;
3549 result->cacheattrs.shareability = shareability;
3550 result->cacheattrs.attrs = memattr;
3551 - return false;
3551 + return true;
3552 }
3553
3554 static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
@@ -3682,7 +3682,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
3682 case ARMMMUIdx_Phys_Root:
3683 case ARMMMUIdx_Phys_Realm:
3684 /* Checking Phys early avoids special casing later vs regime_el. */
3685 - return get_phys_addr_disabled(env, ptw, address, access_type,
3685 + return !get_phys_addr_disabled(env, ptw, address, access_type,
3686 result, fi);
3687
3688 case ARMMMUIdx_Stage1_E0:
@@ -3782,7 +3782,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
3782 /* Definitely a real MMU, not an MPU */
3783
3784 if (regime_translation_disabled(env, mmu_idx, ptw->in_space)) {
3785 - return get_phys_addr_disabled(env, ptw, address, access_type,
3785 + return !get_phys_addr_disabled(env, ptw, address, access_type,
3786 result, fi);
3787 }
3788