Re: [PATCH v10 04/12] iommu: Add attach/detach_dev_pasid iommu interface

From: Jason Gunthorpe
Date: Wed Aug 03 2022 - 15:03:32 EST


On Wed, Aug 03, 2022 at 09:07:35PM +0800, Baolu Lu wrote:
> +/**
> + * iommu_device_claim_pasid_owner() - Set ownership of a pasid on device
> + * @dev: the device.
> + * @pasid: the pasid of the device.
> + * @owner: caller specified pointer. Used for exclusive ownership.
> + *
> + * Return 0 if it is allowed, otherwise an error.
> + */
> +int iommu_device_claim_pasid_owner(struct device *dev, ioasid_t pasid, void
> *owner)

I don't see a use case for a special "pasid owner"

PASID is no different from normal DMA. If the calling driver already
has the proper ownership of the device/group then it is fine for that
driver to use any kind of IOMMU attachment, RID, PASID, whatever. It
doesn't matter *how* the attachment is made.

Remember the series that got dropped about converting all the drivers
to the new ownership scheme? That is how it should work - owernship
and domain attach are two different operations and do not get mixed
confusingly together. (and are you going to repost that series? It
would be great to get it done)

Jason