Re: [PATCH 1/1] iommu/vt-d: Enable PASID during iommu device probe

From: Baolu Lu
Date: Wed Sep 14 2022 - 23:06:20 EST




On 9/14/22 4:59 PM, Ethan Zhao wrote:
What the error path would be if this code runs on some old platforms don't

support PASID, would you print out "this platform doesn't suppor PASID" and

give users an interface function to query if the PASID cap of iommu is enabled

and if not why ?

It's not an error case if the IOMMU doesn't support PASID. But it's an
error case if any device drivers call PASID related IOMMU interfaces
(for example, iommu_domain_attach/detach_dev_pasid()). The corresponding
error code will be returned to the drivers.

So iommu driver withdraws the flexibility/rights from device driver about the

ability to enable PASID, looks much more *integrated* iommu works as relation

No. This patch doesn't withdraw anything. It's just a code refactoring.


controller in device-iommu-domain by enabling PASID in iommu probe stage

by default -- iommu decides to enable PASID or not though device-iommu-

domain might not work ? or they should work because they are hard-wired

together (device - iommu) even device is hotpluged later.


I may not get you exactly. :-) Some IOMMU features reply on PASID
capabilities on both IOMMU and device. The IOMMU drivers enumerate the
capabilities and enable them if they are supported.

Best regards,
baolu