Skip to content

Commit cdd2fbf

Browse files
Like Xusean-jc
authored andcommitted
KVM: x86/pmu: Rename pmc_is_enabled() to pmc_is_globally_enabled()
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>
1 parent d8f992e commit cdd2fbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kvm/pmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void kvm_pmu_ops_update(const struct kvm_pmu_ops *pmu_ops)
9393
#undef __KVM_X86_PMU_OP
9494
}
9595

96-
static inline bool pmc_is_enabled(struct kvm_pmc *pmc)
96+
static inline bool pmc_is_globally_enabled(struct kvm_pmc *pmc)
9797
{
9898
return static_call(kvm_x86_pmu_pmc_is_enabled)(pmc);
9999
}
@@ -409,7 +409,7 @@ static void reprogram_counter(struct kvm_pmc *pmc)
409409

410410
pmc_pause_counter(pmc);
411411

412-
if (!pmc_speculative_in_use(pmc) || !pmc_is_enabled(pmc))
412+
if (!pmc_speculative_in_use(pmc) || !pmc_is_globally_enabled(pmc))
413413
goto reprogram_complete;
414414

415415
if (!check_pmu_event_filter(pmc))
@@ -688,7 +688,7 @@ void kvm_pmu_trigger_event(struct kvm_vcpu *vcpu, u64 perf_hw_id)
688688
for_each_set_bit(i, pmu->all_valid_pmc_idx, X86_PMC_IDX_MAX) {
689689
pmc = static_call(kvm_x86_pmu_pmc_idx_to_pmc)(pmu, i);
690690

691-
if (!pmc || !pmc_is_enabled(pmc) || !pmc_speculative_in_use(pmc))
691+
if (!pmc || !pmc_is_globally_enabled(pmc) || !pmc_speculative_in_use(pmc))
692692
continue;
693693

694694
/* Ignore checks for edge detect, pin control, invert and CMASK bits */

0 commit comments

Comments
 (0)