Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761359AbbKUTRe (ORCPT ); Sat, 21 Nov 2015 14:17:34 -0500 Received: from mail.skyhub.de ([78.46.96.112]:35112 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbKUTRc (ORCPT ); Sat, 21 Nov 2015 14:17:32 -0500 Date: Sat, 21 Nov 2015 20:17:25 +0100 From: Borislav Petkov To: Tony Luck Cc: "Chen, Gong" , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] x86/mce: Add the missing memory error check on AMD Message-ID: <20151121191725.GC15172@pd.tnic> References: <20151111193845.GA9055@agluck-desk.sc.intel.com> <3165a4989dcb45fc0306438d40d0cf2ace429c4c.1447280215.git.tony.luck@intel.com> <20151121191556.GB15172@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151121191556.GB15172@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1338 Lines: 44 From: Borislav Petkov Date: Sat, 21 Nov 2015 11:29:05 +0100 Subject: [PATCH 1/2] x86/mce: Add the missing memory error check on AMD We simply need to look at the extended error code when detecting whether the error is of type memory. Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index fb8b1db7b150..e00e85ab7387 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -522,10 +522,10 @@ static bool memory_error(struct mce *m) struct cpuinfo_x86 *c = &boot_cpu_data; if (c->x86_vendor == X86_VENDOR_AMD) { - /* - * coming soon - */ - return false; + /* ErrCodeExt[20:16] */ + u8 xec = (m->status >> 16) & 0x1f; + + return (xec == 0x0 || xec == 0x8); } else if (c->x86_vendor == X86_VENDOR_INTEL) { /* * Intel SDM Volume 3B - 15.9.2 Compound Error Codes -- 2.3.5 -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/