diff options
| author | 2022-05-09 18:22:02 +0800 | |
|---|---|---|
| committer | 2022-06-08 04:48:35 -0400 | |
| commit | 98defd2e17803263f49548fea930cfc974d505aa (patch) | |
| tree | 9698ea3f567700cfefb86447075abe3a6f2aa9f1 /arch | |
| parent | KVM: x86/pmu: Don't overwrite the pmu->global_ctrl when refreshing (diff) | |
KVM: x86/pmu: Ignore pmu->global_ctrl check if vPMU doesn't support global_ctrl
MSR_CORE_PERF_GLOBAL_CTRL is introduced as part of Architecture PMU V2,
as indicated by Intel SDM 19.2.2 and the intel_is_valid_msr() function.
So in the absence of global_ctrl support, all PMCs are enabled as AMD does.
Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20220509102204.62389-1-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kvm/vmx/pmu_intel.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c index 1c6f2ca2beac..2fc90080dcce 100644 --- a/arch/x86/kvm/vmx/pmu_intel.c +++ b/arch/x86/kvm/vmx/pmu_intel.c @@ -98,6 +98,9 @@ static bool intel_pmc_is_enabled(struct kvm_pmc *pmc) { struct kvm_pmu *pmu = pmc_to_pmu(pmc); + if (pmu->version < 2) + return true; + return test_bit(pmc->idx, (unsigned long *)&pmu->global_ctrl); } |
