Re: [patch V6 10/14] MDS basics 10

Thomas Gleixner <[email protected]>
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.