Skip to content

Commit a51cbd0

Browse files
aeglsuryasaimadhu
authored andcommitted
x86/mce: Use severity table to handle uncorrected errors in kernel
mce_severity_intel() has a special case to promote UC and AR errors in kernel context to PANIC severity. The "AR" case is already handled with separate entries in the severity table for all instruction fetch errors, and those data fetch errors that are not in a recoverable area of the kernel (i.e. have an extable fixup entry). Add an entry to the severity table for UC errors in kernel context that reports severity = PANIC. Delete the special case code from mce_severity_intel(). Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bc1b705 commit a51cbd0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ static struct severity {
202202
PANIC, "Overflowed uncorrected",
203203
BITSET(MCI_STATUS_OVER|MCI_STATUS_UC)
204204
),
205+
MCESEV(
206+
PANIC, "Uncorrected in kernel",
207+
BITSET(MCI_STATUS_UC),
208+
KERNEL
209+
),
205210
MCESEV(
206211
UC, "Uncorrected",
207212
BITSET(MCI_STATUS_UC)
@@ -391,9 +396,6 @@ static noinstr int mce_severity_intel(struct mce *m, struct pt_regs *regs, char
391396
*msg = s->msg;
392397
s->covered = 1;
393398

394-
if (s->sev >= MCE_UC_SEVERITY && ctx == IN_KERNEL)
395-
return MCE_PANIC_SEVERITY;
396-
397399
return s->sev;
398400
}
399401
}

0 commit comments

Comments
 (0)