Commit 4b15f7b2 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Greg Kroah-Hartman

powerpc/traps: Make unrecoverable NMIs die instead of panic

[ Upstream commit 265d6e58 ]

System Reset and Machine Check interrupts that are not recoverable due
to being nested or interrupting when RI=0 currently panic. This is not
necessary, and can often just kill the current context and recover.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Link: https://lore.kernel.org/r/20200508043408.886394-16-npiggin@gmail.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ac819692
...@@ -430,11 +430,11 @@ void system_reset_exception(struct pt_regs *regs) ...@@ -430,11 +430,11 @@ void system_reset_exception(struct pt_regs *regs)
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
BUG_ON(get_paca()->in_nmi == 0); BUG_ON(get_paca()->in_nmi == 0);
if (get_paca()->in_nmi > 1) if (get_paca()->in_nmi > 1)
nmi_panic(regs, "Unrecoverable nested System Reset"); die("Unrecoverable nested System Reset", regs, SIGABRT);
#endif #endif
/* 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 System Reset"); die("Unrecoverable System Reset", regs, SIGABRT);
if (!nested) if (!nested)
nmi_exit(); nmi_exit();
...@@ -775,7 +775,7 @@ void machine_check_exception(struct pt_regs *regs) ...@@ -775,7 +775,7 @@ void machine_check_exception(struct pt_regs *regs)
/* 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"); die("Unrecoverable Machine check", regs, SIGBUS);
return; return;
......
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