kvm: x86: limit the maximum number of vPMU fixed counters to 3
authorLike Xu <like.xu@linux.intel.com>
Wed, 24 Jun 2020 01:59:28 +0000 (09:59 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jul 2020 20:21:59 +0000 (16:21 -0400)
commit2e8cd7a3b82874e9cb3e42d916dda05cd790cc1a
tree994265378ecbef9b0dc83c4182adc4d4c8b31a9b
parent761e4169346553c180bbd4a383aedd72f905bc9a
kvm: x86: limit the maximum number of vPMU fixed counters to 3

Some new Intel platforms (such as TGL) already have the
fourth fixed counter TOPDOWN.SLOTS, but it has not been
fully enabled on KVM and the host.

Therefore, we limit edx.split.num_counters_fixed to 3,
so that it does not break the kvm-unit-tests PMU test
case and bad-handled userspace.

Signed-off-by: Like Xu <like.xu@linux.intel.com>
Message-Id: <20200624015928.118614-1-like.xu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/pmu.h