On 6/12/2026 12:24 AM, Cédric Le Goater wrote:
On 6/12/26 03:43, Nathan Chen wrote:
From: Nathan Chen <[email protected]>
Introduce a support_ats() handler that returns whether ATS is supported
for a device associated with a host IOMMU device, checking if the
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED capability bit is set.
Implement this handler in a new function for iommufd.
Suggested-by: Shameer Kolothum <[email protected]>
Signed-off-by: Nathan Chen <[email protected]>
---
include/system/host_iommu_device.h | 10 ++++++++++
backends/iommufd.c | 8 ++++++++
2 files changed, 18 insertions(+)
diff --git a/include/system/host_iommu_device.h b/include/system/
host_iommu_device.h
index f000301583..5615d6cb57 100644
--- a/include/system/host_iommu_device.h
+++ b/include/system/host_iommu_device.h
@@ -133,6 +133,16 @@ struct HostIOMMUDeviceClass {
* Returns: true on success, false on failure.
*/
bool (*get_pasid_info)(HostIOMMUDevice *hiod, PasidInfo
*pasid_info);
+ /**
+ * @support_ats: Return whether ATS is supported for the device
+ * associated with @hiod host IOMMU device, checking if the
+ * IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED capability bit is set.
IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED is low level implementation detail,
which could differ on a future host IOMMU backend.
I would remove "checking if the IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED
capability bit is set."
Something like this is more generic :
Returns true if ATS can be used by the device, false if the host IOMMU
reports it is unavailable.
Ok, I will re-word this comment on the next revision.
Thanks,
Nathan