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

From: Nicolin Chen

Date: Thu Nov 26 2026 - 15:46:57 EST


On Thu, Nov 26, 2026 at 03:53:46PM -0400, Jason Gunthorpe wrote:
> On Thu, Nov 26, 2026 at 11:41:38AM -0800, Nicolin Chen wrote:
> > On Thu, Nov 26, 2026 at 10:57:15AM -0400, Jason Gunthorpe wrote:
> > > On Wed, Nov 25, 2026 at 08:49:30PM -0800, Nicolin Chen wrote:
> > > > On Wed, Nov 25, 2026 at 02:07:45PM -0400, Jason Gunthorpe wrote:
> > > > > 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?
> > > >
> > > > Ah, you're right. It was added for non-pci_ats_required (non-CXL)
> > > > cases where the ATS state needs to be in sync with the hypervisor.
> > > >
> > > > However, the justification/usecase here is pci_ats_required alone.
> > > >
> > > > One small concern is whether VMM always exposes the underlying ATS
> > > > state or not to the guest VM. QEMU seems to do so. I did a test by
> > > > dropping the patch: lspci in the VM still shows: ATSCtl: Enable+
> > >
> > > It probably shouldn't do that, but it is also not harmful. The guest
> > > PCI controls should be fully ignored by the VMM..
> >
> > Would a PCI device driver (running in the guest) check the guest
> > level ATSCtl state for its ATS pathway?
> >
> > If VMM is not supposed to read through the physical config space,
> > without this patch, I suppose ATSCtl would be disabled and ATS on
> > RID might not be functional?
>
> VMM does not bind guest vPCI ATS Control to the physical ATS control.
>
> ATS is controlled through the vSTE only on all arches.
>
> Without a vIOMMU ATS is controlled entirely by host preference ie
> always on if available usualy.
>
> There is no need for the guest to read or write the vPCI ATS config
> space, but it does anyhow because it doesn't know it is a guest.

Hmm, I think we are talking about different layers.

I get that the physical ATS control is decided by either vSTE or
the hypervisor.

But both the ATSCtl state and pdev->ats_enabled, in the guest OS,
reflect the vPCI status.

Since VMM isn't supposed to read through the physical PCI config
space, the ATSCtl state would be disabled.

And pdev->ats_enabled would not be set, after we drop this patch.

I agree that there is no need for the guest PCI device driver to
read those two vPCI-related states, but if it ever tests either
of them and gates its ATS pathway on it, this can break, right?

Thanks
Nicolin