RE: [PATCH v3 15/35] x86/bugs: Restructure spectre_v2 mitigation
From: Kaplan, David
Date: Wed Feb 12 2025 - 11:41:54 EST
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Sent: Monday, February 10, 2025 7:08 PM
> To: Kaplan, David <David.Kaplan@xxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>; Borislav Petkov <bp@xxxxxxxxx>; Peter
> Zijlstra <peterz@xxxxxxxxxxxxx>; Pawan Gupta
> <pawan.kumar.gupta@xxxxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Dave
> Hansen <dave.hansen@xxxxxxxxxxxxxxx>; x86@xxxxxxxxxx; H . Peter Anvin
> <hpa@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 15/35] x86/bugs: Restructure spectre_v2 mitigation
>
> 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:24:55PM -0600, David Kaplan wrote:
> > +static void __init spectre_v2_update_mitigation(void)
> > +{
> > + if (spectre_v2_cmd == SPECTRE_V2_CMD_AUTO) {
> > + if (IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY) &&
> > + boot_cpu_has_bug(X86_BUG_RETBLEED) &&
> > + retbleed_mitigation != RETBLEED_MITIGATION_NONE &&
> > + retbleed_mitigation != RETBLEED_MITIGATION_STUFF &&
> > + boot_cpu_has(X86_FEATURE_IBRS) &&
> > + boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
> > + spectre_v2_enabled = SPECTRE_V2_IBRS;
> > + }
> > + }
>
> This has a dependency on retbleed_update_mitigation() which hasn't run yet?
>
It's actually the reverse, retbleed_update_mitigation() needs to run after this. That hasn't changed vs upstream, although I do need to document that.
--David Kaplan