Skip to contentSkip to conversation

target-ppc: fix RFI by clearing TGPR and ILE

RFC PATCH New Thomas Monjalon 1 participant 1 message Apr 23, 2010

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 target-ppc: fix RFI by clearing TGPR and ILE

From: Thomas Monjalon <[email protected]>

Since commit 2ada0ed, the PPC processors which have TGPR support should be broken because the bit TGPR was not cleared.

After testing with e300, it seems that ILE should be cleared also.

Feedbacks welcomed, thanks.

---
 target-ppc/op_helper.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
target-ppc/op_helper.c +4 -2
index 8f2ee98..22d7530 100644
@@ -1645,8 +1645,10 @@ static inline void do_rfi(target_ulong nip, target_ulong msr,
 
 void helper_rfi (void)
 {
-    do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
-           ~((target_ulong)0x0), 1);
+    target_ulong msrm = 1 << MSR_ILE;
+    if (env->flags & POWERPC_FLAG_TGPR)
+       msrm |= 1 << MSR_TGPR;
+    do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1], ~((target_ulong)msrm), 1);
 }
 
 #if defined(TARGET_PPC64)
Signature · 1 line
1.7.0.6