Lines Matching refs:perf_iommu
184 static int clear_avail_iommu_bnk_cntr(struct perf_amd_iommu *perf_iommu, in clear_avail_iommu_bnk_cntr() argument
191 max_banks = perf_iommu->max_banks; in clear_avail_iommu_bnk_cntr()
192 max_cntrs = perf_iommu->max_counters; in clear_avail_iommu_bnk_cntr()
199 raw_spin_lock_irqsave(&perf_iommu->lock, flags); in clear_avail_iommu_bnk_cntr()
200 perf_iommu->cntr_assign_mask &= ~(1ULL<<shift); in clear_avail_iommu_bnk_cntr()
201 raw_spin_unlock_irqrestore(&perf_iommu->lock, flags); in clear_avail_iommu_bnk_cntr()
368 struct perf_amd_iommu *perf_iommu = in perf_iommu_del() local
374 clear_avail_iommu_bnk_cntr(perf_iommu, in perf_iommu_del()
420 struct perf_amd_iommu *perf_iommu; in init_one_iommu() local
423 perf_iommu = kzalloc(sizeof(struct perf_amd_iommu), GFP_KERNEL); in init_one_iommu()
424 if (!perf_iommu) in init_one_iommu()
427 raw_spin_lock_init(&perf_iommu->lock); in init_one_iommu()
429 perf_iommu->pmu = iommu_pmu; in init_one_iommu()
430 perf_iommu->iommu = get_amd_iommu(idx); in init_one_iommu()
431 perf_iommu->max_banks = amd_iommu_pc_get_max_banks(idx); in init_one_iommu()
432 perf_iommu->max_counters = amd_iommu_pc_get_max_counters(idx); in init_one_iommu()
434 if (!perf_iommu->iommu || in init_one_iommu()
435 !perf_iommu->max_banks || in init_one_iommu()
436 !perf_iommu->max_counters) { in init_one_iommu()
437 kfree(perf_iommu); in init_one_iommu()
441 snprintf(perf_iommu->name, IOMMU_NAME_SIZE, "amd_iommu_%u", idx); in init_one_iommu()
443 ret = perf_pmu_register(&perf_iommu->pmu, perf_iommu->name, -1); in init_one_iommu()
446 idx, perf_iommu->max_banks, perf_iommu->max_counters); in init_one_iommu()
447 list_add_tail(&perf_iommu->list, &perf_amd_iommu_list); in init_one_iommu()
450 kfree(perf_iommu); in init_one_iommu()