The MMU index is an internal detail that should not be
needed by the translator.  Look at the MSR directly.

Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
 target-ppc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index c07bb01..5a8267a 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -11261,7 +11261,7 @@ static inline void 
gen_intermediate_code_internal(PowerPCCPU *cpu,
     ctx.tb = tb;
     ctx.exception = POWERPC_EXCP_NONE;
     ctx.spr_cb = env->spr_cb;
-    ctx.mem_idx = env->mmu_idx;
+    ctx.mem_idx = (!msr_pr && msr_hv) ? 2 : 1 - msr_pr;
     ctx.insns_flags = env->insns_flags;
     ctx.insns_flags2 = env->insns_flags2;
     ctx.access_type = -1;
-- 
1.8.3.1



Reply via email to