]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 14:46:07 +0000 (15:46 +0100)
commitfd42634ae013c439ac119768d7562f00e594a47c
treea24c4b6c7dfa4de90c6255f68a103119289c3910
parent0de5ee103747fd3a24f1c010c79caabe35e8f0bb
KVM: x86: Mask off reserved bits in CPUID.80000008H

commit 7030d8530e533844e2f4b0e7476498afcd324634 upstream.

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