From patchwork Tue Apr 25 21:07:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 9699765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE327601D3 for ; Tue, 25 Apr 2017 21:09:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F686285F0 for ; Tue, 25 Apr 2017 21:09:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91ECB28609; Tue, 25 Apr 2017 21:09:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13443285F0 for ; Tue, 25 Apr 2017 21:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1951653AbdDYVJE (ORCPT ); Tue, 25 Apr 2017 17:09:04 -0400 Received: from mga06.intel.com ([134.134.136.31]:11646 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1951021AbdDYVJD (ORCPT ); Tue, 25 Apr 2017 17:09:03 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 25 Apr 2017 14:09:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,251,1488873600"; d="scan'208";a="80802441" Received: from omniknight.lm.intel.com ([10.232.112.53]) by orsmga004.jf.intel.com with ESMTP; 25 Apr 2017 14:09:01 -0700 Date: Tue, 25 Apr 2017 15:07:41 -0600 From: Vishal Verma To: Borislav Petkov Cc: "Luck, Tony" , Dan Williams , "linux-nvdimm@lists.01.org" , "stable@vger.kernel.org" , "linux-acpi@vger.kernel.org" Subject: Re: [PATCH 1/2] x86/MCE: Export memory_error() Message-ID: <20170425210740.GA15722@omniknight.lm.intel.com> References: <20170420221818.23522-1-vishal.l.verma@intel.com> <1492804517.2738.25.camel@intel.com> <3908561D78D1C84285E8C5FCA982C28F6127653B@ORSMSX114.amr.corp.intel.com> <20170421202741.GA16423@intel.com> <20170421210704.c5pvpn6zivvruzx3@pd.tnic> <20170424113620.6iq2466yhkhb33rp@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170424113620.6iq2466yhkhb33rp@pd.tnic> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 04/24, Borislav Petkov wrote: > From: Borislav Petkov > 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 > --- > 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 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 Cc: Borislav Petkov Cc: Signed-off-by: Vishal Verma --- 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; /*