RE: [PATCH v3 12/35] x86/bugs: Restructure retbleed mitigation

From: Kaplan, David
Date: Mon Feb 10 2025 - 15:51:08 EST


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Brendan Jackman <jackmanb@xxxxxxxxxx>
> Sent: Monday, February 10, 2025 12:35 PM
> To: Kaplan, David <David.Kaplan@xxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>; Borislav Petkov <bp@xxxxxxxxx>; Peter
> Zijlstra <peterz@xxxxxxxxxxxxx>; Josh Poimboeuf <jpoimboe@xxxxxxxxxx>; 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 12/35] x86/bugs: Restructure retbleed mitigation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Wed, 8 Jan 2025 at 21:29, David Kaplan <david.kaplan@xxxxxxx> wrote:
> > @@ -1827,16 +1821,6 @@ static void __init spectre_v2_select_mitigation(void)
> > break;
> > }
> >
> > - if (IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY) &&
> > - boot_cpu_has_bug(X86_BUG_RETBLEED) &&
> > - retbleed_cmd != RETBLEED_CMD_OFF &&
> > - retbleed_cmd != RETBLEED_CMD_STUFF &&
> > - boot_cpu_has(X86_FEATURE_IBRS) &&
> > - boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
> > - mode = SPECTRE_V2_IBRS;
> > - break;
> > - }
> > -
> > mode = spectre_v2_select_retpoline();
> > break;
>
> It isn't quite clear why this gets removed here. Doesn't
> retbleed_update_mitigation() still depend on this?
>
> It gets added back in 15/35 so this would be at most a problem of git history.

Thanks, I'll fix this. The logic had to change because retbleed_cmd is removed as part of the restructure, but that doesn't mean the whole block needs to be removed...and it does move into spectre_v2_update_mitigation() in patch 15.

--David Kaplan