Lines Matching refs:pmc

6 #define pmc_to_pmu(pmc)   (&(pmc)->vcpu->arch.pmu)  argument
21 bool (*pmc_is_enabled)(struct kvm_pmc *pmc);
33 static inline u64 pmc_bitmask(struct kvm_pmc *pmc) in pmc_bitmask() argument
35 struct kvm_pmu *pmu = pmc_to_pmu(pmc); in pmc_bitmask()
37 return pmu->counter_bitmask[pmc->type]; in pmc_bitmask()
40 static inline u64 pmc_read_counter(struct kvm_pmc *pmc) in pmc_read_counter() argument
44 counter = pmc->counter; in pmc_read_counter()
45 if (pmc->perf_event) in pmc_read_counter()
46 counter += perf_event_read_value(pmc->perf_event, in pmc_read_counter()
49 return counter & pmc_bitmask(pmc); in pmc_read_counter()
52 static inline void pmc_stop_counter(struct kvm_pmc *pmc) in pmc_stop_counter() argument
54 if (pmc->perf_event) { in pmc_stop_counter()
55 pmc->counter = pmc_read_counter(pmc); in pmc_stop_counter()
56 perf_event_release_kernel(pmc->perf_event); in pmc_stop_counter()
57 pmc->perf_event = NULL; in pmc_stop_counter()
61 static inline bool pmc_is_gp(struct kvm_pmc *pmc) in pmc_is_gp() argument
63 return pmc->type == KVM_PMC_GP; in pmc_is_gp()
66 static inline bool pmc_is_fixed(struct kvm_pmc *pmc) in pmc_is_fixed() argument
68 return pmc->type == KVM_PMC_FIXED; in pmc_is_fixed()
71 static inline bool pmc_is_enabled(struct kvm_pmc *pmc) in pmc_is_enabled() argument
73 return kvm_x86_ops->pmu_ops->pmc_is_enabled(pmc); in pmc_is_enabled()
100 void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel);
101 void reprogram_fixed_counter(struct kvm_pmc *pmc, u8 ctrl, int fixed_idx);
106 int kvm_pmu_rdpmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data);