linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] KVM: x86/pmu: Ignore pmu->global_ctrl check if vPMU doesn't support global_ctrl
@ 2022-05-09 10:22 Like Xu
  2022-05-09 10:22 ` [PATCH 2/3] KVM: x86/pmu: Don't pre-set the pmu->global_ctrl when refreshing Like Xu
  2022-05-09 10:22 ` [PATCH 3/3] KVM: x86/pmu: Drop redundant-clumsy-asymmetric PERFCTR_CORE MSRs handling Like Xu
  0 siblings, 2 replies; 10+ messages in thread
From: Like Xu @ 2022-05-09 10:22 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jim Mattson, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Joerg Roedel, kvm, linux-kernel

From: Like Xu <likexu@tencent.com>

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>
---
 arch/x86/kvm/vmx/pmu_intel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c
index b82b6709d7a8..cff03baf8921 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);
 }
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-24 13:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 10:22 [PATCH 1/3] KVM: x86/pmu: Ignore pmu->global_ctrl check if vPMU doesn't support global_ctrl Like Xu
2022-05-09 10:22 ` [PATCH 2/3] KVM: x86/pmu: Don't pre-set the pmu->global_ctrl when refreshing Like Xu
2022-05-10  4:37   ` [PATCH V2 " Like Xu
2022-05-10  4:44   ` [PATCH v2] " Like Xu
2022-05-20 14:25     ` Paolo Bonzini
2022-05-15  9:22   ` [KVM] db16e9b28b: kvm-unit-tests.pmu.fail kernel test robot
2022-05-15  9:25     ` Like Xu
2022-05-24 13:36       ` Oliver Sang
2022-05-09 10:22 ` [PATCH 3/3] KVM: x86/pmu: Drop redundant-clumsy-asymmetric PERFCTR_CORE MSRs handling Like Xu
2022-05-20 14:32   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).