Skip to content

Commit 25bc65d

Browse files
gabpaolonisuryasaimadhu
authored andcommitted
x86/mce: Do not overwrite no_way_out if mce_end() fails
Currently, if mce_end() fails, no_way_out - the variable denoting whether the machine can recover from this MCE - is determined by whether the worst severity that was found across the MCA banks associated with the current CPU, is of panic severity. However, at this point no_way_out could have been already set by mca_start() after looking at all severities of all CPUs that entered the MCE handler. If mce_end() fails, check first if no_way_out is already set and, if so, stick to it, otherwise use the local worst value. [ bp: Massage. ] Signed-off-by: Gabriele Paoloni <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Cc: <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 33fc379 commit 25bc65d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/kernel/cpu/mce/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,10 @@ noinstr void do_machine_check(struct pt_regs *regs)
13841384
* When there's any problem use only local no_way_out state.
13851385
*/
13861386
if (!lmce) {
1387-
if (mce_end(order) < 0)
1388-
no_way_out = worst >= MCE_PANIC_SEVERITY;
1387+
if (mce_end(order) < 0) {
1388+
if (!no_way_out)
1389+
no_way_out = worst >= MCE_PANIC_SEVERITY;
1390+
}
13891391
} else {
13901392
/*
13911393
* If there was a fatal machine check we should have

0 commit comments

Comments
 (0)