If 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. This uses a negative flag for UAPI compatibility. Existing userspace assumes ATS is supported if no flag is present. This also ensures that new userspace works correctly on both old and new kernels, where a zero value implies ATS support. When this flag is set, ATS cannot be used for the device. When it is clear, ATS may be enabled when an appropriate HWPT is attached.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -695,11 +695,15 @@ enum iommu_hw_info_type { · 694 unmodified lines | ||
| 695 | 695 | * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it |
| 696 | 696 | * when the struct |
| 697 | 697 | * iommu_hw_info::out_max_pasid_log2 is zero. |
| 698 | + * @IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED: ATS is not supported or cannot be used | |
| 699 | + * on this device (absence implies ATS | |
| 700 | + * may be enabled) | |
| 698 | 701 | */ |
| 699 | 702 | enum iommufd_hw_capabilities { |
| 700 | 703 | IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0, |
| 701 | 704 | IOMMU_HW_CAP_PCI_PASID_EXEC = 1 << 1, |
| 702 | 705 | IOMMU_HW_CAP_PCI_PASID_PRIV = 1 << 2, |
| 706 | + IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED = 1 << 3, | |
| 703 | 707 | }; |
| 704 | 708 | |
| 705 | 709 | /** |