> From: Xiong Weimin <[email protected]>
> 
> [ Upstream commit 7b411448c668bfab0d0e572cee5a592cea396ce7 ]
> 
> vdpasim_dma_map() updates the IOTLB and the passthrough (iommu_pt)
> state under iommu_lock.  vdpasim_dma_unmap() clears iommu_pt and
> resets the IOTLB before taking iommu_lock, then deletes the mapping
> while holding the lock.
> 
> A concurrent dma_map(), dma_unmap(), or reset path that also touches
> the same address space can therefore observe or modify the IOTLB and
> iommu_pt state without consistent locking.
> 
> Perform the passthrough transition and range deletion under the same
> iommu_lock scope, matching dma_map().
> 
> Tested-on: openEuler VM (6.16.8, /usr/src/linux-6.16.8)
> Tested-by: Xiong Weimin <[email protected]>
> 
> Signed-off-by: Xiong Weimin <[email protected]>
> Signed-off-by: Michael S. Tsirkin <[email protected]>
> Message-ID: <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1


Reply via email to