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

2024-05-07 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 10:57:08PM +0800, Lu Baolu wrote: > /** > @@ -412,6 +415,9 @@ enum iommu_hwpt_data_type { > * @data_type: One of enum iommu_hwpt_data_type > * @data_len: Length of the type specific data > * @data_uptr: User pointer to the type specific data > + * @fault_id: The ID of

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

2024-05-07 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 10:57:06PM +0800, Lu Baolu wrote: > +static ssize_t iommufd_fault_fops_read(struct file *filep, char __user *buf, > +size_t count, loff_t *ppos) > +{ > + size_t fault_size = sizeof(struct iommu_hwpt_pgfault); > + struct iommufd_fau

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

2024-05-07 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 10:57:07PM +0800, Lu Baolu wrote: > diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c > index 13125c0feecb..6357229bf3b4 100644 > --- a/drivers/iommu/iommufd/fault.c > +++ b/drivers/iommu/iommufd/fault.c > @@ -15,6 +15,124 @@ > #include "../iommu-pr

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

2024-05-07 Thread Jason Gunthorpe
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/drivers/iommu/iommu-priv.h > +++ b/drivers/iommu/iommu-priv.h > @@ -36,6 +36,10 @@ struct iommu_attach_handle { >

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

2024-05-07 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 10:57:03PM +0800, Lu Baolu wrote: > diff --git a/drivers/iommu/iommu-priv.h b/drivers/iommu/iommu-priv.h > index da1addaa1a31..ae65e0b85d69 100644 > --- a/drivers/iommu/iommu-priv.h > +++ b/drivers/iommu/iommu-priv.h > @@ -30,6 +30,13 @@ void iommu_device_unregister_bus(stru

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

2024-05-07 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 10:57:04PM +0800, Lu Baolu wrote: > @@ -206,8 +197,11 @@ void iommu_report_device_fault(struct device *dev, > struct iopf_fault *evt) > if (group == &abort_group) > goto err_abort; > > - group->domain = get_domain_for_iopf(dev, fault); > - if (