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

x86/mce: Include a MCi_MISC value in faked mce logs

When BIOS reports memory errors to Linux using the ACPI/APEI
error reporting method Linux creates a "struct mce" to pass
to the normal reporting code path.

The constructed record doesn't include a value for the "misc"
field of the structure, and so mce_usable_address() says this
record doesn't include a valid address.

Net result is that functions like uc_decode_notifier() will
just ignore this record instead of taking action to offline
a page.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210527222846.931851-1-tony.luck@intel.com

authored by

Tony Luck and committed by
Borislav Petkov
40cd0aae 94a311ce

+2 -1
+2 -1
arch/x86/kernel/cpu/mce/apei.c
··· 36 36 mce_setup(&m); 37 37 m.bank = -1; 38 38 /* Fake a memory read error with unknown channel */ 39 - m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f; 39 + m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | MCI_STATUS_MISCV | 0x9f; 40 + m.misc = (MCI_MISC_ADDR_PHYS << 6) | PAGE_SHIFT; 40 41 41 42 if (severity >= GHES_SEV_RECOVERABLE) 42 43 m.status |= MCI_STATUS_UC;