[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241114171411.om2djgzbmrkxj2ph@desk>
Date: Thu, 14 Nov 2024 09:14:11 -0800
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
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" <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
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;
}
Powered by blists - more mailing lists