Re: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG

From: Pawan Gupta

Date: Tue Oct 07 2025 - 19:08:28 EST


On Wed, Oct 08, 2025 at 12:12:29AM +0200, Borislav Petkov wrote:
> On Tue, Oct 07, 2025 at 11:22:57AM -0700, Pawan Gupta wrote:
> > Even when CPU mitigations are disabled there is still some handling
> > required for mitigations like GDS that requires a write to MSR to ensure
> > correct behavior.
>
> When mitigations are compiled out there are no mitigations by definition.

GDS microcode mitigation is enabled by default, for disabling the
mitigation an MSR write is required.

> So whatever you're talking about must be something else which should
> happen in vendor code.

Perhaps yes when bugs.c is compiled out.

> > IMO, rather than targeting the mitigation enabling code it might make more
> > sense to compile out the actual mitigations scattered accross the kernel.
> > This may also improve performance by reducing the code footprint, and can
> > also help getting a cleaner disassembly.
>
> Probably... however, it needs to be done smartly because sprinkling ifdeffery
> and turning what is an already unreadable mess into a bigger abomination,
> won't fly. Perhaps split out the mitigations glue into separate compilation
> units and build-disable them... we'll see.

Ya, that would be better.