On 04/24, Borislav Petkov wrote: > From: Borislav Petkov <bp@xxxxxxx> > Date: Mon, 24 Apr 2017 13:16:50 +0200 > Subject: [PATCH 1/2] x86/MCE: Export memory_error() > > Export the function which checks whether an MCE is a memory error to > other users so that we can reuse the logic. Drop the boot_cpu_data use, > while at it, as mce.cpuvendor already has the CPU vendor in there. > > Signed-off-by: Borislav Petkov <bp@xxxxxxx> > --- > arch/x86/include/asm/mce.h | 1 + > arch/x86/kernel/cpu/mcheck/mce.c | 12 +++++------- > 2 files changed, 6 insertions(+), 7 deletions(-) > Here is the updated patch to use the above helper: 8<----- >From 9661a85799c9067d762ecf29630f2b7f69897628 Mon Sep 17 00:00:00 2001 From: Vishal Verma <vishal.l.verma@xxxxxxxxx> Date: Tue, 25 Apr 2017 15:00:58 -0600 Subject: [PATCH v2] acpi, nfit: fix the memory error check in nfit_handle_mce The check for an MCE being a memory error in the NFIT mce handler was bogus. Export the new mce_is_memory_error helper, and use that tp perform the correct check in the handler. Reported-by: Tony Luck <tony.luck@xxxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Vishal Verma <vishal.l.verma@xxxxxxxxx> --- arch/x86/kernel/cpu/mcheck/mce.c | 1 + drivers/acpi/nfit/mce.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) This applies on tip/master + Borislav's patches in this thread above. I'm not sure what the right process for queueing this for both upstream and -stable is, so just replying here. Should I post it independently? diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 361865ca..5cfbaeb 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -527,6 +527,7 @@ bool mce_is_memory_error(struct mce *m) return false; } +EXPORT_SYMBOL_GPL(mce_is_memory_error); static bool cec_add_mce(struct mce *m) { diff --git a/drivers/acpi/nfit/mce.c b/drivers/acpi/nfit/mce.c index 3ba1c34..fd86bec 100644 --- a/drivers/acpi/nfit/mce.c +++ b/drivers/acpi/nfit/mce.c @@ -26,7 +26,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, struct nfit_spa *nfit_spa; /* We only care about memory errors */ - if (!(mce->status & MCACOD)) + if (!mce_is_memory_error(mce)) return NOTIFY_DONE; /* -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html