Lines Matching refs:iommu_mm
19 struct iommu_mm_data *iommu_mm; in iommu_alloc_mm_data() local
27 iommu_mm = mm->iommu_mm; in iommu_alloc_mm_data()
29 if (iommu_mm) { in iommu_alloc_mm_data()
30 if (iommu_mm->pasid >= dev->iommu->max_pasids) in iommu_alloc_mm_data()
32 return iommu_mm; in iommu_alloc_mm_data()
35 iommu_mm = kzalloc(sizeof(struct iommu_mm_data), GFP_KERNEL); in iommu_alloc_mm_data()
36 if (!iommu_mm) in iommu_alloc_mm_data()
41 kfree(iommu_mm); in iommu_alloc_mm_data()
44 iommu_mm->pasid = pasid; in iommu_alloc_mm_data()
45 INIT_LIST_HEAD(&iommu_mm->sva_domains); in iommu_alloc_mm_data()
51 smp_store_release(&mm->iommu_mm, iommu_mm); in iommu_alloc_mm_data()
52 return iommu_mm; in iommu_alloc_mm_data()
75 struct iommu_mm_data *iommu_mm; in iommu_sva_bind_device() local
86 iommu_mm = iommu_alloc_mm_data(mm, dev); in iommu_sva_bind_device()
87 if (IS_ERR(iommu_mm)) { in iommu_sva_bind_device()
88 ret = PTR_ERR(iommu_mm); in iommu_sva_bind_device()
93 attach_handle = iommu_attach_handle_get(group, iommu_mm->pasid, IOMMU_DOMAIN_SVA); in iommu_sva_bind_device()
117 list_for_each_entry(domain, &mm->iommu_mm->sva_domains, next) { in iommu_sva_bind_device()
118 ret = iommu_attach_device_pasid(domain, dev, iommu_mm->pasid, in iommu_sva_bind_device()
133 ret = iommu_attach_device_pasid(domain, dev, iommu_mm->pasid, in iommu_sva_bind_device()
138 list_add(&domain->next, &mm->iommu_mm->sva_domains); in iommu_sva_bind_device()
167 struct iommu_mm_data *iommu_mm = domain->mm->iommu_mm; in iommu_sva_unbind_device() local
176 iommu_detach_device_pasid(domain, dev, iommu_mm->pasid); in iommu_sva_unbind_device()
196 struct iommu_mm_data *iommu_mm = mm->iommu_mm; in mm_pasid_drop() local
198 if (!iommu_mm) in mm_pasid_drop()
201 iommu_free_global_pasid(iommu_mm->pasid); in mm_pasid_drop()
202 kfree(iommu_mm); in mm_pasid_drop()