From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 06 Mar 2019 15:30:34 -0000 Received: from p5492e2fc.dip0.t-ipconnect.de ([84.146.226.252] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1h1YV7-0006iJ-Cf for speck@linutronix.de; Wed, 06 Mar 2019 16:30:33 +0100 Date: Wed, 6 Mar 2019 16:30:32 +0100 (CET) From: Thomas Gleixner Subject: Re: [patch V6 10/14] MDS basics 10 In-Reply-To: <20190306143122.GF21338@zn.tnic> Message-ID: References: <20190301214738.281554861@linutronix.de> <20190301214848.075448450@linutronix.de> <20190306143122.GF21338@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Wed, 6 Mar 2019, speck for Borislav Petkov wrote: > On Fri, Mar 01, 2019 at 10:47:48PM +0100, speck for Thomas Gleixner wrote: > > +/* Update the static key controlling the MDS CPU buffer clear in idle */ > > +static void update_mds_branch_idle(void) > > +{ > > + /* > > + * Enable the idle clearing on CPUs which are affected only by > > + * MDBDS and not any other MDS variant. The other variants cannot > > + * be mitigated when SMT is enabled, > > ... but we're not enabling the key when SMT on those is disabled, > AFAICT. Or is that coming later? Five lines down .... > > so clearing the buffers on > > + * idle would be a window dressing exercise. > > + */ > > + if (!boot_cpu_has(X86_BUG_MSBDS_ONLY)) > > if (!boot_cpu_has_bug Fixed. > > + return; > > + > > + if (sched_smt_active()) ... here is the decision whether to enable or disable. > > + static_branch_enable(&mds_idle_clear); > > + else > > + static_branch_disable(&mds_idle_clear); > > +} Thanks, tglx