Re: [PATCH v2 1/1] iommu/vt-d: Move PCI PASID enablement to probe path

From: Jason Gunthorpe
Date: Mon Aug 19 2024 - 08:29:54 EST


On Mon, Aug 19, 2024 at 01:18:05PM +0800, Lu Baolu wrote:
> Currently, PCI PASID is enabled alongside PCI ATS when an iommu domain is
> attached to the device and disabled when the device transitions to block
> translation mode. This approach is inappropriate as PCI PASID is a device
> feature independent of the type of the attached domain.
>
> Enable PCI PASID during the IOMMU device probe and disables it during the
> release path.
>
> Suggested-by: Yi Liu <yi.l.liu@xxxxxxxxx>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Reviewed-by: Yi Liu <yi.l.liu@xxxxxxxxx>
> ---
> drivers/iommu/intel/iommu.c | 29 +++++++++++++++--------------
> 1 file changed, 15 insertions(+), 14 deletions(-)
>
> Change log:
> v2:
> - Move pasid enablement the last step in intel_iommu_probe_device().
> - Clear pasid enabled flags after pci_disable_pasid().

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason