From: Shameer Kolothum <skolothumtho@nvidia.com>
To: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: <joro@8bytes.org>, <will@kernel.org>, <robin.murphy@arm.com>,
<baolu.lu@linux.intel.com>, <jgg@ziepe.ca>,
<kevin.tian@intel.com>, <skhawaja@google.com>,
<nicolinc@nvidia.com>, <nathanc@nvidia.com>, <mochs@nvidia.com>,
<kjaju@nvidia.com>, <skolothumtho@nvidia.com>,
"Jason Gunthorpe" <jgg@nvidia.com>
Subject: [PATCH v2 1/2] iommu: Add device ATS supported capability
Date: Tue, 17 Mar 2026 11:16:02 +0000 [thread overview]
Message-ID: <20260317111603.101456-2-skolothumtho@nvidia.com> (raw)
In-Reply-To: <20260317111603.101456-1-skolothumtho@nvidia.com>
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_SUPPORTED capability to allow IOMMU drivers
to report the effective ATS decision for a device.
When this capability is true for a device, ATS may be enabled for that
device, but it does not imply that ATS is currently enabled.
A subsequent patch will extend iommufd to expose the effective ATS
status to userspace.
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>
---
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..33fa39e17f3c 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 supported and may be enabled for this device */
+ IOMMU_CAP_PCI_ATS_SUPPORTED,
};
/* These are the possible reserved region types */
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 81c4d7733872..f1814fee5182 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2985,6 +2985,12 @@ static bool amd_iommu_capable(struct device *dev, enum iommu_cap cap)
return amd_iommu_hd_support(iommu);
}
+ case IOMMU_CAP_PCI_ATS_SUPPORTED: {
+ struct iommu_dev_data *dev_data = dev_iommu_priv_get(dev);
+
+ return amd_iommu_iotlb_sup &&
+ (dev_data->flags & AMD_IOMMU_DEVICE_FLAG_ATS_SUP);
+ }
default:
break;
}
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 4d00d796f078..dec5cac98f7c 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -107,6 +107,7 @@ static const char * const event_class_str[] = {
};
static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master);
+static bool arm_smmu_ats_supported(struct arm_smmu_master *master);
static void parse_driver_options(struct arm_smmu_device *smmu)
{
@@ -2494,6 +2495,8 @@ static bool arm_smmu_capable(struct device *dev, enum iommu_cap cap)
return true;
case IOMMU_CAP_DIRTY_TRACKING:
return arm_smmu_dbm_capable(master->smmu);
+ case IOMMU_CAP_PCI_ATS_SUPPORTED:
+ return arm_smmu_ats_supported(master);
default:
return false;
}
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index ef7613b177b9..5dca8e525c73 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3220,6 +3220,8 @@ static bool intel_iommu_capable(struct device *dev, enum iommu_cap cap)
return ecap_sc_support(info->iommu->ecap);
case IOMMU_CAP_DIRTY_TRACKING:
return ssads_supported(info->iommu);
+ case IOMMU_CAP_PCI_ATS_SUPPORTED:
+ return info->ats_supported;
default:
return false;
}
--
2.43.0
next prev parent reply other threads:[~2026-03-17 11:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 11:16 [PATCH v2 0/2] iommu: Report effective PCIe ATS support status Shameer Kolothum
2026-03-17 11:16 ` Shameer Kolothum [this message]
2026-03-17 11:16 ` [PATCH v2 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO Shameer Kolothum
2026-03-17 13:05 ` [PATCH v2 0/2] iommu: Report effective PCIe ATS support status Jörg Rödel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260317111603.101456-2-skolothumtho@nvidia.com \
--to=skolothumtho@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kjaju@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochs@nvidia.com \
--cc=nathanc@nvidia.com \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=skhawaja@google.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®