Register Centaur CPUID leaves 0xC0000000 and 0xC0000001.EAX to be skipped during paranoid CPUID verification for the VMX overlay. Ignore all registers of leaf 0xC0000000, which reports the max supported CPUID leaf in EAX and vendor-string-like data in EBX/ECX/EDX. For 0xC0000001, ignore EAX that holding the CPUID version. EDX is already tracked CPUID_C000_0001_EDX. EBX and ECX are reserved. 0xC0000002 ~ 0xC0000004 are reserved for future use. Use F_CPUID_VMX for the overlay mask when adding to ignored set since Centaur/VIA processors are VMX-based, and these leaves are not applicable to SVM or TDX guests. Signed-off-by: Binbin Wu --- arch/x86/kvm/cpuid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 471733eb68d8..c75e7859cc2c 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1552,6 +1552,11 @@ void kvm_initialize_cpu_caps(void) if (!static_cpu_has_bug(X86_BUG_NULL_SEG)) kvm_cpu_cap_set(X86_FEATURE_NULL_SEL_CLR_BASE, F_CPUID_SVM); + kvm_cpu_cap_ignore(0xC0000000, 0, 0, + BIT(CPUID_EAX) | BIT(CPUID_EBX) | BIT(CPUID_ECX) | BIT(CPUID_EDX), + F_CPUID_VMX); + + kvm_cpu_cap_ignore(0xC0000001, 0, 0, BIT(CPUID_EAX), F_CPUID_VMX); kvm_cpu_cap_init(CPUID_C000_0001_EDX, F(XSTORE, F_CPUID_DEFAULT), F(XSTORE_EN, F_CPUID_DEFAULT), -- 2.46.0