powerpc/64e: Fix system call illegal mtmsrd instruction
Nicholas Piggin
reviewerPATCH 1/1 powerpc/64e: Fix system call illegal mtmsrd instruction
BookE does not have mtmsrd, switch to use wrteei to enable MSR[EE].
Reported-by Christian Zigotzky <[email protected]>
Fixes dd152f70bdc1 ("powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]")
Signed-off-by Nicholas Piggin <[email protected]>
---
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(-)
arch/powerpc/kernel/interrupt_64.S +5 -1
@@ -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
Signature · 1 line
2.23.0
Michael Ellerman
AppliedQuoted 1 line · Nicholas Piggin
BookE does not have mtmsrd, switch to use wrteei to enable MSR[EE].
Applied to powerpc/fixes.
[1/1] powerpc/64e: Fix system call illegal mtmsrd instruction
https://git.kernel.org/powerpc/c/1df3af6dc3cfe643f43d46f202bd44861ccbdb99
cheers