Lines Matching refs:domain
73 struct iommu_domain *domain;
93 if (attach_handle->domain->mm != mm) {
113 /* Search for an existing domain. */
114 list_for_each_entry(domain, &mm->iommu_mm->sva_domains, next) {
115 ret = iommu_attach_device_pasid(domain, dev, iommu_mm->pasid,
118 domain->users++;
123 /* Allocate a new domain and set it on device pasid. */
124 domain = iommu_sva_domain_alloc(dev, mm);
125 if (IS_ERR(domain)) {
126 ret = PTR_ERR(domain);
130 ret = iommu_attach_device_pasid(domain, dev, iommu_mm->pasid,
134 domain->users = 1;
135 list_add(&domain->next, &mm->iommu_mm->sva_domains);
144 iommu_domain_free(domain);
163 struct iommu_domain *domain = handle->handle.domain;
164 struct iommu_mm_data *iommu_mm = domain->mm->iommu_mm;
173 iommu_detach_device_pasid(domain, dev, iommu_mm->pasid);
174 if (--domain->users == 0) {
175 list_del(&domain->next);
176 iommu_domain_free(domain);
185 struct iommu_domain *domain = handle->handle.domain;
187 return mm_get_enqcmd_pasid(domain->mm);
275 group->attach_handle->domain->mm);
297 struct iommu_domain *domain;
302 domain = ops->domain_alloc_sva(dev, mm);
303 if (IS_ERR(domain))
304 return domain;
306 domain->type = IOMMU_DOMAIN_SVA;
307 domain->cookie_type = IOMMU_COOKIE_SVA;
309 domain->mm = mm;
310 domain->owner = ops;
311 domain->iopf_handler = iommu_sva_iopf_handler;
313 return domain;