RE: [PATCH 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
From: Tian, Kevin
Date: Mon Mar 16 2026 - 04:10:32 EST
> From: Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>
> Sent: Saturday, March 14, 2026 12:57 AM
>
> > -----Original Message-----
> > From: Jason Gunthorpe <jgg@xxxxxxxx>
> > Sent: 13 March 2026 16:51
> > To: Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>
> > Cc: iommu@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; joro@xxxxxxxxxx;
> > will@xxxxxxxxxx; robin.murphy@xxxxxxx; baolu.lu@xxxxxxxxxxxxxxx;
> > kevin.tian@xxxxxxxxx; Nicolin Chen <nicolinc@xxxxxxxxxx>; Nathan Chen
> > <nathanc@xxxxxxxxxx>; Matt Ochs <mochs@xxxxxxxxxx>; Krishnakant Jaju
> > <kjaju@xxxxxxxxxx>
> > Subject: Re: [PATCH 2/2] iommufd: Report ATS not supported status via
> > IOMMU_GET_HW_INFO
> >
> > External email: Use caution opening links or attachments
> >
> >
> > On Tue, Mar 03, 2026 at 03:03:48PM +0000, Shameer Kolothum wrote:
> > > If the IOMMU driver reports that ATS is not supported for a device, set
> > > the IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED flag in the returned
> > hardware
> > > capabilities.
> > >
> > > When this flag is set, ATS is not supported and not used for the device.
> > >
> > > Signed-off-by: Shameer Kolothum <skolothumtho@xxxxxxxxxx>
> > > ---
> > > include/uapi/linux/iommufd.h | 3 +++
> > > drivers/iommu/iommufd/device.c | 3 +++
> > > 2 files changed, 6 insertions(+)
> >
> > Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> >
> > > diff --git a/include/uapi/linux/iommufd.h
> b/include/uapi/linux/iommufd.h
> > > index 1dafbc552d37..d85a2d3e1b40 100644
> > > --- a/include/uapi/linux/iommufd.h
> > > +++ b/include/uapi/linux/iommufd.h
> > > @@ -695,11 +695,14 @@ enum iommu_hw_info_type {
> > > * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported,
> user
> > ignores it
> > > * when the struct
> > > * iommu_hw_info::out_max_pasid_log2 is zero.
> > > + * @IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED: ATS is not supported
> > and not used on
> > > + * this device.
> >
> > Same comment to clarify what this means. Does it mean ATS can be
> > turned on if the right HWPT is attached, or does it mean ATS is on
> > right now.
>
> Since this one is negative : ATS is not supported and cannot be used.
>
If ATS is not supported by hw, it certainly cannot be used.
If ATS is supported in hw but disallowed by firmware or kernel policy,
that's "cannot be used".
I'd replace 'and' with 'or' to cover both cases.
and you could add one clarification that when this flag is cleared
ATS will be turned on when the right HWPT is attached. Then the
behavior with this bit set or cleared is both deterministic to userspace.