RE: [RFC PATCH v9 1/5] iommu/vt-d: add flush_target_dev member to struct intel_iommu and pass device info to all ATS Invalidation functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Ethan Zhao <haifeng.zhao@xxxxxxxxxxxxxxx>
> Sent: Thursday, December 28, 2023 8:17 AM
>
> @@ -181,6 +181,7 @@ static void __flush_svm_range_dev(struct intel_svm
> *svm,
> 
>  	qi_flush_piotlb(sdev->iommu, sdev->did, svm->pasid, address, pages,
> ih);
>  	if (info->ats_enabled) {
> +		info->iommu->flush_target_dev = info->dev;
>  		qi_flush_dev_iotlb_pasid(sdev->iommu, sdev->sid, info-
> >pfsid,
>  					 svm->pasid, sdev->qdep, address,
>  					 order_base_2(pages));

this is wrong both in concept and function.

an iommu instance can be shared by many devices which may all have
ongoing ATS invalidation requests to handle. Using a per-iommu field
to store the flush target is limiting (and there is no lock protection at all).

if there is a real need of passing dev pointer to qi helpers, just change
the helper to accept an explicit parameter.





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux