Re: [PATCH 1/2] iommu: Add device ATS not supported capability
From: Jason Gunthorpe
Date: Fri Mar 13 2026 - 12:47:26 EST
On Tue, Mar 03, 2026 at 03:03:47PM +0000, Shameer Kolothum wrote:
> PCIe ATS may be disabled by platform firmware, root complex limitations,
> or kernel policy even when a device advertises the ATS capability in its
> PCI configuration space.
>
> Add a new IOMMU_CAP_PCI_ATS_NOT_SUPPORTED capability to allow IOMMU
> drivers to report the effective ATS decision for a device.
>
> When this capability is returned true for a device, ATS is not
> supported and not used for that device, regardless of the presence
> of the PCI ATS capability.
>
> A subsequent patch will extend iommufd to expose the effective ATS
> status to userspace.
>
> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Signed-off-by: Shameer Kolothum <skolothumtho@xxxxxxxxxx>
> ---
> include/linux/iommu.h | 2 ++
> drivers/iommu/amd/iommu.c | 6 ++++++
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 +++
> drivers/iommu/intel/iommu.c | 2 ++
> 4 files changed, 13 insertions(+)
>
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 54b8b48c762e..f40ecdc5d761 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -271,6 +271,8 @@ enum iommu_cap {
> */
> IOMMU_CAP_DEFERRED_FLUSH,
> IOMMU_CAP_DIRTY_TRACKING, /* IOMMU supports dirty tracking */
> + /* ATS is not supported and not used on this device */
> + IOMMU_CAP_PCI_ATS_NOT_SUPPORTED,
I think this one we should invert so it has saner semantics in-kernel
and for the drivers.
IOMMU_CAP_PCI_ATS_SUPPORTED
And then if not implemented it follows the usual cap protocol meaning
the iommu driver does nto support ATS.
It can be inverted by iommufd for the uapi.
Looks OK otherwise
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason