Lines Matching refs:ctr_base
258 static int kvm_pmu_validate_counter_mask(struct kvm_pmu *kvpmu, unsigned long ctr_base, in kvm_pmu_validate_counter_mask() argument
262 if (!ctr_mask || (ctr_base + __fls(ctr_mask) >= kvm_pmu_num_counters(kvpmu))) in kvm_pmu_validate_counter_mask()
480 int kvm_riscv_vcpu_pmu_ctr_start(struct kvm_vcpu *vcpu, unsigned long ctr_base, in kvm_riscv_vcpu_pmu_ctr_start() argument
490 if (kvm_pmu_validate_counter_mask(kvpmu, ctr_base, ctr_mask) < 0) { in kvm_riscv_vcpu_pmu_ctr_start()
509 pmc_index = i + ctr_base; in kvm_riscv_vcpu_pmu_ctr_start()
556 int kvm_riscv_vcpu_pmu_ctr_stop(struct kvm_vcpu *vcpu, unsigned long ctr_base, in kvm_riscv_vcpu_pmu_ctr_stop() argument
568 if (kvm_pmu_validate_counter_mask(kvpmu, ctr_base, ctr_mask) < 0) { in kvm_riscv_vcpu_pmu_ctr_stop()
580 pmc_index = i + ctr_base; in kvm_riscv_vcpu_pmu_ctr_stop()
653 int kvm_riscv_vcpu_pmu_ctr_cfg_match(struct kvm_vcpu *vcpu, unsigned long ctr_base, in kvm_riscv_vcpu_pmu_ctr_cfg_match() argument
680 if (kvm_pmu_validate_counter_mask(kvpmu, ctr_base, ctr_mask) < 0) { in kvm_riscv_vcpu_pmu_ctr_cfg_match()
697 if (!test_bit(ctr_base + __ffs(ctr_mask), kvpmu->pmc_in_use)) { in kvm_riscv_vcpu_pmu_ctr_cfg_match()
701 ctr_idx = ctr_base + __ffs(ctr_mask); in kvm_riscv_vcpu_pmu_ctr_cfg_match()
703 ctr_idx = pmu_get_pmc_index(kvpmu, eidx, ctr_base, ctr_mask); in kvm_riscv_vcpu_pmu_ctr_cfg_match()