[MODERATED] Re: [PATCH v7 04/10] TAAv7 4

Borislav Petkov <[email protected]>
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Tue, Oct 22, 2019 at 11:53:21PM +0200, Borislav Petkov wrote:
> On Tue, Oct 22, 2019 at 02:29:02PM -0700, speck for Pawan Gupta wrote:
> > Side effect of RTM check ahead of X86_BUG_TAA will be a dmesg print
> > "Mitigation: TSX disabled" when X86_BUG_TAA is not set.
> 
> So what you're trying to tell me is that you don't want to print that
> message at all?
> 
> 	if (!boot_cpu_has(X86_FEATURE_RTM)) {
> 		taa_mitigation = TAA_MITIGATION_TSX_DISABLE;
> 		return;
> 	}
> 
> How's that?

And to perhaps answer your other question from below maybe - I'm
assuming you want something like this:

	if (!boot_cpu_has(X86_FEATURE_RTM)) {
		taa_mitigation = TAA_MITIGATION_TSX_DISABLE;
		setup_clear_cpu_bug(X86_BUG_TAA);
		return;
	}

This is assuming X86_FEATURE_RTM really mirrors the CPUID bit. And that
should be the case since if you do tsx_disable(), it will clear the
CPUID bit through the MSR. IOW, when TSX is disabled, you're basically
not affected by TAA, of course.

> > > Also, from all the possible settings:
> > > 
> > >         [TAA_MITIGATION_OFF]            = "Vulnerable",
> > >         [TAA_MITIGATION_UCODE_NEEDED]   = "Vulnerable: Clear CPU buffers attempted, no microcode",
> > >         [TAA_MITIGATION_VERW]           = "Mitigation: Clear CPU buffers",
> > >         [TAA_MITIGATION_TSX_DISABLE]    = "Mitigation: TSX disabled",
> > > 
> > > TAA_MITIGATION_TSX_DISABLE is the one that fits best for the !RTM case,
> > > no?
> > 
> > When X86_BUG_TAA is not set sysfs shows "Not affected" irrespective of
> > value of taa_mitigation.
> > 
> > 	cpu_show_common()
> > 	{
> > 		if (!boot_cpu_has_bug(bug))
> > 			return sprintf(buf, "Not affected\n");
> > 		[...]
> 
> Sorry, I can't follow what you're trying to tell me here.

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
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.