RE: [PATCH v4 16/36] x86/bugs: Restructure srso mitigation

From: Kaplan, David
Date: Mon Apr 14 2025 - 17:12:43 EST


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Sent: Thursday, April 10, 2025 12:39 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; Brendan Jackman
> <jackmanb@xxxxxxxxxx>; Derek Manwaring <derekmn@xxxxxxxxxx>
> Subject: Re: [PATCH v4 16/36] x86/bugs: Restructure srso mitigation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Mon, Mar 10, 2025 at 11:40:03AM -0500, David Kaplan wrote:
> > @@ -229,6 +226,8 @@ void __init cpu_select_mitigations(void)
> > taa_update_mitigation();
> > mmio_update_mitigation();
> > rfds_update_mitigation();
> > + /* srso_update_mitigation() relies on retbleed_mitigation. */
> > + srso_update_mitigation();
>
> "relies on" -> "depends on" for consistency with the other comments.
> Also it's "retbleed_update_mitigation". Also needs parentheses:

Ack. I was referring to the variable here, but I can refer to the function which probably makes more sense given that is what is called here.

>
> /* srso_update_mitigation() depends on retbleed_update_mitigation() */
>
> > + switch (srso_mitigation) {
> > + case SRSO_MITIGATION_SAFE_RET:
> > + if (!IS_ENABLED(CONFIG_MITIGATION_SRSO))
> > pr_err("WARNING: kernel not compiled with
> MITIGATION_SRSO.\n");
>
> srso_mitigation should be reset to NONE here?
>
> > - } else {
> > - pr_err("WARNING: kernel not compiled with
> MITIGATION_IBPB_ENTRY.\n");
>
> Same here.
>

Ack to both.

Thanks --David Kaplan