> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Sent: Monday, October 9, 2023 4:51 PM > > From: Kevin Tian <kevin.tian@xxxxxxxxx> > > SIOV devices allows driver to tag different PASIDs for the virtual devices > within it. Such driver should call iommufd_device_bind_pasid() to connect > the pasid of the device to iommufd, and then driver is able to attach the > virtual device to IOAS/HWPT with the iommufd_device_attach() API. > > Unlike physical devices, for SIOV virtual devices, iommufd_device_attach() > eventually uses the idev->default_pasid when the virtual device is attached s/default_pasid/rid_pasid/? or just call it idev->pasid. 'default' adds slight confusion instead... > to an IOAS/HWPT. Also, there is no need to do immediate_attach per iommu > domain allocation in the attach/replace path if any iommu domain allocation > happens since the attach/replace is eventually pasid attach/replace. immediate_attach rationale belongs to earlier pasid attach series when iommufd_device_pasid_attach() was introduced. Not here.