Thread (2 messages) flat view 2 messages, 2 authors, 2021-07-06
STALE1871d LANDED

Landed in mainline as 1df3af6dc3cf on 2021-07-06.

[PATCH] powerpc/64e: Fix system call illegal mtmsrd instruction

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2021-07-06 05:13:50
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

BookE does not have mtmsrd, switch to use wrteei to enable MSR[EE].

Reported-by: Christian Zigotzky <redacted>
Fixes: dd152f70bdc1 ("powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
This wasn't caught by QEMU because it executes mtmsrd just fine on BookE
CPUs. Patching that reproduces the problem and verifies this fix.

 arch/powerpc/kernel/interrupt_64.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/interrupt_64.S b/arch/powerpc/kernel/interrupt_64.S
index 4063e8a3f704..d4212d2ff0b5 100644
--- a/arch/powerpc/kernel/interrupt_64.S
+++ b/arch/powerpc/kernel/interrupt_64.S
@@ -311,9 +311,13 @@ END_BTB_FLUSH_SECTION
 	 * trace_hardirqs_off().
 	 */
 	li	r11,IRQS_ALL_DISABLED
-	li	r12,-1 /* Set MSR_EE and MSR_RI */
 	stb	r11,PACAIRQSOFTMASK(r13)
+#ifdef CONFIG_PPC_BOOK3S
+	li	r12,-1 /* Set MSR_EE and MSR_RI */
 	mtmsrd	r12,1
+#else
+	wrteei	1
+#endif
 
 	/* Calling convention has r9 = orig r0, r10 = regs */
 	mr	r9,r0
-- 
2.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help