Re: [PATCH v2] KVM: x86: synthesize CPUID bits only if CPU capability is set
From: Sean Christopherson
Date: Thu Mar 05 2026 - 12:08:21 EST
On Mon, 09 Feb 2026 16:31:09 +0100, Carlos López wrote:
> KVM incorrectly synthesizes CPUID bits for KVM-only leaves, as the
> following branch in kvm_cpu_cap_init() is never taken:
>
> if (leaf < NCAPINTS)
> kvm_cpu_caps[leaf] &= kernel_cpu_caps[leaf];
>
> This means that bits set via SYNTHESIZED_F() for KVM-only leaves are
> unconditionally set. This for example can cause issues for SEV-SNP
> guests running on Family 19h CPUs, as TSA_SQ_NO and TSA_L1_NO are
> always enabled by KVM in 80000021[ECX]. When userspace issues a
> SNP_LAUNCH_UPDATE command to update the CPUID page for the guest, SNP
> firmware will explicitly reject the command if the page sets sets these
> bits on vulnerable CPUs.
>
> [...]
Applied to kvm-x86 fixes, thanks!
[1/1] KVM: x86: synthesize CPUID bits only if CPU capability is set
https://github.com/kvm-x86/linux/commit/6a5028d8f9f4
--
https://github.com/kvm-x86/linux/tree/next