RE: [PATCH 1/1] iommu/vt-d: Draining PRQ in sva unbind path when FPD bit set

From: Tian, Kevin
Date: Tue Dec 17 2024 - 02:40:51 EST


> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Tuesday, December 17, 2024 10:43 AM
>
> When a device uses a PASID for SVA (Shared Virtual Address), it's possible
> that the PASID entry is marked as non-present and FPD bit set before the
> device flushes all ongoing DMA requests and removes the SVA domain. This
> can occur when an exception happens and the process terminates before the
> device driver stops DMA and calls the iommu driver to unbind the PASID.
>
> There's no need to drain the PRQ in the mm release path. Instead, the PRQ
> will be drained in the SVA unbind path. But in such case,
> intel_pasid_tear_down_entry() only checks the presence of the pasid entry
> and returns directly.
>
> Add the code to clear the FPD bit and drain the PRQ.
>
> Suggested-by: Kevin Tian <kevin.tian@xxxxxxxxx>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>

Need a fix tag given the old code doesn't work correctly?

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