Lines Matching defs:select_idx
17 static void kvm_pmu_create_perf_event(struct kvm_vcpu *vcpu, u64 select_idx);
18 static void kvm_pmu_update_pmc_chained(struct kvm_vcpu *vcpu, u64 select_idx);
39 * kvm_pmu_idx_is_64bit - determine if select_idx is a 64bit counter
41 * @select_idx: The counter index
43 static bool kvm_pmu_idx_is_64bit(struct kvm_vcpu *vcpu, u64 select_idx)
45 return (select_idx == ARMV8_PMU_CYCLE_IDX &&
72 * kvm_pmu_idx_is_high_counter - determine if select_idx is a high/low counter
73 * @select_idx: The counter index
75 static bool kvm_pmu_idx_is_high_counter(u64 select_idx)
77 return select_idx & 0x1;
106 * @select_idx: The counter index
108 static bool kvm_pmu_idx_has_chain_evtype(struct kvm_vcpu *vcpu, u64 select_idx)
112 select_idx |= 0x1;
114 if (select_idx == ARMV8_PMU_CYCLE_IDX)
117 reg = PMEVTYPER0_EL0 + select_idx;
161 * @select_idx: The counter index
163 u64 kvm_pmu_get_counter_value(struct kvm_vcpu *vcpu, u64 select_idx)
167 struct kvm_pmc *pmc = &pmu->pmc[select_idx];
172 kvm_pmu_idx_is_high_counter(select_idx))
174 else if (select_idx != ARMV8_PMU_CYCLE_IDX)
183 * @select_idx: The counter index
186 void kvm_pmu_set_counter_value(struct kvm_vcpu *vcpu, u64 select_idx, u64 val)
190 reg = (select_idx == ARMV8_PMU_CYCLE_IDX)
191 ? PMCCNTR_EL0 : PMEVCNTR0_EL0 + select_idx;
192 __vcpu_sys_reg(vcpu, reg) += (s64)val - kvm_pmu_get_counter_value(vcpu, select_idx);
195 kvm_pmu_create_perf_event(vcpu, select_idx);
587 static bool kvm_pmu_counter_is_enabled(struct kvm_vcpu *vcpu, u64 select_idx)
590 (__vcpu_sys_reg(vcpu, PMCNTENSET_EL0) & BIT(select_idx));
596 * @select_idx: The number of selected counter
598 static void kvm_pmu_create_perf_event(struct kvm_vcpu *vcpu, u64 select_idx)
611 pmc = kvm_pmu_get_canonical_pmc(&pmu->pmc[select_idx]);
683 * @select_idx: The number of selected counter
688 static void kvm_pmu_update_pmc_chained(struct kvm_vcpu *vcpu, u64 select_idx)
691 struct kvm_pmc *pmc = &pmu->pmc[select_idx], *canonical_pmc;
719 * @select_idx: The number of selected counter
726 u64 select_idx)
734 reg = (select_idx == ARMV8_PMU_CYCLE_IDX)
735 ? PMCCFILTR_EL0 : PMEVTYPER0_EL0 + select_idx;
739 kvm_pmu_update_pmc_chained(vcpu, select_idx);
740 kvm_pmu_create_perf_event(vcpu, select_idx);