Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752728AbbEFRBu (ORCPT ); Wed, 6 May 2015 13:01:50 -0400 Received: from mail-bl2on0112.outbound.protection.outlook.com ([65.55.169.112]:35278 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752240AbbEFRBp (ORCPT ); Wed, 6 May 2015 13:01:45 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NNXTYR-08-W7J-02 X-M-MSG: From: Aravind Gopalakrishnan To: , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH V2 3/6] x86/mce: Define 'SUCCOR' cpuid bit Date: Wed, 6 May 2015 06:58:55 -0500 Message-ID: <1430913538-1415-4-git-send-email-Aravind.Gopalakrishnan@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430913538-1415-1-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1430913538-1415-1-git-send-email-Aravind.Gopalakrishnan@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(189002)(575784001)(50986999)(50466002)(86362001)(77096005)(47776003)(77156002)(229853001)(106466001)(76176999)(48376002)(189998001)(62966003)(36756003)(101416001)(105586002)(2201001)(50226001)(87936001)(19580395003)(19580405001)(2950100001)(5001770100001)(46102003)(5001920100001)(92566002)(53416004);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB066;H:atltwp02.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB066; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR02MB066;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB066; X-Forefront-PRVS: 0568F32D91 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2015 17:01:41.5156 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.222];Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB066 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2196 Lines: 67 SUCCOR stands for S/W UnCorrectable error COntainment and Recovery. It indicates support for data poisoning in HW and deferred error interrupts. Add new bitfield in mce_vendor_flags for this. We use this to verify prescence of deferred error interrupts before we enable them in mce_amd.c While at it, clarify comments in mce_vendor_flags to provide an indication of usages of the bitfields. Signed-off-by: Aravind Gopalakrishnan --- arch/x86/include/asm/mce.h | 17 +++++++++++++++-- arch/x86/kernel/cpu/mcheck/mce.c | 3 ++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 1f5a86d..ab0cdac 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -117,8 +117,21 @@ struct mca_config { }; struct mce_vendor_flags { - __u64 overflow_recov : 1, /* cpuid_ebx(80000007) */ - __reserved_0 : 63; + /* Flags from cpuid_ebx(80000007) */ + + /* + * overflow recovery cpuid bit indicates that overflow + * conditions are not fatal + */ + __u64 overflow_recov : 1, + /* + * SUCCOR stands for S/W UnCorrectable error + * COntainment and Recovery. + * It indicates support for data poisoning in HW and + * deferred error interrupts. + */ + succor : 1, + __reserved_0 : 62; }; extern struct mce_vendor_flags mce_flags; diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index e535533..6d218ac 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1639,7 +1639,8 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) break; case X86_VENDOR_AMD: mce_amd_feature_init(c); - mce_flags.overflow_recov = cpuid_ebx(0x80000007) & 0x1; + mce_flags.overflow_recov = !!(cpuid_ebx(0x80000007) & BIT(0)); + mce_flags.succor = !!(cpuid_ebx(0x80000007) & BIT(1)); break; default: break; -- 1.9.1 -- 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/