Signed-off-by: Peter Maydell <[email protected]>
---
target/arm/ptw.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index cb41146b9c..ea036a541c 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -3964,7 +3964,7 @@ static bool arm_cpu_get_phys_addr(CPUARMState *env, vaddr
addr,
result->attrs = res.f.attrs;
result->lg_page_size = res.f.lg_page_size;
}
- return !ok;
+ return ok;
}
bool arm_cpu_translate_for_debug(CPUState *cs, vaddr addr,
@@ -3974,12 +3974,7 @@ bool arm_cpu_translate_for_debug(CPUState *cs, vaddr
addr,
CPUARMState *env = &cpu->env;
ARMMMUIdx mmu_idx = arm_mmu_idx(env);
- /*
- * Note that this function returns true on translation success,
- * but arm_cpu_get_phys_addr() and all the other get_phys_addr
- * style functions in this file return true on failure.
- */
- if (!arm_cpu_get_phys_addr(env, addr, result, mmu_idx)) {
+ if (arm_cpu_get_phys_addr(env, addr, result, mmu_idx)) {
return true;
}
@@ -3991,10 +3986,10 @@ bool arm_cpu_translate_for_debug(CPUState *cs, vaddr
addr,
switch (mmu_idx) {
case ARMMMUIdx_E10_1:
case ARMMMUIdx_E10_1_PAN:
- return !arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E10_0);
+ return arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E10_0);
case ARMMMUIdx_E20_2:
case ARMMMUIdx_E20_2_PAN:
- return !arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E20_0);
+ return arm_cpu_get_phys_addr(env, addr, result, ARMMMUIdx_E20_0);
default:
/* translation failed */
return false;
--
2.43.0