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

Pawan Gupta <[email protected]>
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Wed, Oct 23, 2019 at 08:46:54AM +0200, speck for Borislav Petkov wrote:
> On Tue, Oct 22, 2019 at 10:25:27PM -0700, speck for Pawan Gupta wrote:
> > I think we first need to agree on whether disabling TSX is the
> > mitigation for X86_BUG_TAA or the lack of bug. Your clearing the bug bit
> > here makes me think that you are treating it as lack of bug. This series
> > treats it as a mitigation when the hardware has the bug. Let me know
> > your thoughts on this.
> 
> Ok, I see your point. And yes, let's do what you're suggesting because
> that mirrors reality optimally:
> 
> static void __init taa_select_mitigation(void)
> { 
>         u64 ia32_cap;
> 
>         if (!boot_cpu_has_bug(X86_BUG_TAA) || cpu_mitigations_off()) {
>                 taa_mitigation = TAA_MITIGATION_OFF;
>                 return;
>         }

There is a small issue with cpu_mitigations_off() check before X86_FEATURE_RTM.

If the user provides cmdline "tsx=off mitigations=off" then sysfs will
show "Vulnerable", when it is actually mitigated because of "tsx=off".

> 
> 	if (!boot_cpu_has(X86_FEATURE_RTM)) {
>                 taa_mitigation = TAA_MITIGATION_TSX_DISABLE;
>                 goto out;
>         }

cpu_mitigations_off() check after X86_FEATURE_RTM check will fix this.

Thanks,
Pawan
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.