From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 07 Nov 2019 02:41:41 -0000 Received: from youngberry.canonical.com ([91.189.89.112]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1iSXjw-0006al-Bs for speck@linutronix.de; Thu, 07 Nov 2019 03:41:40 +0100 Received: from 1.general.tyhicks.us.vpn ([10.172.64.52] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSXjn-00028l-Ud for speck@linutronix.de; Thu, 07 Nov 2019 02:41:33 +0000 Date: Wed, 6 Nov 2019 20:41:27 -0600 From: Tyler Hicks Subject: [MODERATED] Re: [PATCH] taa fix Message-ID: <20191107024125.GG27159@elm> References: <20191107022646.6h724wh4im5zxvw2@treble> MIME-Version: 1.0 In-Reply-To: <20191107022646.6h724wh4im5zxvw2@treble> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On 2019-11-06 20:26:46, speck for Josh Poimboeuf wrote: > From: Josh Poimboeuf > Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk > > For new IBRS_ALL CPUs, the Enhanced IBRS check at the beginning of > cpu_bugs_smt_update() causes the function to return early, > unintentionally skipping the MDS and TAA logic. > > I don't think it's a problem for MDS, because AFAICT there appears to be > no overlap between IBRS_ALL and MDS-affected CPUs. So the MDS > mitigation would be disabled and nothing would need to be done in this > function anyway. > > But for TAA, the TAA_MSG_SMT string will never get printed on Cascade > Lake and newer. > > The check is superfluous anyway: when 'spectre_v2_enabled' is > SPECTRE_V2_IBRS_ENHANCED, 'spectre_v2_user' is always > SPECTRE_V2_USER_NONE, and so the 'spectre_v2_user' switch statement > handles it appropriately by doing nothing. So just remove the check. > > Fixes: 1b42f017415b ("x86/speculation/taa: Add mitigation for TSX Async Abort") > Signed-off-by: Josh Poimboeuf Reviewed-by: Tyler Hicks I went back through my testing logs and verified that I didn't see the TAA_MSG_SMT message printed on the Cascade Lake machine I tested with. Thanks for noticing and fixing it. Tyler > --- > arch/x86/kernel/cpu/bugs.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c > index 850005590167..4c7b0fa15a19 100644 > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/kernel/cpu/bugs.c > @@ -886,10 +886,6 @@ static void update_mds_branch_idle(void) > > void cpu_bugs_smt_update(void) > { > - /* Enhanced IBRS implies STIBP. No update required. */ > - if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED) > - return; > - > mutex_lock(&spec_ctrl_mutex); > > switch (spectre_v2_user) { > -- > 2.20.1 >