Skip to content

Commit daf00ae

Browse files
chleroympe
authored andcommitted
powerpc/traps: restore recoverability of machine_check interrupts
commit b96672d ("powerpc: Machine check interrupt is a non- maskable interrupt") added a call to nmi_enter() at the beginning of machine check restart exception handler. Due to that, in_interrupt() always returns true regardless of the state before entering the exception, and die() panics even when the system was not already in interrupt. This patch calls nmi_exit() before calling die() in order to restore the interrupt state we had before calling nmi_enter() Fixes: b96672d ("powerpc: Machine check interrupt is a non-maskable interrupt") Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent b851ba0 commit daf00ae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/powerpc/kernel/traps.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,17 @@ void machine_check_exception(struct pt_regs *regs)
763763
if (check_io_access(regs))
764764
goto bail;
765765

766-
die("Machine check", regs, SIGBUS);
767-
768766
/* Must die if the interrupt is not recoverable */
769767
if (!(regs->msr & MSR_RI))
770768
nmi_panic(regs, "Unrecoverable Machine check");
771769

770+
if (!nested)
771+
nmi_exit();
772+
773+
die("Machine check", regs, SIGBUS);
774+
775+
return;
776+
772777
bail:
773778
if (!nested)
774779
nmi_exit();

0 commit comments

Comments
 (0)