Re: [PATCH v3 5/7] iommu: Introduce TDISP T=0 state for confidential IOMMUs

From: Jason Gunthorpe

Date: Wed Nov 25 2026 - 13:08:31 EST


> [ ... 139 lines skipped ... ]
> +static inline bool iommu_using_t0_stream(struct device *dev)
> +{
> + return dev->iommu->iommu_dev->confidential &&
> + !dev->iommu->tdisp_t1;
> +}

The logic looks OK, but this naming is weird.

All PCIe devices use the T=0 stream by default, so this function
by its name should return true for normal PCI functions

I think this function is trying to say 'iommu is bypassed', that might
be a much clearer set of naming to lean into rather than focusing on
CC.

'iommu is bypassed' means you can enable ATS without having to involve
the IOMMU driver because the hypervisor will activate it in the real
HW.

So the names would be more like:
iommu_viommu_bypassed()
iommu_bypassed_enable_identity()
iommu_bypassed_disable_identity()

With kdocs focusing on the main property 'a viommu that is bypassed
means the hypervisor sets identity translation while bypassed and PCIE
ATS controls ATS behavior'

Though I am wondering if we really need the ATS stuff. Why do we need
that? The pci_ats_required() in the hypervisor should force ATS since
the hypervisor is not going to construct a vSTE or use a nesting
domain that would inhibit that? Can we just drop this whole patch?

--
Jason