diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-10-13 09:16:22 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-21 09:19:08 +0100 |
commit | 54de3d7d55dc70fe7ce8ccd1b7e09831881a730a (patch) | |
tree | 0f8fedd266ed53b20263559630dc564711225aff | |
parent | 7950eb316adf792283cac5743dfe5a11e74833dc (diff) | |
download | linux-stable-54de3d7d55dc70fe7ce8ccd1b7e09831881a730a.tar.gz linux-stable-54de3d7d55dc70fe7ce8ccd1b7e09831881a730a.tar.bz2 linux-stable-54de3d7d55dc70fe7ce8ccd1b7e09831881a730a.zip |
powerpc/traps: restore recoverability of machine_check interrupts
[ Upstream commit daf00ae71dad8aa05965713c62558aeebf2df48e ]
commit b96672dd840f ("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: b96672dd840f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/powerpc/kernel/traps.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index c85adb858271..8689a02b7df8 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -767,12 +767,17 @@ void machine_check_exception(struct pt_regs *regs) if (check_io_access(regs)) goto bail; - die("Machine check", regs, SIGBUS); - /* Must die if the interrupt is not recoverable */ if (!(regs->msr & MSR_RI)) nmi_panic(regs, "Unrecoverable Machine check"); + if (!nested) + nmi_exit(); + + die("Machine check", regs, SIGBUS); + + return; + bail: if (!nested) nmi_exit(); |