Lines Matching refs:pmu
62 struct kvm_pmu *pmu; in kvm_pmc_to_vcpu() local
66 pmu = container_of(pmc, struct kvm_pmu, pmc[0]); in kvm_pmc_to_vcpu()
67 vcpu_arch = container_of(pmu, struct kvm_vcpu_arch, pmu); in kvm_pmc_to_vcpu()
79 return test_bit(pmc->idx >> 1, vcpu->arch.pmu.chained); in kvm_pmu_pmc_is_chained()
177 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_get_counter_value() local
178 struct kvm_pmc *pmc = &pmu->pmc[select_idx]; in kvm_pmu_get_counter_value()
269 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_vcpu_init() local
272 pmu->pmc[i].idx = i; in kvm_pmu_vcpu_init()
283 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_vcpu_reset() local
287 kvm_pmu_stop_counter(vcpu, &pmu->pmc[i]); in kvm_pmu_vcpu_reset()
289 bitmap_zero(vcpu->arch.pmu.chained, ARMV8_PMU_MAX_COUNTER_PAIRS); in kvm_pmu_vcpu_reset()
300 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_vcpu_destroy() local
303 kvm_pmu_release_perf_event(&pmu->pmc[i]); in kvm_pmu_vcpu_destroy()
304 irq_work_sync(&vcpu->arch.pmu.overflow_work); in kvm_pmu_vcpu_destroy()
328 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_enable_counter_mask() local
341 pmc = &pmu->pmc[i]; in kvm_pmu_enable_counter_mask()
366 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_disable_counter_mask() local
376 pmc = &pmu->pmc[i]; in kvm_pmu_disable_counter_mask()
403 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_update_state() local
410 if (pmu->irq_level == overflow) in kvm_pmu_update_state()
413 pmu->irq_level = overflow; in kvm_pmu_update_state()
417 pmu->irq_num, overflow, pmu); in kvm_pmu_update_state()
424 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_should_notify_user() local
431 return pmu->irq_level != run_level; in kvm_pmu_should_notify_user()
443 if (vcpu->arch.pmu.irq_level) in kvm_pmu_update_run()
479 struct kvm_pmu *pmu; in kvm_pmu_perf_overflow_notify_vcpu() local
481 pmu = container_of(work, struct kvm_pmu, overflow_work); in kvm_pmu_perf_overflow_notify_vcpu()
482 vcpu = kvm_pmc_to_vcpu(pmu->pmc); in kvm_pmu_perf_overflow_notify_vcpu()
495 struct arm_pmu *cpu_pmu = to_arm_pmu(perf_event->pmu); in kvm_pmu_perf_overflow()
500 cpu_pmu->pmu.stop(perf_event, PERF_EF_UPDATE); in kvm_pmu_perf_overflow()
523 irq_work_queue(&vcpu->arch.pmu.overflow_work); in kvm_pmu_perf_overflow()
526 cpu_pmu->pmu.start(perf_event, PERF_EF_RELOAD); in kvm_pmu_perf_overflow()
536 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_software_increment() local
568 if (kvm_pmu_pmc_is_chained(&pmu->pmc[i])) { in kvm_pmu_software_increment()
627 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_create_perf_event() local
638 pmc = kvm_pmu_get_canonical_pmc(&pmu->pmc[select_idx]); in kvm_pmu_create_perf_event()
663 attr.type = arm_pmu->pmu.type; in kvm_pmu_create_perf_event()
717 struct kvm_pmu *pmu = &vcpu->arch.pmu; in kvm_pmu_update_pmc_chained() local
718 struct kvm_pmc *pmc = &pmu->pmc[select_idx], *canonical_pmc; in kvm_pmu_update_pmc_chained()
736 set_bit(pmc->idx >> 1, vcpu->arch.pmu.chained); in kvm_pmu_update_pmc_chained()
739 clear_bit(pmc->idx >> 1, vcpu->arch.pmu.chained); in kvm_pmu_update_pmc_chained()
773 void kvm_host_pmu_init(struct arm_pmu *pmu) in kvm_host_pmu_init() argument
777 if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) in kvm_host_pmu_init()
786 entry->arm_pmu = pmu; in kvm_host_pmu_init()
800 struct arm_pmu *pmu = NULL; in kvm_pmu_probe_armpmu() local
828 if (event->pmu) { in kvm_pmu_probe_armpmu()
829 pmu = to_arm_pmu(event->pmu); in kvm_pmu_probe_armpmu()
830 if (pmu->pmuver == 0 || in kvm_pmu_probe_armpmu()
831 pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) in kvm_pmu_probe_armpmu()
832 pmu = NULL; in kvm_pmu_probe_armpmu()
838 return pmu; in kvm_pmu_probe_armpmu()
888 if (!vcpu->arch.pmu.created) in kvm_arm_pmu_v3_enable()
897 int irq = vcpu->arch.pmu.irq_num; in kvm_arm_pmu_v3_enable()
932 ret = kvm_vgic_set_owner(vcpu, vcpu->arch.pmu.irq_num, in kvm_arm_pmu_v3_init()
933 &vcpu->arch.pmu); in kvm_arm_pmu_v3_init()
938 init_irq_work(&vcpu->arch.pmu.overflow_work, in kvm_arm_pmu_v3_init()
941 vcpu->arch.pmu.created = true; in kvm_arm_pmu_v3_init()
960 if (vcpu->arch.pmu.irq_num != irq) in pmu_irq_is_valid()
963 if (vcpu->arch.pmu.irq_num == irq) in pmu_irq_is_valid()
983 if (arm_pmu->pmu.type == pmu_id) { in kvm_arm_pmu_v3_set_pmu()
1009 if (vcpu->arch.pmu.created) in kvm_arm_pmu_v3_set_attr()
1045 vcpu->arch.pmu.irq_num = irq; in kvm_arm_pmu_v3_set_attr()
1132 irq = vcpu->arch.pmu.irq_num; in kvm_arm_pmu_v3_get_attr()