Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-19 Thread Yi Liu
On 2024/1/18 21:38, Jason Gunthorpe wrote: On Thu, Jan 18, 2024 at 05:28:01PM +0800, Yi Liu wrote: On 2024/1/17 20:56, Jason Gunthorpe wrote: On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote: Above indeed makes more sense if there can be concurrent attach/replace/detach on a single pasid

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-18 Thread Jason Gunthorpe
On Thu, Jan 18, 2024 at 05:28:01PM +0800, Yi Liu wrote: > On 2024/1/17 20:56, Jason Gunthorpe wrote: > > On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote: > > > Above indeed makes more sense if there can be concurrent > > > attach/replace/detach > > > on a single pasid. Just have one doubt s

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-18 Thread Yi Liu
On 2024/1/17 20:56, Jason Gunthorpe wrote: On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote: Above indeed makes more sense if there can be concurrent attach/replace/detach on a single pasid. Just have one doubt should we add lock to protect the whole attach/replace/detach paths. In the att

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-17 Thread Jason Gunthorpe
On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote: > Above indeed makes more sense if there can be concurrent attach/replace/detach > on a single pasid. Just have one doubt should we add lock to protect the > whole attach/replace/detach paths. In the attach/replace path[1] [2], the > xarray en

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-17 Thread Yi Liu
On 2024/1/17 12:17, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Tuesday, January 16, 2024 8:58 PM On Tue, Jan 16, 2024 at 01:18:12AM +, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Tuesday, January 16, 2024 1:25 AM On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote: +/** + * io

RE: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, January 16, 2024 8:58 PM > > On Tue, Jan 16, 2024 at 01:18:12AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, January 16, 2024 1:25 AM > > > > > > On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote: > > > > +/** > > > > +

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-16 Thread Jason Gunthorpe
On Tue, Jan 16, 2024 at 01:18:12AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, January 16, 2024 1:25 AM > > > > On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote: > > > +/** > > > + * iommufd_device_pasid_detach - Disconnect a {device, pasid} to an > > iommu_domain

RE: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-15 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, January 16, 2024 1:25 AM > > On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote: > > +/** > > + * iommufd_device_pasid_detach - Disconnect a {device, pasid} to an > iommu_domain > > + * @idev: device to detach > > + * @pasid: pasid to detach > > + * >

Re: [PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2024-01-15 Thread Jason Gunthorpe
On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote: > @@ -534,7 +537,17 @@ iommufd_device_do_replace(struct iommufd_device *idev, > static struct iommufd_hw_pagetable *do_attach(struct iommufd_device *idev, > struct iommufd_hw_pagetable *hwpt, struct attach_data *data) > { > -

[PATCH 3/8] iommufd: Support attach/replace hwpt per pasid

2023-11-26 Thread Yi Liu
From: Kevin Tian This introduces three APIs for device drivers to manage pasid attach/ replace/detach. int iommufd_device_pasid_attach(struct iommufd_device *idev, u32 pasid, u32 *pt_id); int iommufd_device_pasid_replace(struct iommufd_device *idev,