Skip to content

iommu: Report effective PCIe ATS support status

Shameer Kolothum linux-iommu lkml 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 11 repliesSuperseded

Changes in v2 from the cover letter

https://lore.kernel.org/all/[email protected]/
- Addressed feedback and picked up R-by tags. Thanks!
- Inverted flag to IOMMU_CAP_PCI_ATS_SUPPORTED for IOMMU drivers(patch #1).
- Updated comments and commit messages to clarify the semantics.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2iommu: Add device ATS supported capabilitydrivers/iommu/amd/iommu.c drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c drivers/iommu/intel/iommu.c +1 more+13 -00 replies
2/2iommufd: Report ATS not supported status via IOMMU_GET_HW_INFOdrivers/iommu/iommufd/device.c include/uapi/linux/iommufd.h+8 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJason GunthorpeSamiullah Khawaja
1/2R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] iommu: Report effective PCIe ATS support status

Hi,

Changes from v1:
https://lore.kernel.org/all/[email protected]/
- Addressed feedback and picked up R-by tags. Thanks!
- Inverted flag to IOMMU_CAP_PCI_ATS_SUPPORTED for IOMMU drivers(patch #1).
- Updated comments and commit messages to clarify the semantics.

---

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 a new IOMMU capability, IOMMU_CAP_PCI_ATS_SUPPORTED, to allow drivers to report the effective ATS decision for a device. It also extends iommufd to expose this information via IOMMU_GET_HW_INFO.

For UAPI compatibility, the iommufd interface exposes this as a negative capability, IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED. On older kernels the flag will be absent, and userspace will retain the existing behaviour (i.e. assume ATS is usable if advertised via PCIe CAP).

Please see the related QEMU discussion for SMMUv3 accelerator use case here[0].

Please take a look and let me know.

Thanks,
Shameer

[0] https://lore.kernel.org/qemu-devel/CH3PR12MB7548515EDA96BD03F64DCAA2AB62A@CH3PR12MB7548.namprd12.prod.outlook.com/

Shameer Kolothum (2):
iommu: Add device ATS supported capability
iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO

 include/linux/iommu.h                       | 2 ++
 include/uapi/linux/iommufd.h                | 4 ++++
 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              | 4 ++++
 6 files changed, 21 insertions(+)
Signature · 1 line
2.43.0