summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJim Mattson <jmattson@google.com>2022-09-29 15:52:03 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2022-10-27 04:41:54 -0400
commit86c4f0d547f6460d0426ebb3ba0614f1134b8cda (patch)
treebc0a6adfec377c2321f77b658dfcf920f20c8009 /arch
parent079f6889818dd07903fb36c252532ab47ebb6d48 (diff)
downloadlinux-rpi-86c4f0d547f6460d0426ebb3ba0614f1134b8cda.tar.gz
linux-rpi-86c4f0d547f6460d0426ebb3ba0614f1134b8cda.tar.bz2
linux-rpi-86c4f0d547f6460d0426ebb3ba0614f1134b8cda.zip
KVM: x86: Mask off reserved bits in CPUID.8000001FH
KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.8000001FH:EBX[31:16] are reserved bits and should be masked off. Fixes: 8765d75329a3 ("KVM: X86: Extend CPUID range to include new leaf") Signed-off-by: Jim Mattson <jmattson@google.com> Message-Id: <20220929225203.2234702-6-jmattson@google.com> Cc: stable@vger.kernel.org [Clear NumVMPL too. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/cpuid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index a0292ba650df..0810e93cbedc 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1199,7 +1199,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
} else {
cpuid_entry_override(entry, CPUID_8000_001F_EAX);
-
+ /* Clear NumVMPL since KVM does not support VMPL. */
+ entry->ebx &= ~GENMASK(31, 12);
/*
* Enumerate '0' for "PA bits reduction", the adjusted
* MAXPHYADDR is enumerated directly (see 0x80000008).