diff mbox series

[1/6] x86/mce: Take action on UCNA/Deferred errors again

Message ID 20191210000733.17979-2-jschoenh@amazon.de (mailing list archive)
State New, archived
Headers show
Series x86/mce: Various fixes and cleanups for MCE handling | expand

Commit Message

Jan H. Schönherr Dec. 10, 2019, 12:07 a.m. UTC
Linux 3.19 commit fa92c5869426 ("x86, mce: Support memory error recovery
for both UCNA and Deferred error in machine_check_poll") added handling
of UCNA and Deferred errors by adding them to the ring for SRAO errors.

Later, Linux 4.3 commit fd4cf79fcc4b ("x86/mce: Remove the MCE ring for
Action Optional errors") switched storage from the SRAO ring to the
unified pool that is still in use today. In order to only act on the
intended errors, a filter for MCE_AO_SEVERITY was used -- effectively
removing handling of UCNA/Deferred errors again.

Extend the severity filter to include UCNA/Deferred errors once more.

Fixes: fd4cf79fcc4b ("x86/mce: Remove the MCE ring for Action Optional errors")
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
---
 arch/x86/kernel/cpu/mce/core.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 743370ee4983..d5a8b99f7ba3 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -595,14 +595,16 @@  static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,
 	struct mce *mce = (struct mce *)data;
 	unsigned long pfn;
 
-	if (!mce)
+	if (!mce || !mce_usable_address(mce))
 		return NOTIFY_DONE;
 
-	if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
-		pfn = mce->addr >> PAGE_SHIFT;
-		if (!memory_failure(pfn, 0))
-			set_mce_nospec(pfn);
-	}
+	if (mce->severity != MCE_AO_SEVERITY &&
+	    mce->severity != MCE_DEFERRED_SEVERITY)
+		return NOTIFY_DONE;
+
+	pfn = mce->addr >> PAGE_SHIFT;
+	if (!memory_failure(pfn, 0))
+		set_mce_nospec(pfn);
 
 	return NOTIFY_OK;
 }