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

From: Jason Gunthorpe

Date: Thu Nov 26 2026 - 10:00:12 EST


On Wed, Nov 25, 2026 at 10:28:45PM -0800, Nicolin Chen wrote:
> On Wed, Nov 25, 2026 at 02:07:45PM -0400, Jason Gunthorpe wrote:
> > > [ ... 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'
>
> Oh, whether we drop this patch or not, I realize that we would
> still need a helper.
>
> "viommu" reads a bit too wide than CC. Since "confidential" is
> renamed to "cc_private", maybe "iommu_cc_viommu_bypassed"?

Yeah, maybe thats OK.

>From the flow it doesn't actually matter if it is CC or viommu, but
those are the cases that trigger this..

Jason