summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/pmu.h
diff options
context:
space:
mode:
authorLike Xu <like.xu@linux.intel.com>2020-06-24 03:59:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-07-08 22:21:59 +0200
commit2e8cd7a3b82874e9cb3e42d916dda05cd790cc1a (patch)
tree994265378ecbef9b0dc83c4182adc4d4c8b31a9b /arch/x86/kvm/pmu.h
parentKVM: nSVM: Check that MBZ bits in CR3 and CR4 are not set on vmrun of nested ... (diff)
downloadlinux-2e8cd7a3b82874e9cb3e42d916dda05cd790cc1a.tar.xz
linux-2e8cd7a3b82874e9cb3e42d916dda05cd790cc1a.zip
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>
Diffstat (limited to 'arch/x86/kvm/pmu.h')
-rw-r--r--arch/x86/kvm/pmu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h
index ab85eed8a6cc..067fef51760c 100644
--- a/arch/x86/kvm/pmu.h
+++ b/arch/x86/kvm/pmu.h
@@ -15,6 +15,8 @@
#define VMWARE_BACKDOOR_PMC_REAL_TIME 0x10001
#define VMWARE_BACKDOOR_PMC_APPARENT_TIME 0x10002
+#define MAX_FIXED_COUNTERS 3
+
struct kvm_event_hw_type_mapping {
u8 eventsel;
u8 unit_mask;