Skip to contentSkip to conversation

target/ppc: mtmsrd is an illegal instruction on BookE

PATCH Applied Nicholas Piggin 2 participants 2 messages Jul 6, 2021 – Jul 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: mtmsrd is an illegal instruction on BookE

MSR is a 32-bit register in BookE and there is no mtmsrd instruction.

Cc Christian Zigotzky <[email protected]>
---
 target/ppc/translate.c | 5 +++++
 1 file changed, 5 insertions(+)
target/ppc/translate.c +5 -0
index f65d1e81ea..d1f482b0f3 100644
@@ -4940,6 +4940,11 @@ static void gen_mtcrf(DisasContext *ctx)
 #if defined(TARGET_PPC64)
 static void gen_mtmsrd(DisasContext *ctx)
 {
+    if (unlikely(!is_book3s_arch2x(ctx))) {
+        gen_invalid(ctx);
+        return;
+    }
+
     CHK_SV;
 
 #if !defined(CONFIG_USER_ONLY)
Signature · 1 line
2.23.0
Applied
#1 lore raw
Quoted 4 lines · Nicholas Piggin

MSR is a 32-bit register in BookE and there is no mtmsrd instruction.

Cc Christian Zigotzky <[email protected]>

Applied to ppc-for-6.1, thanks.

Quoted 20 lines
---
 target/ppc/translate.c | 5 +++++
 1 file changed, 5 insertions(+)
target/ppc/translate.c +5 -0
index f65d1e81ea..d1f482b0f3 100644
@@ -4940,6 +4940,11 @@ static void gen_mtcrf(DisasContext *ctx)
 #if defined(TARGET_PPC64)
 static void gen_mtmsrd(DisasContext *ctx)
 {
+    if (unlikely(!is_book3s_arch2x(ctx))) {
+        gen_invalid(ctx);
+        return;
+    }
+
     CHK_SV;
 
 #if !defined(CONFIG_USER_ONLY)
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson