]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Mask off reserved bits in CPUID.80000008H
authorJim Mattson <jmattson@google.com>
Thu, 29 Sep 2022 22:52:00 +0000 (15:52 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 22 Oct 2022 11:54:36 +0000 (07:54 -0400)
commitd373963c2eba92694c2277451de1d4d7be323c8b
treed885616d58aa4f34e9535ad8770d1b888ae30f11
parentb7daa21357349498ac6954e8d08e3dc1646e5bf0
KVM: x86: Mask off reserved bits in CPUID.80000008H

KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM
actually supports. The following ranges of CPUID.80000008H are reserved
and should be masked off:
    ECX[31:18]
    ECX[11:8]

In addition, the PerfTscSize field at ECX[17:16] should also be zero
because KVM does not set the PERFTSC bit at CPUID.80000001H.ECX[27].

Fixes: 4c6c3c2fac70 ("KVM: Sanitize cpuid")
Signed-off-by: Jim Mattson <jmattson@google.com>
Message-Id: <20220929225203.2234702-3-jmattson@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c