RE: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG

From: Kaplan, David

Date: Thu Oct 09 2025 - 14:13:36 EST


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
> Sent: Thursday, October 9, 2025 12:14 PM
> To: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>; Kaplan, David
> <David.Kaplan@xxxxxxx>; Thomas Gleixner <tglx@xxxxxxxxxxxxx>; Peter Zijlstra
> <peterz@xxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Dave Hansen
> <dave.hansen@xxxxxxxxxxxxxxx>; x86@xxxxxxxxxx; H . Peter Anvin
> <hpa@xxxxxxxxx>; Klaus Kusche <klaus.kusche@xxxxxxxxxxxxxxx>; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, Oct 09, 2025 at 12:15:57PM +0200, Borislav Petkov wrote:
> > On Wed, Oct 08, 2025 at 11:04:32PM -0700, Pawan Gupta wrote:
> > > Thats a lot. OTOH, most of the bugs.c is __init code, do you think it is
> > > still problematic?
> >
> > What is wrong with aiming to not have dead code in the kernel if it can be
> > removed cleanly?
>
> Nothing wrong with that. There are certain things (like I mentioned
> earlier) that needs to be moved out of bugs.c.

If we really want to optimize a CONFIG_CPU_MITIGATIONS=n kernel, why not also look at alternatives that will never be enabled?

All the extra NOPs I think can affect performance in various ways and if there was a way at compile time to know that the alternative would never be enabled (because the feature is completely dependent on a cpu mitigation) you could eliminate the NOPs...

--David Kaplan