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(>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-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 20, 2024 10:10 AM > > On 5/15/24 4:43 PM, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Tuesday, April 30, 2024 10:57 PM > >> + > >> +int iommufd_fault_domain_replace_dev(struct iommufd_device *i

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Sunday, May 19, 2024 10:04 PM > > On 2024/5/15 15:31, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Tuesday, April 30, 2024 10:57 PM > >> > >> + handle = iommu_attach_handle_get(dev->iommu_group, pasid, 0); > &g

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 20, 2024 8:41 AM > > On 5/15/24 3:57 PM, Tian, Kevin wrote: > >> From: Baolu Lu > >> Sent: Wednesday, May 8, 2024 6:05 PM > >> > >> On 2024/5/8 8:11, Jason Gunthorpe wrote: > >>> On Tue, Apr 30,

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Sunday, May 19, 2024 6:14 PM > > On 5/15/24 3:21 PM, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Tuesday, April 30, 2024 10:57 PM > >> > >> #else > >> -static inline struct iommu_sva * > >> +stati

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 20, 2024 9:34 AM > > On 5/15/24 4:37 PM, Tian, Kevin wrote: > >> + > >> + iopf_group_response(group, response.code); > > PCIe spec states that a response failure disables the PRI interface. For SR- > IOV > &g

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 20, 2024 11:33 AM > > On 5/20/24 11:24 AM, Tian, Kevin wrote: > >> From: Baolu Lu > >> Sent: Sunday, May 19, 2024 10:38 PM > >> > >> On 2024/5/15 15:43, Tian, Kevin wrote: > >>>>

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Monday, May 20, 2024 10:19 AM > > On 5/15/24 4:50 PM, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Tuesday, April 30, 2024 10:57 PM > >> > >> @@ -308,6 +314,19 @@ int iommufd_hwpt_alloc(struct iommufd_

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

2024-05-19 Thread Tian, Kevin
> From: Baolu Lu > Sent: Sunday, May 19, 2024 10:38 PM > > On 2024/5/15 15:43, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Tuesday, April 30, 2024 10:57 PM > >> > >> iommu_hwpt_pgfaults represent fault messages that the userspace can &

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

2024-05-26 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, May 24, 2024 10:15 PM > > On Mon, May 20, 2024 at 04:59:18AM +, Tian, Kevin wrote: > > > From: Baolu Lu > > > Sent: Monday, May 20, 2024 11:33 AM > > > > > > On 5/20/24 11:24 AM, Tian, Kevin wrote: >

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

2024-05-26 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, May 24, 2024 10:25 PM > > On Mon, May 20, 2024 at 03:39:54AM +, Tian, Kevin wrote: > > > From: Baolu Lu > > > Sent: Monday, May 20, 2024 10:19 AM > > > > > > On 5/15/24 4:50 PM, Tian, Kevin wrote: > &

RE: [PATCH v6 06/10] iommufd: Add iommufd fault object

2024-06-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > +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

RE: [PATCH v6 08/10] iommufd: Associate fault object with iommufd_hw_pgtable

2024-06-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > When allocating a user iommufd_hw_pagetable, the user space is allowed to > associate a fault object with the hw_pagetable by specifying the fault > object ID in the page table allocation data and setting the > IOMMU_HWPT_FAULT_ID_VALID

RE: [PATCH v6 02/10] iommu: Remove sva handle list

2024-06-07 Thread Tian, Kevin
> From: Baolu Lu > Sent: Thursday, June 6, 2024 2:07 PM > > On 6/5/24 4:15 PM, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Monday, May 27, 2024 12:05 PM > >> > >> - list_for_each_entry(handle, >iommu_mm->sva_handles, >

RE: [PATCH v6 07/10] iommufd: Fault-capable hwpt attach/detach/replace

2024-06-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > Add iopf-capable hw page table attach/detach/replace helpers. The pointer > to iommufd_device is stored in the domain attachment handle, so that it > can be echo'ed back in the iopf_group. this message needs an update. now the device

RE: [PATCH v6 05/10] iommufd: Add fault and response message definitions

2024-06-07 Thread Tian, Kevin
> From: Baolu Lu > Sent: Thursday, June 6, 2024 2:28 PM > > On 6/5/24 4:28 PM, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Monday, May 27, 2024 12:05 PM > >> > >> + > >> +/** > >> + * struct iommu_hwpt_page_

RE: [PATCH v6 02/10] iommu: Remove sva handle list

2024-06-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > @@ -69,11 +68,16 @@ static struct iommu_mm_data > *iommu_alloc_mm_data(struct mm_struct *mm, struct de > */ > struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct > mm_struct *mm) > { > + struct iommu_group *group =

RE: [PATCH v6 03/10] iommu: Add attach handle to struct iopf_group

2024-06-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > @@ -249,6 +249,12 @@ enum iommu_cap { >*/ > IOMMU_CAP_DEFERRED_FLUSH, > IOMMU_CAP_DIRTY_TRACKING, /* IOMMU supports dirty > tracking */ > + /* > + * IOMMU driver supports user-managed IOASID table.

RE: [PATCH v6 01/10] iommu: Introduce domain attachment handle

2024-06-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > @@ -99,7 +99,9 @@ struct iommu_sva *iommu_sva_bind_device(struct device > *dev, struct mm_struct *mm > > /* Search for an existing domain. */ > list_for_each_entry(domain, >iommu_mm->sva_domains, next) { > - ret

RE: [PATCH v6 05/10] iommufd: Add fault and response message definitions

2024-06-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, May 27, 2024 12:05 PM > > + > +/** > + * struct iommu_hwpt_page_response - IOMMU page fault response > + * @size: sizeof(struct iommu_hwpt_page_response) > + * @flags: Must be set to 0 > + * @dev_id: device ID of target device for the response > + * @pasid:

<    1   2