Re: [PATCH RFCv1 1/3] PCI: Allow ATS to be always on for CXL.cache capable devices

Jason Gunthorpe
2026-02-24T14:38:23Z

On Fri, Feb 20, 2026 at 10:49:09AM -0800, Nicolin Chen wrote:
> On Fri, Feb 20, 2026 at 08:50:44AM -0400, Jason Gunthorpe wrote:
> > On Thu, Feb 19, 2026 at 08:52:56PM -0800, Nicolin Chen wrote:
> > The next suggestion is to park the device in a real DMA domain with an
> > actual page table and DMA API hooked up. Now interrupts will work and
> > the domain is empty so there is no translation. The issue here is the
> > domain doesn't block ATS. We could fix this with some "disable ATS"
> > domain flag.
> >
> > In either case when the driver is bound and requests that the DMA API
> > start working if the user requested IDENTITY then it has to be
> > switched away from the parked domain to IDENTITY.
>
> Thanks for elaborating. This seems very orthogonal to the issue
> that driver_managed_dma skips iommu_device_use_default_domain().
> (And I see you discussion with Robin.)
>
> Regarding the empty-DMA domain, I have an idea of accommodating
> ARM cases with an IOMMU_DOMAIN_MSI_ONLY, which is essentially a
> paging domain that only allows IOMMU_COOKIE_DMA_MSI but blocks
> everything else.

Yeah, maybe, but also we probably don't need such stringent checks
since no driver will be bound while this domain is setup, so the basic
DMA domain is fine too.

> > A final thought would be to change around the driver managed DMA
> > mechanism a bit to allow drivers to indicate they use IRQs but not
> > DMA, then the bind step could switch from a BLOCKED domain to an empty
> > DMA API domain to allow MSI to work.
>
> Yes, "driver_managed_dma" is so unclear in pcieport case, since
> its driver doesn't really manage DMA...

It should be taken to mean "this device never does DMA when attached
to this driver"

> A separate flag could be clear. And the IOMMU layer might do an
> AND operation between driver_uses_msi(?) flag and another IOMMU
> device-level flag msi_behind_iommu?

Perhaps the bool can become an enum:
NORMAL DMA API
MANUAL DOMAIN MANAGEMENT
NO DMA MSI ONLY

Then the latter can switch to a DMA domain out of blocked on driver
binding, and we'd teach VFIO to refuse multi-device groups with MSI
ONLY members on ARM because it doesn't work :\

Jason