RE: [PATCH v3 30/35] x86/bugs: Add attack vector controls for spectre_v2_user

Kaplan, David
2025-02-12T17:22:48Z

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Josh Poimboeuf <jpoimboe@kernel.org>
> Sent: Tuesday, February 11, 2025 1:03 PM
> To: Kaplan, David <David.Kaplan@amd.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>; Borislav Petkov <bp@alien8.de>; Peter
> Zijlstra <peterz@infradead.org>; Pawan Gupta
> <pawan.kumar.gupta@linux.intel.com>; Ingo Molnar <mingo@redhat.com>; Dave
> Hansen <dave.hansen@linux.intel.com>; x86@kernel.org; H . Peter Anvin
> <hpa@zytor.com>; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v3 30/35] x86/bugs: Add attack vector controls for
> spectre_v2_user
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Wed, Jan 08, 2025 at 02:25:10PM -0600, David Kaplan wrote:
> > @@ -1614,6 +1614,13 @@ spectre_v2_user_select_mitigation(void)
> > spectre_v2_user_stibp = SPECTRE_V2_USER_STRICT;
> > break;
> > case SPECTRE_V2_USER_CMD_AUTO:
> > + if (should_mitigate_vuln(X86_BUG_SPECTRE_V2_USER)) {
> > + spectre_v2_user_ibpb = SPECTRE_V2_USER_PRCTL;
> > + spectre_v2_user_stibp = SPECTRE_V2_USER_PRCTL;
> > + } else {
> > + return;
> > + }
> > + break;
>
> Can just fallthrough in the should_mitigate_vuln() case?

Yeah, I can do that.

--David Kaplan

>
> > case SPECTRE_V2_USER_CMD_PRCTL:
> > spectre_v2_user_ibpb = SPECTRE_V2_USER_PRCTL;
> > spectre_v2_user_stibp = SPECTRE_V2_USER_PRCTL;
>
> --
> Josh