Re: [PATCH v3 2/8] iommu/sva: Use iopf domain attach/detach interface

2024-03-25 Thread Baolu Lu
On 3/23/24 12:59 AM, Jason Gunthorpe wrote: On Thu, Mar 14, 2024 at 03:41:23PM +0800, Baolu Lu wrote: The whole cookie mechanism aims to address two things: - Extend the domain lifetime until all pending page faults are resolved. Like you answered, I think the flush is a simpler scheme..

Re: [PATCH v3 2/8] iommu/sva: Use iopf domain attach/detach interface

2024-03-22 Thread Jason Gunthorpe
On Thu, Mar 14, 2024 at 03:41:23PM +0800, Baolu Lu wrote: > The whole cookie mechanism aims to address two things: > > - Extend the domain lifetime until all pending page faults are > resolved. Like you answered, I think the flush is a simpler scheme.. > - Associate information about the iommu

Re: [PATCH v3 2/8] iommu/sva: Use iopf domain attach/detach interface

2024-03-14 Thread Baolu Lu
On 2024/3/9 1:46, Jason Gunthorpe wrote: On Mon, Jan 22, 2024 at 03:38:57PM +0800, Lu Baolu wrote: @@ -215,7 +202,23 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param, group = abort_group; } + cookie = iopf_pasid_cookie_get(iopf_param-

Re: [PATCH v3 2/8] iommu/sva: Use iopf domain attach/detach interface

2024-03-08 Thread Jason Gunthorpe
On Mon, Jan 22, 2024 at 03:38:57PM +0800, Lu Baolu wrote: > @@ -215,7 +202,23 @@ static struct iopf_group *iopf_group_alloc(struct > iommu_fault_param *iopf_param, > group = abort_group; > } > > + cookie = iopf_pasid_cookie_get(iopf_param->dev, pasid); > + if (!cookie

[PATCH v3 2/8] iommu/sva: Use iopf domain attach/detach interface

2024-01-21 Thread Lu Baolu
The iommu sva implementation relies on iopf handling. Allocate an attachment cookie and use the iopf domain attach/detach interface. The SVA domain is guaranteed to be released after all outstanding page faults are handled. In the fault delivering path, the attachment cookie is retrieved, instead