Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-25 Thread Baolu Lu
On 2024/3/23 1:06, Jason Gunthorpe wrote: On Fri, Mar 15, 2024 at 09:16:43AM +0800, Baolu Lu wrote: On 3/9/24 3:05 AM, Jason Gunthorpe wrote: On Mon, Jan 22, 2024 at 03:39:00PM +0800, Lu Baolu wrote: @@ -411,6 +414,8 @@ enum iommu_hwpt_data_type { * @__reserved: Must be 0 *

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-22 Thread Jason Gunthorpe
On Fri, Mar 15, 2024 at 09:16:43AM +0800, Baolu Lu wrote: > On 3/9/24 3:05 AM, Jason Gunthorpe wrote: > > On Mon, Jan 22, 2024 at 03:39:00PM +0800, Lu Baolu wrote: > > > > > @@ -411,6 +414,8 @@ enum iommu_hwpt_data_type { > > >* @__reserved: Must be 0 > > >* @data_type: One of enum

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-14 Thread Baolu Lu
On 3/9/24 3:05 AM, Jason Gunthorpe wrote: On Mon, Jan 22, 2024 at 03:39:00PM +0800, Lu Baolu wrote: @@ -411,6 +414,8 @@ enum iommu_hwpt_data_type { * @__reserved: Must be 0 * @data_type: One of enum iommu_hwpt_data_type * @data_len: Length of the type specific data + * @fault_id: The

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-08 Thread Jason Gunthorpe
On Mon, Jan 22, 2024 at 03:39:00PM +0800, Lu Baolu wrote: > @@ -411,6 +414,8 @@ enum iommu_hwpt_data_type { > * @__reserved: Must be 0 > * @data_type: One of enum iommu_hwpt_data_type > * @data_len: Length of the type specific data > + * @fault_id: The ID of IOMMUFD_FAULT object. Valid only

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-06 Thread Baolu Lu
On 2024/3/7 0:01, Jason Gunthorpe wrote: On Wed, Mar 06, 2024 at 11:15:50PM +0800, Zhangfei Gao wrote: Double checked, this does not send flags, 0 is OK, Only domain_alloc_user in iommufd_hwpt_paging_alloc requires flags. In my debug, I need this patch, otherwise NULL pointer errors happen

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-06 Thread Jason Gunthorpe
On Wed, Mar 06, 2024 at 11:15:50PM +0800, Zhangfei Gao wrote: > > Double checked, this does not send flags, 0 is OK, > Only domain_alloc_user in iommufd_hwpt_paging_alloc requires flags. > > In my debug, I need this patch, otherwise NULL pointer errors happen > since SVA is not set. This is

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-06 Thread Zhangfei Gao
Hi, Baolu On Sat, 2 Mar 2024 at 10:36, Zhangfei Gao wrote: > > On Mon, 22 Jan 2024 at 15:46, Lu Baolu wrote: > > > > 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

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-03-01 Thread Zhangfei Gao
On Mon, 22 Jan 2024 at 15:46, Lu Baolu wrote: > > 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 flag bit.

Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-02-20 Thread Baolu Lu
On 2024/2/7 16:14, Tian, Kevin wrote: From: Lu Baolu Sent: Monday, January 22, 2024 3:39 PM + +int iommufd_fault_iopf_handler(struct iopf_group *group) +{ + struct iommufd_hw_pagetable *hwpt = group->cookie->domain- fault_data; + struct iommufd_fault *fault = hwpt->fault; + why

RE: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-02-07 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, January 22, 2024 3:39 PM > > + > +int iommufd_fault_iopf_handler(struct iopf_group *group) > +{ > + struct iommufd_hw_pagetable *hwpt = group->cookie->domain- > >fault_data; > + struct iommufd_fault *fault = hwpt->fault; > + why not directly using

[PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

2024-01-21 Thread Lu Baolu
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 flag bit. On a successful return of hwpt allocation, the user can