RE: [PATCH v11 6/8] iommu/vt-d: Prepare for set_dev_pasid callback

From: Tian, Kevin
Date: Thu Jul 27 2023 - 01:49:42 EST


> From: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
> Sent: Tuesday, July 25, 2023 6:26 AM
>
> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
>
> The domain_flush_pasid_iotlb() helper function is used to flush the IOTLB
> entries for a given PASID. Previously, this function assumed that
> RID2PASID was only used for the first-level DMA translation. However, with
> the introduction of the set_dev_pasid callback, this assumption is no
> longer valid.
>
> Add a check before using the RID2PASID for PASID invalidation. This check
> ensures that the domain has been attached to a physical device before
> using RID2PASID.
>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>