On the 32-bit processors (601, 603, 604, 750, 74xx) mtmsr does set ME,
and permits machine checks, otherwise machine check ends in a checkstop.

Signed-off-by: Eric DeVolder <[email protected]>
---
 target/ppc/translate.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 06ed2adf10..808f913aa2 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -4282,8 +4282,12 @@ static void gen_mtmsr(DisasContext *ctx)
         mask &= (1ULL << MSR_RI) | (1ULL << MSR_EE);
     } else {
         if (likely(!(ctx->insns_flags2 & PPC2_PPE42))) {
-            /* mtmsr does not alter S, ME, or LE */
-            mask &= ~((1ULL << MSR_LE) | (1ULL << MSR_ME) | (1ULL << MSR_S));
+            /* mtmsr does not alter S or LE */
+            mask &= ~((1ULL << MSR_LE) | (1ULL << MSR_S));
+            /* nor ME, on the 64-bit server processors; the 6xx can */
+            if (is_book3s_arch2x(ctx)) {
+                mask &= ~(1ULL << MSR_ME);
+            }
         }
 
         /*
-- 
2.53.0


Reply via email to