Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b96672dd authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

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: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 6fcd6baa
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -644,8 +644,10 @@ int machine_check_generic(struct pt_regs *regs)


void machine_check_exception(struct pt_regs *regs)
void machine_check_exception(struct pt_regs *regs)
{
{
	enum ctx_state prev_state = exception_enter();
	int recover = 0;
	int recover = 0;
	bool nested = in_nmi();
	if (!nested)
		nmi_enter();


	/* 64s accounts the mce in machine_check_early when in HVMODE */
	/* 64s accounts the mce in machine_check_early when in HVMODE */
	if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !cpu_has_feature(CPU_FTR_HVMODE))
	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)


	/* 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))
		panic("Unrecoverable Machine check");
		nmi_panic(regs, "Unrecoverable Machine check");


bail:
bail:
	exception_exit(prev_state);
	if (!nested)
		nmi_exit();
}
}


void SMIException(struct pt_regs *regs)
void SMIException(struct pt_regs *regs)