KVM: x86: Mask off reserved bits in CPUID.8000001FH
authorJim Mattson <jmattson@google.com>
Thu, 29 Sep 2022 22:52:03 +0000 (15:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 17:15:41 +0000 (18:15 +0100)
commit19c2b2ffbeec0de64202b261f974686eb1dc33d0
tree91cf2d629b0dc99acc932a49a710befb2500e4ae
parent553fd40d3bf7f9077cb59f4f49dcbce082c745a3
KVM: x86: Mask off reserved bits in CPUID.8000001FH

commit 86c4f0d547f6460d0426ebb3ba0614f1134b8cda upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/cpuid.c