[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<LV3PR12MB92651777DD5C8A010E010A8794B92@LV3PR12MB9265.namprd12.prod.outlook.com>
Date: Sun, 20 Apr 2025 21:03:25 +0000
From: "Kaplan, David" <David.Kaplan@....com>
To: Borislav Petkov <bp@...en8.de>
CC: Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra
<peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>, Pawan Gupta
<pawan.kumar.gupta@...ux.intel.com>, Ingo Molnar <mingo@...hat.com>, Dave
Hansen <dave.hansen@...ux.intel.com>, "x86@...nel.org" <x86@...nel.org>, "H .
Peter Anvin" <hpa@...or.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v5 02/16] x86/bugs: Restructure TAA mitigation
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Borislav Petkov <bp@...en8.de>
> Sent: Saturday, April 19, 2025 7:37 AM
> To: Kaplan, David <David.Kaplan@....com>
> Cc: Thomas Gleixner <tglx@...utronix.de>; Peter Zijlstra <peterz@...radead.org>;
> Josh Poimboeuf <jpoimboe@...nel.org>; Pawan Gupta
> <pawan.kumar.gupta@...ux.intel.com>; Ingo Molnar <mingo@...hat.com>; Dave
> Hansen <dave.hansen@...ux.intel.com>; x86@...nel.org; H . Peter Anvin
> <hpa@...or.com>; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v5 02/16] x86/bugs: Restructure TAA mitigation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Fri, Apr 18, 2025 at 11:17:07AM -0500, David Kaplan wrote:
> > @@ -394,6 +399,11 @@ static const char * const taa_strings[] = {
> > [TAA_MITIGATION_TSX_DISABLED] = "Mitigation: TSX disabled",
> > };
> >
> > +static bool __init taa_vulnerable(void) {
> > + return boot_cpu_has_bug(X86_BUG_TAA) &&
> > +boot_cpu_has(X86_FEATURE_RTM); }
> > +
> > static void __init taa_select_mitigation(void) {
> > if (!boot_cpu_has_bug(X86_BUG_TAA)) {
>
> Shouldn't you use !taa_vulnerable() here directly too, since we're introducing it as a
> helper?
>
No, because taa_vulnerable() requires both X86_BUG_TAA and X86_FEATURE_RTM.
In taa_select_mitigation() there is a difference depending on which of these doesn't exist which sets the mitigation to either OFF (if unaffected) or TSX_DISABLED (if no RTM).
taa_vulnerable() is used however in taa_update_mitigation().
--David Kaplan
Powered by blists - more mailing lists