KVM: x86/pmu: Rename pmc_is_enabled() to pmc_is_globally_enabled()
authorLike Xu <likexu@tencent.com>
Tue, 14 Feb 2023 05:07:46 +0000 (13:07 +0800)
committerSean Christopherson <seanjc@google.com>
Thu, 6 Apr 2023 22:57:19 +0000 (15:57 -0700)
The name of function pmc_is_enabled() is a bit misleading. A PMC can
be disabled either by PERF_CLOBAL_CTRL or by its corresponding EVTSEL.
Append global semantics to its name.

Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Like Xu <likexu@tencent.com>
Link: https://lore.kernel.org/r/20230214050757.9623-2-likexu@tencent.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/pmu.c

index 136184fe9e9236d3b641bdd0c169c099860d5a66..35d80151b85373a9dcde4e337c07ce1a8215f714 100644 (file)
@@ -93,7 +93,7 @@ void kvm_pmu_ops_update(const struct kvm_pmu_ops *pmu_ops)
 #undef __KVM_X86_PMU_OP
 }
 
-static inline bool pmc_is_enabled(struct kvm_pmc *pmc)
+static inline bool pmc_is_globally_enabled(struct kvm_pmc *pmc)
 {
        return static_call(kvm_x86_pmu_pmc_is_enabled)(pmc);
 }
@@ -409,7 +409,7 @@ static void reprogram_counter(struct kvm_pmc *pmc)
 
        pmc_pause_counter(pmc);
 
-       if (!pmc_speculative_in_use(pmc) || !pmc_is_enabled(pmc))
+       if (!pmc_speculative_in_use(pmc) || !pmc_is_globally_enabled(pmc))
                goto reprogram_complete;
 
        if (!check_pmu_event_filter(pmc))
@@ -688,7 +688,7 @@ void kvm_pmu_trigger_event(struct kvm_vcpu *vcpu, u64 perf_hw_id)
        for_each_set_bit(i, pmu->all_valid_pmc_idx, X86_PMC_IDX_MAX) {
                pmc = static_call(kvm_x86_pmu_pmc_idx_to_pmc)(pmu, i);
 
-               if (!pmc || !pmc_is_enabled(pmc) || !pmc_speculative_in_use(pmc))
+               if (!pmc || !pmc_is_globally_enabled(pmc) || !pmc_speculative_in_use(pmc))
                        continue;
 
                /* Ignore checks for edge detect, pin control, invert and CMASK bits */