Skip to content

Commit b96672d

Browse files
npigginmpe
authored andcommitted
powerpc: Machine check interrupt is a non-maskable interrupt
Use nmi_enter similarly to system reset interrupts. This uses NMI printk NMI buffers and turns off various debugging facilities that helps avoid tripping on ourselves or other CPUs. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 6fcd6ba commit b96672d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arch/powerpc/kernel/traps.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,10 @@ int machine_check_generic(struct pt_regs *regs)
644644

645645
void machine_check_exception(struct pt_regs *regs)
646646
{
647-
enum ctx_state prev_state = exception_enter();
648647
int recover = 0;
648+
bool nested = in_nmi();
649+
if (!nested)
650+
nmi_enter();
649651

650652
/* 64s accounts the mce in machine_check_early when in HVMODE */
651653
if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !cpu_has_feature(CPU_FTR_HVMODE))
@@ -677,10 +679,11 @@ void machine_check_exception(struct pt_regs *regs)
677679

678680
/* Must die if the interrupt is not recoverable */
679681
if (!(regs->msr & MSR_RI))
680-
panic("Unrecoverable Machine check");
682+
nmi_panic(regs, "Unrecoverable Machine check");
681683

682684
bail:
683-
exception_exit(prev_state);
685+
if (!nested)
686+
nmi_exit();
684687
}
685688

686689
void SMIException(struct pt_regs *regs)

0 commit comments

Comments
 (0)