Skip to content

Commit

Permalink
powerpc/mce: ensure machine check handler always tests RI
Browse files Browse the repository at this point in the history
A machine check that is handled must still check MSR[RI] for
recoverability of the interrupted context. Without this patch
it's possible for a handled machine check to return to a
context where it has clobbered live registers.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-25-npiggin@gmail.com
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Feb 8, 2021
1 parent 209e9d5 commit c538938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,11 @@ void machine_check_exception(struct pt_regs *regs)

die_mce("Machine check", regs, SIGBUS);

bail:
/* Must die if the interrupt is not recoverable */
if (!(regs->msr & MSR_RI))
die_mce("Unrecoverable Machine check", regs, SIGBUS);

bail:
if (nmi) nmi_exit();
}
NOKPROBE_SYMBOL(machine_check_exception);
Expand Down

0 comments on commit c538938

Please sign in to comment.