Commit daf00ae7 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/traps: restore recoverability of machine_check interrupts

commit b96672dd ("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: b96672dd ("powerpc: Machine check interrupt is a non-maskable interrupt")
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent b851ba02
...@@ -763,12 +763,17 @@ void machine_check_exception(struct pt_regs *regs) ...@@ -763,12 +763,17 @@ void machine_check_exception(struct pt_regs *regs)
if (check_io_access(regs)) if (check_io_access(regs))
goto bail; goto bail;
die("Machine check", regs, SIGBUS);
/* Must die if the interrupt is not recoverable */ /* Must die if the interrupt is not recoverable */
if (!(regs->msr & MSR_RI)) if (!(regs->msr & MSR_RI))
nmi_panic(regs, "Unrecoverable Machine check"); nmi_panic(regs, "Unrecoverable Machine check");
if (!nested)
nmi_exit();
die("Machine check", regs, SIGBUS);
return;
bail: bail:
if (!nested) if (!nested)
nmi_exit(); nmi_exit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment