iommu: Report effective PCIe ATS support status
Subsystems (5)
cover iommu: Report effective PCIe ATS support status
PCIe ATS may be disabled by platform firmware, root complex limitations, or host kernel policy, even when a device advertises the ATS capability in its PCI config space.
Userspace currently cannot determine whether ATS is effectively supported for a device. This may lead to incorrect assumptions when ATS appears present in PCI config space but is disabled by the platform, e.g., in use cases such as VFIO device pass-through.
This series introduces IOMMU_CAP_PCI_ATS_NOT_SUPPORTED to allow drivers to report when ATS is not supported for a device, and extends iommufd to expose this information via IOMMU_GET_HW_INFO.
The negative capability is chosen for backward compatibility: on older kernels the flag will be absent and userspace will retain the existing behaviour (i.e. assume ATS is usable if advertised).
Please see the related QEMU discussion for SMMUv3 accelerator use case here[0].
Please take a look and let me know.
Thanks,
Shameer
Shameer Kolothum (2):
iommu: Add device ATS not supported capability
iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
include/linux/iommu.h | 2 ++ include/uapi/linux/iommufd.h | 3 +++ drivers/iommu/amd/iommu.c | 6 ++++++ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 +++ drivers/iommu/intel/iommu.c | 2 ++ drivers/iommu/iommufd/device.c | 3 +++ 6 files changed, 19 insertions(+)
Signature · 1 line
2.43.0
PATCH 1/2 iommu: Add device ATS not supported capability
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.
--- 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(+)
include/linux/iommu.h +2 -0
@@ -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, };/* These are the possible reserved region types */
drivers/iommu/amd/iommu.c +6 -0
@@ -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_NOT_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 ; }
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +3 -0
@@ -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_NOT_SUPPORTED : +return !arm_smmu_ats_supported (master);default :return false; }
drivers/iommu/intel/iommu.c +2 -0
@@ -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_NOT_SUPPORTED : +return !info->ats_supported;default :return false; }
Signature · 1 line
2.43.0
Re: [PATCH 1/2] iommu: Add device ATS not supported capability
Quoted 6 lines · Shameer Kolothum
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_SUPPORTEDcapability to allow IOMMU drivers to report the effective ATS decision for a device.
nit: Maybe have IOMMU_CAP_PCI_ATS_SUPPORTED instead of the negative variant of the capability. As this will affect only new users who might check this capability so this does not really have to be negative.
Quoted 85 lines
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 <[email protected]>Signed-off-by Shameer Kolothum <[email protected]>---
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(+)include/linux/iommu.h +2
-0@@ -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, };/* These are the possible reserved region types */ drivers/iommu/amd/iommu.c +6
-0@@ -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_NOT_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 ; }drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +3
-0@@ -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_NOT_SUPPORTED : +return !arm_smmu_ats_supported (master);default :return false; }drivers/iommu/intel/iommu.c +2
-0@@ -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_NOT_SUPPORTED : +return !info->ats_supported;default :return false; }Signature · 1 line
2.43.0
Thanks,
Sami
Jason Gunthorpe
maintainerRe: [PATCH 1/2] iommu: Add device ATS not supported capability
Quoted 11 lines · Samiullah Khawaja
Quoted 6 lines · Shameer Kolothum
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_SUPPORTEDcapability to allow IOMMU drivers to report the effective ATS decision for a device.nit: Maybe have
IOMMU_CAP_PCI_ATS_SUPPORTEDinstead of the negative variant of the capability. As this will affect only new users who might check this capability so this does not really have to be negative.
It is deliberately negative for UAPI reasons.
Currently all userspace should assume ATS is supported.
The negative means new userspace that is sensitive will still work correctly on old and new kernels that both return 0 as meaning ATS is supported.
Perhaps this should be touched on in the commit message.
Jason
Re: [PATCH 1/2] iommu: Add device ATS not supported capability
Quoted 13 lines · Jason Gunthorpe
Quoted 11 lines · Samiullah Khawaja
Quoted 6 lines · Shameer Kolothum
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_SUPPORTEDcapability to allow IOMMU drivers to report the effective ATS decision for a device.nit: Maybe have
IOMMU_CAP_PCI_ATS_SUPPORTEDinstead of the negative variant of the capability. As this will affect only new users who might check this capability so this does not really have to be negative.
Quoted 7 lines
It is deliberately negative for UAPI reasons.
Currently all userspace should assume ATS is supported.
The negative means new userspace that is sensitive will still work correctly on old and new kernels that both return 0 as meaning ATS is supported.
Ah yes, for old userspace missing cap means ATS is supported.
Quoted 2 lines
Perhaps this should be touched on in the commit message.
+1
Quoted 2 lines
Jason
RE: [PATCH 1/2] iommu: Add device ATS not supported capability
In reply to Jason GunthorpeQuoted 30 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: 03 March 2026 23:29
To: Samiullah Khawaja <[email protected]>
Cc: Shameer Kolothum Thodi <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nicolin Chen <[email protected]>; Nathan Chen <[email protected]>; Matt Ochs <[email protected]>; Krishnakant Jaju <[email protected]>
Subject: Re: [PATCH 1/2] iommu: Add device ATS not supported capabilityQuoted 6 lines · Samiullah Khawaja
Quoted 5 lines · Shameer Kolothum
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_SUPPORTEDcapability to allowIOMMU
Quoted 5 lines
Quoted 1 line
drivers to report the effective ATS decision for a device.
nit: Maybe have
IOMMU_CAP_PCI_ATS_SUPPORTEDinstead of the negative variant of the capability. As this will affect only new users who might check this capability so this does not really have to be negative.It is deliberately negative for UAPI reasons.
Quoted 7 lines
Currently all userspace should assume ATS is supported.
The negative means new userspace that is sensitive will still work correctly on old and new kernels that both return 0 as meaning ATS is supported.
Perhaps this should be touched on in the commit message.
Right, this is mentioned in the cover letter. I will update the commit message as well.
Thanks,
Shameer
Re: [PATCH 1/2] iommu: Add device ATS not supported capability
In reply to Shameer KolothumQuoted 28 lines · Shameer Kolothum
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_SUPPORTEDcapability 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 <[email protected]>Signed-off-by Shameer Kolothum <[email protected]>--- 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(+)include/linux/iommu.h +0
-0
include/linux/iommu.h enum iommu_cap { · line 275
Quoted 5 lines
include/linux/iommu.h +2
-0@@ -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
Jason
Re: [PATCH 1/2] iommu: Add device ATS not supported capability
In reply to Shameer Kolothuminclude/linux/iommu.h enum iommu_cap { · line 275
Quoted 6 lines · Shameer Kolothum
include/linux/iommu.h +2
-0@@ -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,
Actually, on second thought, the kdoc should have more details about what supported means.
Does this mean ATS is available and could be turned on ?
Or does it mean ATS is on *right now* ?
The drivers should be changing ATS dynamically depending on what domain is attached.
I think the implementation follows the first option?
Jason
RE: [PATCH 1/2] iommu: Add device ATS not supported capability
Quoted 27 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: 13 March 2026 16:49
To: Shameer Kolothum Thodi <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nicolin Chen <[email protected]>; Nathan Chen <[email protected]>; Matt Ochs <[email protected]>; Krishnakant Jaju <[email protected]>
Subject: Re: [PATCH 1/2] iommu: Add device ATS not supported capabilityExternal email: Use caution opening links or attachments
include/linux/iommu.h enum iommu_cap { · line 275
Quoted 6 lines · Shameer Kolothum
include/linux/iommu.h +2
-0@@ -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,Actually, on second thought, the kdoc should have more details about what supported means.
Quoted 8 lines
Does this mean ATS is available and could be turned on ?
Or does it mean ATS is on *right now* ?
The drivers should be changing ATS dynamically depending on what domain is attached.
I think the implementation follows the first option?
Yes. If we change it to IOMMU_CAP_PCI_ATS_SUPPORTED, it means ATS is available and could be turned on. Will update.
Thanks,
Shameer
PATCH 2/2 iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
In reply to Shameer KolothumIf 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.
--- include/uapi/linux/iommufd.h | 3 +++ drivers/iommu/iommufd/device.c | 3 +++ 2 files changed, 6 insertions(+)
include/uapi/linux/iommufd.h +3 -0
@@ -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. */ enum iommufd_hw_capabilities {IOMMU_HW_CAP_DIRTY_TRACKING =1 <<0 ,IOMMU_HW_CAP_PCI_PASID_EXEC =1 <<1 ,IOMMU_HW_CAP_PCI_PASID_PRIV =1 <<2 , +IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED =1 <<3 , };/**
drivers/iommu/iommufd/device.c +3 -0
@@ -1624,6 +1624,9 @@ int iommufd_get_hw_info(struct iommufd_ucmd *ucmd)if (device_iommu_capable (idev->dev,IOMMU_CAP_DIRTY_TRACKING )) cmd->out_capabilities |=IOMMU_HW_CAP_DIRTY_TRACKING ; +if (device_iommu_capable (idev->dev,IOMMU_CAP_PCI_ATS_NOT_SUPPORTED )) + cmd->out_capabilities |=IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED ; + cmd->out_max_pasid_log2 =0 ;/* * Currently, all iommu drivers enable PASID in the probe_device()
Signature · 1 line
2.43.0
Re: [PATCH 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
Quoted 49 lines · Shameer Kolothum
If the IOMMU driver reports that ATS is not supported for a device, set the
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTEDflag 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 <[email protected]>---
include/uapi/linux/iommufd.h| 3 +++drivers/iommu/iommufd/device.c| 3 +++2 files changed, 6 insertions(+)include/uapi/linux/iommufd.h +3
-0@@ -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. */ enum iommufd_hw_capabilities {IOMMU_HW_CAP_DIRTY_TRACKING =1 <<0 ,IOMMU_HW_CAP_PCI_PASID_EXEC =1 <<1 ,IOMMU_HW_CAP_PCI_PASID_PRIV =1 <<2 , +IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED =1 <<3 , };/** drivers/iommu/iommufd/device.c +3
-0@@ -1624,6 +1624,9 @@ int iommufd_get_hw_info(struct iommufd_ucmd *ucmd)if (device_iommu_capable (idev->dev,IOMMU_CAP_DIRTY_TRACKING )) cmd->out_capabilities |=IOMMU_HW_CAP_DIRTY_TRACKING ; +if (device_iommu_capable (idev->dev,IOMMU_CAP_PCI_ATS_NOT_SUPPORTED )) + cmd->out_capabilities |=IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED ; + cmd->out_max_pasid_log2 =0 ;/* * Currently, all iommu drivers enable PASID in the probe_device() Signature · 1 line
2.43.0
Re: [PATCH 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
In reply to Shameer KolothumQuoted 11 lines · Shameer Kolothum
If the IOMMU driver reports that ATS is not supported for a device, set the
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTEDflag 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 <[email protected]>--- include/uapi/linux/iommufd.h | 3 +++ drivers/iommu/iommufd/device.c | 3 +++ 2 files changed, 6 insertions(+)
include/uapi/linux/iommufd.h enum iommu_hw_info_type { · line 699
Quoted 10 lines
include/uapi/linux/iommufd.h +2
-0@@ -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.
Jason
RE: [PATCH 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
Quoted 43 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: 13 March 2026 16:51
To: Shameer Kolothum Thodi <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nicolin Chen <[email protected]>; Nathan Chen <[email protected]>; Matt Ochs <[email protected]>; Krishnakant Jaju <[email protected]>
Subject: Re: [PATCH 2/2] iommufd: Report ATS not supported status viaIOMMU_GET_HW_INFOExternal email: Use caution opening links or attachments
Quoted 2 lines · Shameer Kolothum
If the IOMMU driver reports that ATS is not supported for a device, set the
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTEDflag in the returnedhardware
Quoted 9 lines
capabilities.
When this flag is set, ATS is not supported and not used for the device.
Signed-off-by Shameer Kolothum <[email protected]>--- include/uapi/linux/iommufd.h | 3 +++ drivers/iommu/iommufd/device.c | 3 +++ 2 files changed, 6 insertions(+)Reviewed-by Jason Gunthorpe <[email protected]>include/uapi/linux/iommufd.h enum iommu_hw_info_type { · line 695
Quoted 6 lines
include/uapi/linux/iommufd.h +0
-0@@ -695,11 +695,14 @@ enum iommu_hw_info_type {* @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it
include/uapi/linux/iommufd.h enum iommu_hw_info_type {
Quoted 3 lines
include/uapi/linux/iommufd.h +1
-0* when the struct * iommu_hw_info::out_max_pasid_log2 is zero. +* @IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED: ATS is not supported
Quoted 6 lines
and not used on
include/uapi/linux/iommufd.h enum iommu_hw_info_type { · line 699
Quoted 1 line
include/uapi/linux/iommufd.h +1
-0+* 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.
Thanks,
Shameer
Tian, Kevin
maintainerRE: [PATCH 2/2] iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO
Quoted 46 lines
From: Shameer Kolothum Thodi <[email protected]>
Sent: Saturday, March 14, 2026 12:57 AMQuoted 29 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: 13 March 2026 16:51
To: Shameer Kolothum Thodi <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nicolin Chen <[email protected]>; Nathan Chen <[email protected]>; Matt Ochs <[email protected]>; Krishnakant Jaju <[email protected]>
Subject: Re: [PATCH 2/2] iommufd: Report ATS not supported status viaIOMMU_GET_HW_INFOExternal email: Use caution opening links or attachments
Quoted 2 lines · Shameer Kolothum
If the IOMMU driver reports that ATS is not supported for a device, set the
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTEDflag in the returnedhardware
Quoted 9 lines
capabilities.
When this flag is set, ATS is not supported and not used for the device.
Signed-off-by Shameer Kolothum <[email protected]>--- include/uapi/linux/iommufd.h | 3 +++ drivers/iommu/iommufd/device.c | 3 +++ 2 files changed, 6 insertions(+)Quoted 3 lines
Reviewed-by Jason Gunthorpe <[email protected]>Review
Quoted 1 line
(quoted diff) +0
-0
b/include/uapi/linux/iommufd.hQuoted 5 lines
include/uapi/linux/iommufd.h enum iommu_hw_info_type { · line 695
Quoted 5 lines
index
1dafbc552d37..d85a2d3e1b40100644include/uapi/linux/iommufd.h +0
-0@@ -695,11 +695,14 @@ enum iommu_hw_info_type {* @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user
Quoted 4 lines
ignores it
Quoted 3 lines
include/uapi/linux/iommufd.h +1
-0* when the struct * iommu_hw_info::out_max_pasid_log2 is zero. +* @IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED: ATS is not supported
Quoted 9 lines
Quoted 6 lines
and not used on
include/uapi/linux/iommufd.h enum iommu_hw_info_type { · line 699
Quoted 1 line
include/uapi/linux/iommufd.h +1
-0+* 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.