Re: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG
From: Pawan Gupta
Date: Tue Oct 07 2025 - 14:23:03 EST
On Mon, Oct 06, 2025 at 04:04:42PM +0200, Borislav Petkov wrote:
> On Mon, Oct 06, 2025 at 01:58:55PM +0000, Kaplan, David wrote:
> > Sounds rather yucky.
>
> I'll give it a try at some point and see how ugly it becomes...
>
> > What about just not calling cpu_select_mitigations() if
> > CONFIG_CPU_MITIGATIONS=n? Then you won't get any print messages either I'd
> > think.
>
> I want to not compile in that code at all if CPU_MITIGATIONS=off, actually.
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. So not all of bugs.c can be compiled out easily.
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.