Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220922195136.54575-2-tony.luck@intel.com

authored by

Tony Luck and committed by
Borislav Petkov
a51cbd0d bc1b705b

+5 -3
+5 -3
arch/x86/kernel/cpu/mce/severity.c
··· 203 203 BITSET(MCI_STATUS_OVER|MCI_STATUS_UC) 204 204 ), 205 205 MCESEV( 206 + PANIC, "Uncorrected in kernel", 207 + BITSET(MCI_STATUS_UC), 208 + KERNEL 209 + ), 210 + MCESEV( 206 211 UC, "Uncorrected", 207 212 BITSET(MCI_STATUS_UC) 208 213 ), ··· 395 390 if (msg) 396 391 *msg = s->msg; 397 392 s->covered = 1; 398 - 399 - if (s->sev >= MCE_UC_SEVERITY && ctx == IN_KERNEL) 400 - return MCE_PANIC_SEVERITY; 401 393 402 394 return s->sev; 403 395 }