@samitouri / QOSamiQemu / commits / 6bc200ebd1

target/arm/ptw: Flip sense of get_phys_addr_lpae 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-3-peter.maydell@linaro.org

Peter Maydell committed May 15, 2026 at 15:25 UTC 6bc200ebd14014b1a2284ef192512273fd4d952f
1 file changed +4 -4
target/arm/ptw.c
+4 -4
@@ -1842,7 +1842,7 @@ static bool lpae_block_desc_valid(ARMCPU *cpu, bool ds,
1842 /**
1843 * get_phys_addr_lpae: perform one stage of page table walk, LPAE format
1844 *
1845 - * Returns false if the translation was successful. Otherwise, phys_ptr,
1845 + * Returns true if the translation was successful. Otherwise, phys_ptr,
1846 * attrs, prot and page_size may not be filled in, and the populated fsr
1847 * value provides information on why the translation aborted, in the format
1848 * of a long-format DFSR/IFSR fault register, with the following caveat:
@@ -2432,7 +2432,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,
2432
2433 result->f.phys_addr = descaddr;
2434 result->f.lg_page_size = ctz64(page_size);
2435 - return false;
2435 + return true;
2436
2437 do_translation_fault:
2438 fi->type = ARMFault_Translation;
@@ -2445,7 +2445,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,
2445 fi->stage2 = regime_is_stage2(mmu_idx);
2446 }
2447 fi->s1ns = fault_s1ns(ptw->cur_space, mmu_idx);
2448 - return true;
2448 + return false;
2449 }
2450
2451 static bool get_phys_addr_pmsav5(CPUARMState *env,
@@ -3787,7 +3787,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
3787 }
3788
3789 if (regime_using_lpae_format(env, mmu_idx)) {
3790 - return get_phys_addr_lpae(env, ptw, address, access_type,
3790 + return !get_phys_addr_lpae(env, ptw, address, access_type,
3791 memop, result, fi);
3792 } else if (arm_feature(env, ARM_FEATURE_V7) ||
3793 regime_sctlr(env, mmu_idx) & SCTLR_XP) {