powerpc/traps: restore recoverability of machine_check interrupts
authorChristophe Leroy <christophe.leroy@c-s.fr>
Sat, 13 Oct 2018 09:16:22 +0000 (09:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:24:02 +0000 (09:24 +0100)
commit90c68f716d57886f4e6f3ff7c7c07014b4254745
tree010942579941bd4f769972273c99a7208ebaace4
parent2e390c487815669fb9bb35d7ea11883cc10a9b50
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>
arch/powerpc/kernel/traps.c