From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753904AbbCQSl6 (ORCPT ); Tue, 17 Mar 2015 14:41:58 -0400 Received: from mail-by2on0113.outbound.protection.outlook.com ([207.46.100.113]:48096 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753318AbbCQSlx (ORCPT ); Tue, 17 Mar 2015 14:41:53 -0400 X-Greylist: delayed 70354 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Mar 2015 14:41:53 EDT X-WSS-ID: 0NLDD9N-07-J5C-02 X-M-MSG: Message-ID: <5508756A.1090908@amd.com> Date: Tue, 17 Mar 2015 13:41:46 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Borislav Petkov CC: , , , , , , , , Subject: Re: [PATCH] x86, mce, severities: Add AMD severities function References: <1426526164-3806-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <20150317102048.GG19645@pd.tnic> In-Reply-To: <20150317102048.GG19645@pd.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Aravind.Gopalakrishnan@amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(428002)(164054003)(51704005)(199003)(24454002)(377454003)(479174004)(189002)(46102003)(23676002)(62966003)(50466002)(65806001)(47776003)(106466001)(105586002)(101416001)(110136001)(87936001)(33656002)(83506001)(80316001)(99136001)(92566002)(2950100001)(65816999)(50986999)(54356999)(76176999)(64126003)(86362001)(77096005)(77156002)(59896002)(120886001)(36756003)(4580500001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0201MB1046;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB1046; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:BY1PR0201MB1046;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB1046; X-Forefront-PRVS: 0518EEFB48 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2015 18:41:49.5175 (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.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0201MB1046 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/17/2015 5:20 AM, Borislav Petkov wrote: > On Mon, Mar 16, 2015 at 12:16:04PM -0500, Aravind Gopalakrishnan wrote: >> +/* keeping amd_mce_severity in sync with AMD error scope heirarchy table */ >> +static int amd_mce_severity(struct mce *m, enum context ctx) >> +{ >> + /* Processor Context Corrupt, no need to fumble too much, die! */ >> + if (m->status & MCI_STATUS_PCC) >> + return MCE_PANIC_SEVERITY; >> + >> + if (m->status & MCI_STATUS_UC) { >> + /* >> + * On older systems, where overflow_recov flag is not >> + * present, we should simply PANIC if Overflow occurs. >> + * If overflow_recov flag set, then SW can try >> + * to at least kill process to salvage systen operation. >> + */ >> + >> + /* at least one error was not logged */ >> + if (m->status & MCI_STATUS_OVER && !mce_flags.overflow_recov) >> + return MCE_PANIC_SEVERITY; >> + >> + /* software can try to contain */ >> + if (!(m->mcgstatus & MCG_STATUS_RIPV) && >> + mce_flags.overflow_recov) { >> + if (ctx == IN_KERNEL) >> + return MCE_PANIC_SEVERITY; > we're testing mce_flags.overflow_recov twice here, perhaps do instead: > > /* > * < Comment about overflow recovery bit> > */ > if (mce_flags.overflow_recov) { > if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL)) > return MCE_PANIC_SEVERITY; return MCE_AR_SEVERITY if ctx == IN_USER also needs to be within this block here. Will do that and resend. > } else { > if (m->status & MCI_STATUS_OVER) > return MCE_PANIC_SEVERITY; > } > Thanks, -Aravind