From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754178AbcKHV5c (ORCPT ); Tue, 8 Nov 2016 16:57:32 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:56325 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbcKHV53 (ORCPT ); Tue, 8 Nov 2016 16:57:29 -0500 Date: Tue, 8 Nov 2016 22:54:52 +0100 (CET) From: Thomas Gleixner To: Borislav Petkov cc: "Luck, Tony" , linux-edac , X86 ML , LKML Subject: Re: [PATCH] x86/MCE: Remove MCP_TIMESTAMP In-Reply-To: <20161108212439.smukc7ayq7bvo6qd@pd.tnic> Message-ID: References: <20161101120911.13163-1-bp@alien8.de> <20161105131104.drouavgezizz4w7v@pd.tnic> <3908561D78D1C84285E8C5FCA982C28F3A22720B@ORSMSX114.amr.corp.intel.com> <20161107180853.4uxlvtoychzhwr2q@pd.tnic> <3908561D78D1C84285E8C5FCA982C28F3A22728C@ORSMSX114.amr.corp.intel.com> <20161108180932.wvvcbbzrzrai26eg@pd.tnic> <20161108210819.gx7bfw7pfx4e6tf4@pd.tnic> <20161108212439.smukc7ayq7bvo6qd@pd.tnic> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Nov 2016, Borislav Petkov wrote: > On Tue, Nov 08, 2016 at 10:14:04PM +0100, Thomas Gleixner wrote: > > And yes, you should spend the extra cycles. Adding a flags argument to > > mce_setup() and propagate it through the various callsites shouldn't be > > that hard and would make the stuff obvious instead of obfuscated. > > Sure, that's already on my TODO. I want to take a look at it when I have > a quiet moment. So for now we should fold something like the below into this patch. Thanks, tglx 8<-------------------- --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -706,6 +706,15 @@ bool machine_check_poll(enum mcp_flags f mce_gather_info(&m, NULL); + /* + * m.tsc was set in mce_setup(). Clear it if not requested. + * + * FIXME: Propagate @flags to mce_gather_info/mce_setup() to avoid + * that dance + */ + if (!(flags & MCP_TIMESTAMP)) + m.tsc = 0; + for (i = 0; i < mca_cfg.banks; i++) { if (!mce_banks[i].ctl || !test_bit(i, *b)) continue; @@ -734,9 +743,6 @@ bool machine_check_poll(enum mcp_flags f mce_read_aux(&m, i); - if (!(flags & MCP_TIMESTAMP)) - m.tsc = 0; - severity = mce_severity(&m, mca_cfg.tolerant, NULL, false); if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m))