Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Yi Liu
On 2024/3/21 20:20, Jason Gunthorpe wrote: On Thu, Mar 21, 2024 at 07:26:41PM +0800, Yi Liu wrote: yes, the correct way is to undo what have been done before the fail device. However, I somehow remember that pasid capability is only available when the group is singleton. So iterate all devices o

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Jason Gunthorpe
On Thu, Mar 21, 2024 at 07:26:41PM +0800, Yi Liu wrote: > > yes, the correct way is to undo what have been done before the fail > > device. However, I somehow remember that pasid capability is only > > available when the group is singleton. So iterate all devices of the > > devices just means one d

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Yi Liu
On 2024/3/21 14:16, Yi Liu wrote: On 2024/3/20 20:38, Jason Gunthorpe wrote: On Tue, Mar 19, 2024 at 03:29:39PM +0800, Yi Liu wrote: On 2024/3/19 00:52, Jason Gunthorpe wrote: On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote: yes. how about your opinion? @Jason. I noticed the set_dev_p

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-20 Thread Yi Liu
On 2024/3/20 20:38, Jason Gunthorpe wrote: On Tue, Mar 19, 2024 at 03:29:39PM +0800, Yi Liu wrote: On 2024/3/19 00:52, Jason Gunthorpe wrote: On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote: yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback and pasid_array updat

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-20 Thread Jason Gunthorpe
On Tue, Mar 19, 2024 at 03:29:39PM +0800, Yi Liu wrote: > On 2024/3/19 00:52, Jason Gunthorpe wrote: > > On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote: > > > > > yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback > > > and pasid_array update is under the group->lock

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-19 Thread Yi Liu
On 2024/3/19 00:52, Jason Gunthorpe wrote: On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote: yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback and pasid_array update is under the group->lock, so update it should be fine to adjust the order to update pasid_array aft

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-18 Thread Jason Gunthorpe
On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote: > yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback > and pasid_array update is under the group->lock, so update it should be > fine to adjust the order to update pasid_array after set_dev_pasid returns. Yes, it makes

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-13 Thread Yi Liu
On 2024/3/13 11:13, Baolu Lu wrote: On 2024/3/12 11:07, Yi Liu wrote: On 2024/3/11 17:26, Tian, Kevin wrote: From: Liu, Yi L Sent: Sunday, March 10, 2024 9:06 PM On 2024/1/16 01:19, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: +int iommu_replace_device_pasi

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-12 Thread Baolu Lu
On 2024/3/12 11:07, Yi Liu wrote: On 2024/3/11 17:26, Tian, Kevin wrote: From: Liu, Yi L Sent: Sunday, March 10, 2024 9:06 PM On 2024/1/16 01:19, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: +int iommu_replace_device_pasid(struct iommu_domain *domain, + 

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-11 Thread Yi Liu
On 2024/3/11 17:26, Tian, Kevin wrote: From: Liu, Yi L Sent: Sunday, March 10, 2024 9:06 PM On 2024/1/16 01:19, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: +int iommu_replace_device_pasid(struct iommu_domain *domain, + struct dev

RE: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-11 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Sunday, March 10, 2024 9:06 PM > > On 2024/1/16 01:19, Jason Gunthorpe wrote: > > On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: > >> +int iommu_replace_device_pasid(struct iommu_domain *domain, > >> + struct device *dev, ioasid_t pasid)

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-10 Thread Yi Liu
On 2024/1/16 01:19, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: +int iommu_replace_device_pasid(struct iommu_domain *domain, + struct device *dev, ioasid_t pasid) +{ + struct iommu_group *group = dev->iommu_group; + stru

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-01-15 Thread Jason Gunthorpe
On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: > +int iommu_replace_device_pasid(struct iommu_domain *domain, > +struct device *dev, ioasid_t pasid) > +{ > + struct iommu_group *group = dev->iommu_group; > + struct iommu_domain *old_domain; > + int r