RE: [PATCH v9 07/11] iommu/sva: Refactoring iommu_sva_bind/unbind_device()

2022-06-28 Thread Tian, Kevin
> From: Baolu Lu > Sent: Tuesday, June 28, 2022 1:54 PM > >> +u32 iommu_sva_get_pasid(struct iommu_sva *handle) > >> +{ > >> + struct iommu_domain *domain = > >> + container_of(handle, struct iommu_domain, bond); > >> + > >> + return domain->mm->pasid; > >> +} > >>

Re: [PATCH v9 07/11] iommu/sva: Refactoring iommu_sva_bind/unbind_device()

2022-06-27 Thread Baolu Lu
On 2022/6/27 18:14, Tian, Kevin wrote: From: Lu Baolu Sent: Tuesday, June 21, 2022 10:44 PM +struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm) +{ + struct iommu_domain *domain; + ioasid_t max_pasids; + int ret = -EINVAL; + + /* Allocate

RE: [PATCH v9 07/11] iommu/sva: Refactoring iommu_sva_bind/unbind_device()

2022-06-27 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, June 21, 2022 10:44 PM > +struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct > mm_struct *mm) > +{ > + struct iommu_domain *domain; > + ioasid_t max_pasids; > + int ret = -EINVAL; > + > + /* Allocate mm->pasid if necessary. */

[PATCH v9 07/11] iommu/sva: Refactoring iommu_sva_bind/unbind_device()

2022-06-21 Thread Lu Baolu
The existing iommu SVA interfaces are implemented by calling the SVA specific iommu ops provided by the IOMMU drivers. There's no need for any SVA specific ops in iommu_ops vector anymore as we can achieve this through the generic attach/detach_dev_pasid domain ops. This refactors the IOMMU SVA