Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64e: Fix system call illegal mtmsrd instruction

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

Fixes: dd152f70bdc1 ("powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210706051310.608992-1-npiggin@gmail.com

authored by

Nicholas Piggin and committed by
Michael Ellerman
1df3af6d 3f601608

+5 -1
+5 -1
arch/powerpc/kernel/interrupt_64.S
··· 311 311 * trace_hardirqs_off(). 312 312 */ 313 313 li r11,IRQS_ALL_DISABLED 314 - li r12,-1 /* Set MSR_EE and MSR_RI */ 315 314 stb r11,PACAIRQSOFTMASK(r13) 315 + #ifdef CONFIG_PPC_BOOK3S 316 + li r12,-1 /* Set MSR_EE and MSR_RI */ 316 317 mtmsrd r12,1 318 + #else 319 + wrteei 1 320 + #endif 317 321 318 322 /* Calling convention has r9 = orig r0, r10 = regs */ 319 323 mr r9,r0