Where is this special domain allocated? I think the above tests forThe code reads,The AMD iommu driver allocates a new domain (called v2 domain) for the"v2 domain" needs to be something greppable -- an identifier,
filename, etc.
2052 if (iommu_feature(iommu, FEATURE_GT) &&
2053 iommu_feature(iommu, FEATURE_PPR)) {
2054 iommu->is_iommu_v2 = true;
So, how about
..The AMD GPU has a private interface to its own AMD IOMMU, which could
be detected by the FEATURE_GT && FEATURE_PPR features. The AMD iommu
driver allocates a special domain for the GPU device ..
*IOMMU* features (I assume "GTSup: Guest translations supported" and
"PPRSup: Peripheral page request support" based on the AMD IOMMU
spec). It doesn't test that this is a GPU.
This change doesn't feel safe for all possible devices that have a
PASID Capability because we don't know whether they*always* use
Translated addresses with PASID TLPs.