RE: [PATCH v5 7/9] iommufd: Associate fault object with iommufd_hw_pgtable

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > @@ -227,7 +233,7 @@ iommufd_hwpt_nested_alloc(struct iommufd_ctx > *ictx, > refcount_inc(&parent->common.obj.users); > hwpt_nested->parent = parent; > > - hwpt->domain = ops->domain_alloc_user(idev->dev, flags, > +

RE: [PATCH v5 6/9] iommufd: Fault-capable hwpt attach/detach/replace

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > + > +int iommufd_fault_domain_replace_dev(struct iommufd_device *idev, > + struct iommufd_hw_pagetable *hwpt, > + struct iommufd_hw_pagetable *old) > +{ > + struct iomm

RE: [PATCH v5 5/9] iommufd: Add iommufd fault object

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > @@ -131,6 +131,9 @@ struct iopf_group { > struct iommu_attach_handle *attach_handle; > /* The device's fault data parameter. */ > struct iommu_fault_param *fault_param; > + /* Used by handler provider to hook the

RE: [PATCH v5 5/9] iommufd: Add iommufd fault object

2024-05-15 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, May 8, 2024 6:05 PM > > On 2024/5/8 8:11, Jason Gunthorpe wrote: > > On Tue, Apr 30, 2024 at 10:57:06PM +0800, Lu Baolu wrote: > >> diff --git a/drivers/iommu/iommu-priv.h b/drivers/iommu/iommu-priv.h > >> index ae65e0b85d69..1a0450a83bd0 100644 > >> --- a/driv

RE: [PATCH v5 4/9] iommufd: Add fault and response message definitions

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > iommu_hwpt_pgfaults represent fault messages that the userspace can > retrieve. Multiple iommu_hwpt_pgfaults might be put in an iopf group, > with the IOMMU_PGFAULT_FLAGS_LAST_PAGE flag set only for the last > iommu_hwpt_pgfault. Do y

RE: [PATCH v5 3/9] iommu: Add attachment handle to struct iopf_group

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > Previously, the domain that a page fault targets is stored in an > iopf_group, which represents a minimal set of page faults. With the > introduction of attachment handle, replace the domain with the handle It's better to use 'attach

RE: [PATCH v5 3/9] iommu: Add attachment handle to struct iopf_group

2024-05-15 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Saturday, May 11, 2024 12:29 AM > > On Fri, May 10, 2024 at 10:30:10PM +0800, Baolu Lu wrote: > > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > > index 35ae9a6f73d3..09b4e671dcee 100644 > > --- a/include/linux/iommu.h > > +++ b/include/linux/iommu

RE: [PATCH v5 2/9] iommu: Replace sva_iommu with iommu_attach_handle

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > #else > -static inline struct iommu_sva * > +static inline struct iommu_attach_handle * > iommu_sva_bind_device(struct device *dev, struct mm_struct *mm) > { > - return NULL; > + return ERR_PTR(-ENODEV); > } > this should

RE: [PATCH v5 1/9] iommu: Introduce domain attachment handle

2024-05-15 Thread Tian, Kevin
> From: Lu Baolu > Sent: Tuesday, April 30, 2024 10:57 PM > > +/* Add an attach handle to the group's pasid array. */ > +static struct iommu_attach_handle * > +iommu_attach_handle_set(struct iommu_domain *domain, > + struct iommu_group *group, ioasid_t pasid) > +{ > + stru