Skip to contentSkip to conversation

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

PATCH Applied Tony Luck 2 participants 2 messages May 27, 2021 – May 28, 2021

Subsystems (3)
lore
Share & tools
lore

Tony Luck

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/kernel/cpu/mce/apei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/mce/apei.c +2 -1
index b58b85380ddb..0e3ae64d3b76 100644
@@ -36,7 +36,8 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err)
 	mce_setup(&m);
 	m.bank = -1;
 	/* Fake a memory read error with unknown channel */
-	m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f;
+	m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | MCI_STATUS_MISCV | 0x9f;
+	m.misc = (MCI_MISC_ADDR_PHYS << 6) | PAGE_SHIFT;
 
 	if (severity >= GHES_SEV_RECOVERABLE)
 		m.status |= MCI_STATUS_UC;
Signature · 1 line
2.29.2
merge bot Applied
#1 lore raw
The following commit has been merged into the ras/core branch of tip:

The following commit has been merged into the ras/core branch of tip:

Commit-ID:     40cd0aae5957ec175b73dc17dce6079d33fa74f6
Gitweb:        https://git.kernel.org/tip/40cd0aae5957ec175b73dc17dce6079d33fa74f6
Author:        Tony Luck <[email protected]>
AuthorDate:    Thu, 27 May 2021 15:28:46 -07:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Fri, 28 May 2021 16:57:16 +02:00

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.

---
 arch/x86/kernel/cpu/mce/apei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/mce/apei.c +2 -1
index b58b853..0e3ae64 100644
@@ -36,7 +36,8 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err)
 	mce_setup(&m);
 	m.bank = -1;
 	/* Fake a memory read error with unknown channel */
-	m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f;
+	m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | MCI_STATUS_MISCV | 0x9f;
+	m.misc = (MCI_MISC_ADDR_PHYS << 6) | PAGE_SHIFT;
 
 	if (severity >= GHES_SEV_RECOVERABLE)
 		m.status |= MCI_STATUS_UC;