[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<LV3PR12MB92652472998B1312D27F2E0C945B2@LV3PR12MB9265.namprd12.prod.outlook.com>
Date: Thu, 14 Nov 2024 17:17:48 +0000
From: "Kaplan, David" <David.Kaplan@....com>
To: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
CC: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
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 v2 03/35] x86/bugs: Add AUTO mitigations for
mds/taa/mmio/rfds
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
> Sent: Thursday, November 14, 2024 11:14 AM
> To: Kaplan, David <David.Kaplan@....com>
> Cc: Thomas Gleixner <tglx@...utronix.de>; Borislav Petkov <bp@...en8.de>; Peter
> Zijlstra <peterz@...radead.org>; Josh Poimboeuf <jpoimboe@...nel.org>; 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 v2 03/35] x86/bugs: Add AUTO mitigations for
> mds/taa/mmio/rfds
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, Nov 14, 2024 at 02:59:34PM +0000, Kaplan, David wrote:
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > > -----Original Message-----
> > > From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
> > > Sent: Wednesday, November 13, 2024 8:27 PM
> > > To: Kaplan, David <David.Kaplan@....com>
> > > Cc: Thomas Gleixner <tglx@...utronix.de>; Borislav Petkov
> > > <bp@...en8.de>; Peter Zijlstra <peterz@...radead.org>; Josh
> > > Poimboeuf <jpoimboe@...nel.org>; 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 v2 03/35] x86/bugs: Add AUTO mitigations for
> > > mds/taa/mmio/rfds
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > On Tue, Nov 05, 2024 at 03:54:23PM -0600, David Kaplan wrote:
> > > > @@ -1995,6 +2004,7 @@ void cpu_bugs_smt_update(void)
> > > > update_mds_branch_idle();
> > > > break;
> > > > case MDS_MITIGATION_OFF:
> > > > + case MDS_MITIGATION_AUTO:
> > >
> > > This implies AUTO and OFF are similar, which is counter intuitive.
> > > While mitigation selection code ...
> > >
> > > > + if (mds_mitigation == MDS_MITIGATION_AUTO)
> > > > + mds_mitigation = MDS_MITIGATION_FULL;
> > > > +
> > >
> > > ... indicates that AUTO is equivalent to FULL. So, I think AUTO
> > > should be handled the same way as FULL in cpu_bugs_smt_update() as well.
> > >
> > > Same for TAA and MMIO below.
> > >
> >
> > The mitigation is never actually AUTO by the time we call
> > cpu_bugs_smt_update(), since this happens after cpu_select_mitigations().
> > I had to add the case statement here so the switch statement was
> > complete, but this case will never be hit.
> >
> > Should I put a comment here about that? Or is a default case the
> > better way to handle this?
>
> My suggestion would be to treat AUTO as FULL, and move it up with FULL:
>
> switch (mds_mitigation) {
> case MDS_MITIGATION_FULL:
> + case MDS_MITIGATION_AUTO:
> case MDS_MITIGATION_VMWERV:
> if (sched_smt_active() && !boot_cpu_has(X86_BUG_MSBDS_ONLY))
> pr_warn_once(MDS_MSG_SMT);
> update_mds_branch_idle();
> break;
> case MDS_MITIGATION_OFF:
> break;
> }
Ok, I can do that
Thanks --David Kaplan
Powered by blists - more mailing lists