Lines Matching refs:mm
15 static int iommu_sva_alloc_pasid(struct mm_struct *mm, struct device *dev) in iommu_sva_alloc_pasid() argument
20 if (!arch_pgtable_dma_compat(mm)) in iommu_sva_alloc_pasid()
25 if (mm_valid_pasid(mm)) { in iommu_sva_alloc_pasid()
26 if (mm->pasid >= dev->iommu->max_pasids) in iommu_sva_alloc_pasid()
36 mm->pasid = pasid; in iommu_sva_alloc_pasid()
59 struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm) in iommu_sva_bind_device() argument
66 ret = iommu_sva_alloc_pasid(mm, dev); in iommu_sva_bind_device()
76 domain = iommu_get_domain_for_dev_pasid(dev, mm->pasid, in iommu_sva_bind_device()
89 domain = iommu_sva_domain_alloc(dev, mm); in iommu_sva_bind_device()
95 ret = iommu_attach_device_pasid(domain, dev, mm->pasid); in iommu_sva_bind_device()
127 ioasid_t pasid = domain->mm->pasid; in iommu_sva_unbind_device()
144 return domain->mm->pasid; in iommu_sva_get_pasid()
156 struct mm_struct *mm = data; in iommu_sva_handle_iopf() local
165 if (!mmget_not_zero(mm)) in iommu_sva_handle_iopf()
168 mmap_read_lock(mm); in iommu_sva_handle_iopf()
170 vma = vma_lookup(mm, prm->addr); in iommu_sva_handle_iopf()
200 mmap_read_unlock(mm); in iommu_sva_handle_iopf()
201 mmput(mm); in iommu_sva_handle_iopf()
206 void mm_pasid_drop(struct mm_struct *mm) in mm_pasid_drop() argument
208 if (likely(!mm_valid_pasid(mm))) in mm_pasid_drop()
211 iommu_free_global_pasid(mm->pasid); in mm_pasid_drop()