Commit 2b4f3ac5 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc: Mark system reset as an NMI with nmi_enter/exit()

System reset is a non-maskable interrupt from Linux's point of view
(occurs under local_irq_disable()), so it should use nmi_enter/exit.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent b1ee8a3d
......@@ -279,6 +279,14 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
void system_reset_exception(struct pt_regs *regs)
{
/*
* Avoid crashes in case of nested NMI exceptions. Recoverability
* is determined by RI and in_nmi
*/
bool nested = in_nmi();
if (!nested)
nmi_enter();
/* See if any machine dependent calls */
if (ppc_md.system_reset_exception) {
if (ppc_md.system_reset_exception(regs))
......@@ -297,6 +305,9 @@ void system_reset_exception(struct pt_regs *regs)
if (!(regs->msr & MSR_RI))
panic("Unrecoverable System Reset");
if (!nested)
nmi_exit();
/* What should we do here? We could issue a shutdown or hard reset. */
}
......
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