From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbbCQKWZ (ORCPT ); Tue, 17 Mar 2015 06:22:25 -0400 Received: from mail.skyhub.de ([78.46.96.112]:36527 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbbCQKWW (ORCPT ); Tue, 17 Mar 2015 06:22:22 -0400 Date: Tue, 17 Mar 2015 11:20:49 +0100 From: Borislav Petkov To: Aravind Gopalakrishnan Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, tony.luck@intel.com, slaoub@gmail.com, luto@amacapital.net, x86@kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org Subject: Re: [PATCH] x86, mce, severities: Add AMD severities function Message-ID: <20150317102048.GG19645@pd.tnic> References: <1426526164-3806-1-git-send-email-Aravind.Gopalakrishnan@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1426526164-3806-1-git-send-email-Aravind.Gopalakrishnan@amd.com> 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 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; } else { if (m->status & MCI_STATUS_OVER) return MCE_PANIC_SEVERITY; } -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --