RE: [PATCH v4 11/36] x86/bugs: Restructure spectre_v2_user mitigation

From: Kaplan, David
Date: Tue Apr 15 2025 - 11:00:14 EST


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Sent: Monday, April 14, 2025 6:49 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 11/36] x86/bugs: Restructure spectre_v2_user mitigation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Mon, Apr 14, 2025 at 07:20:59PM +0000, Kaplan, David wrote:
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > > -----Original Message-----
> > > From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> > > Sent: Thursday, April 10, 2025 11:41 AM
> > > 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 11/36] x86/bugs: Restructure spectre_v2_user
> > > 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:39:58AM -0500, David Kaplan wrote:
> > > > @@ -214,6 +211,8 @@ void __init cpu_select_mitigations(void)
> > > > * choices.
> > > > */
> > > > retbleed_update_mitigation();
> > > > + /* spectre_v2_user_update_mitigation() depends on retbleed_mitigation
> */
> > > > + spectre_v2_user_update_mitigation();
> > >
> > > Function names need trailing parentheses: "retbleed_mitigation()"
> > >
> >
> > That one is not actually a function name, it's the name of the file-scope variable.
>
> Why refer to a variable? Isn't it the function dependencies which matter here?
>

Yeah, I agree. The variable is what gets checked in the dependent function, but given this code block is all about the order of these various function calls, then using a function name makes more sense.

--David Kaplan