Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-24 Thread Robin Murphy
On 2022-02-24 05:29, Lu Baolu wrote: On 2/24/22 1:16 PM, Lu Baolu wrote: Hi Robin and Jason, On 2/24/22 2:02 AM, Jason Gunthorpe wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use-case

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Lu Baolu
On 2/24/22 1:16 PM, Lu Baolu wrote: Hi Robin and Jason, On 2/24/22 2:02 AM, Jason Gunthorpe wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use-case for any driver to claim the same group

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Lu Baolu
On 2/24/22 2:00 AM, Robin Murphy wrote: On 2022-02-18 00:55, Lu Baolu wrote: [...] +/** + * iommu_group_claim_dma_owner() - Set DMA ownership of a group + * @group: The group. + * @owner: Caller specified pointer. Used for exclusive ownership. + * + * This is to support backward compatibility

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Lu Baolu
Hi Robin and Jason, On 2/24/22 2:02 AM, Jason Gunthorpe wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use-case for any driver to claim the same group more than once, and allowing it in

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Jason Gunthorpe via iommu
On Wed, Feb 23, 2022 at 06:20:36PM +, Robin Murphy wrote: > On 2022-02-23 18:02, Jason Gunthorpe via iommu wrote: > > On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: > > > > > ...and equivalently just set owner_cnt directly to 0 here. I don't see a > > > realistic use-case for

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Robin Murphy
On 2022-02-23 18:02, Jason Gunthorpe via iommu wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use-case for any driver to claim the same group more than once, and allowing it in the API just

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Jason Gunthorpe via iommu
On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: > ...and equivalently just set owner_cnt directly to 0 here. I don't see a > realistic use-case for any driver to claim the same group more than once, > and allowing it in the API just feels like opening up various potential > corners

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Robin Murphy
On 2022-02-18 00:55, Lu Baolu wrote: [...] +/** + * iommu_group_claim_dma_owner() - Set DMA ownership of a group + * @group: The group. + * @owner: Caller specified pointer. Used for exclusive ownership. + * + * This is to support backward compatibility for vfio which manages + * the dma

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-20 Thread Lu Baolu
On 2/19/22 3:31 PM, Christoph Hellwig wrote: The overall API and patch looks fine, but: + * iommu_group_dma_owner_claimed() - Query group dma ownership status + * @group: The group. + * + * This provides status query on a given group. It is racey and only for + * non-binding status reporting.

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-18 Thread Christoph Hellwig
The overall API and patch looks fine, but: > + * iommu_group_dma_owner_claimed() - Query group dma ownership status > + * @group: The group. > + * > + * This provides status query on a given group. It is racey and only for > + * non-binding status reporting. s/racey/racy/ > + */ > +bool

[PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-17 Thread Lu Baolu
Multiple devices may be placed in the same IOMMU group because they cannot be isolated from each other. These devices must either be entirely under kernel control or userspace control, never a mixture. This adds dma ownership management in iommu core and exposes several interfaces for the device