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

Kaplan, David
2025-02-10T20:50:59Z

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Brendan Jackman <jackmanb@google.com>
> Sent: Monday, February 10, 2025 12:35 PM
> To: Kaplan, David <David.Kaplan@amd.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>; Borislav Petkov <bp@alien8.de>; Peter
> Zijlstra <peterz@infradead.org>; Josh Poimboeuf <jpoimboe@kernel.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 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@amd.com> 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