History

iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO

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.

Shameer Kolothum committed 8 months ago

Commit a11661a1 parent a82efb82 files · +8 −0Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/iommufd.h+4−0
@@ -695,11 +695,15 @@ enum iommu_hw_info_type { · 694 unmodified lines
695 * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it695 * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it
696 * when the struct696 * when the struct
697 * iommu_hw_info::out_max_pasid_log2 is zero.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 */
699enum iommufd_hw_capabilities {702enum iommufd_hw_capabilities {
700 IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0,703 IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0,
701 IOMMU_HW_CAP_PCI_PASID_EXEC = 1 << 1,704 IOMMU_HW_CAP_PCI_PASID_EXEC = 1 << 1,
702 IOMMU_HW_CAP_PCI_PASID_PRIV = 1 << 2,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/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t