Lines Matching refs:select_idx
23 static void kvm_pmu_create_perf_event(struct kvm_vcpu *vcpu, u64 select_idx);
24 static void kvm_pmu_update_pmc_chained(struct kvm_vcpu *vcpu, u64 select_idx);
54 static bool kvm_pmu_idx_is_64bit(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_idx_is_64bit() argument
56 return (select_idx == ARMV8_PMU_CYCLE_IDX && in kvm_pmu_idx_is_64bit()
86 static bool kvm_pmu_idx_is_high_counter(u64 select_idx) in kvm_pmu_idx_is_high_counter() argument
88 return select_idx & 0x1; in kvm_pmu_idx_is_high_counter()
119 static bool kvm_pmu_idx_has_chain_evtype(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_idx_has_chain_evtype() argument
123 select_idx |= 0x1; in kvm_pmu_idx_has_chain_evtype()
125 if (select_idx == ARMV8_PMU_CYCLE_IDX) in kvm_pmu_idx_has_chain_evtype()
128 reg = PMEVTYPER0_EL0 + select_idx; in kvm_pmu_idx_has_chain_evtype()
174 u64 kvm_pmu_get_counter_value(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_get_counter_value() argument
178 struct kvm_pmc *pmc = &pmu->pmc[select_idx]; in kvm_pmu_get_counter_value()
186 kvm_pmu_idx_is_high_counter(select_idx)) in kvm_pmu_get_counter_value()
188 else if (select_idx != ARMV8_PMU_CYCLE_IDX) in kvm_pmu_get_counter_value()
200 void kvm_pmu_set_counter_value(struct kvm_vcpu *vcpu, u64 select_idx, u64 val) in kvm_pmu_set_counter_value() argument
207 reg = (select_idx == ARMV8_PMU_CYCLE_IDX) in kvm_pmu_set_counter_value()
208 ? PMCCNTR_EL0 : PMEVCNTR0_EL0 + select_idx; in kvm_pmu_set_counter_value()
209 __vcpu_sys_reg(vcpu, reg) += (s64)val - kvm_pmu_get_counter_value(vcpu, select_idx); in kvm_pmu_set_counter_value()
212 kvm_pmu_create_perf_event(vcpu, select_idx); in kvm_pmu_set_counter_value()
613 static bool kvm_pmu_counter_is_enabled(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_counter_is_enabled() argument
616 (__vcpu_sys_reg(vcpu, PMCNTENSET_EL0) & BIT(select_idx)); in kvm_pmu_counter_is_enabled()
624 static void kvm_pmu_create_perf_event(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_create_perf_event() argument
638 pmc = kvm_pmu_get_canonical_pmc(&pmu->pmc[select_idx]); in kvm_pmu_create_perf_event()
715 static void kvm_pmu_update_pmc_chained(struct kvm_vcpu *vcpu, u64 select_idx) in kvm_pmu_update_pmc_chained() argument
718 struct kvm_pmc *pmc = &pmu->pmc[select_idx], *canonical_pmc; in kvm_pmu_update_pmc_chained()
753 u64 select_idx) in kvm_pmu_set_counter_event_type() argument
764 reg = (select_idx == ARMV8_PMU_CYCLE_IDX) in kvm_pmu_set_counter_event_type()
765 ? PMCCFILTR_EL0 : PMEVTYPER0_EL0 + select_idx; in kvm_pmu_set_counter_event_type()
769 kvm_pmu_update_pmc_chained(vcpu, select_idx); in kvm_pmu_set_counter_event_type()
770 kvm_pmu_create_perf_event(vcpu, select_idx); in kvm_pmu_set_counter_event_type()