Re: [tip:x86/alternatives] [x86/alternatives] ee8962082a: WARNING:at_arch/x86/kernel/cpu/cpuid-deps.c:#do_clear_cpu_cap

From: Borislav Petkov
Date: Tue Apr 30 2024 - 18:33:39 EST


On Tue, Apr 30, 2024 at 12:51:02PM -0700, Sean Christopherson wrote:
> But that would just mask the underlying problem, it wouldn't actually fix anything
> other than making the WARN go away. Unless I'm misreading the splat+code, the
> issue isn't that init_ia32_feat_ctl() clears VMX late, it's that the BSP sees
> VMX as fully enabled, but at least one AP sees VMX as disabled.
>
> I don't see how the kernel can expect to function correctly with divergent feature
> support across CPUs, i.e. the WARN is a _good_ thing in this case, because it
> alerts the user that their system is messed up, e.g. has a bad BIOS or something.

Yes, and yes.

There are two issues. Clearing feature flags after alternatives have
been applied should not happen, and this particular issue with that box.

Lemme cook up something in the coming days for the former.

As to the box having misconfigured VMX settings, dmesg says:

[ 0.055225][ T0] x86/cpu: VMX (outside TXT) disabled by BIOS

which means this:

(!tboot && !(msr & FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX))) {

so... I have no clue what needs to happen here. BIOS update...

I hope we won't try to do some nasty fix for b0rked BIOSes again...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette