History

iommu: Allow an input type in hw_info op

The hw_info uAPI will support a bidirectional data_type field that can be used as an input field for user space to request for a specific info data. To prepare for the uAPI update, change the iommu layer first: - Add a new IOMMU_HW_INFO_TYPE_DEFAULT as an input, for which driver can output its only (or firstly) supported type - Update the kdoc accordingly - Roll out the type validation in the existing drivers

Nicolin Chen committed 1 year ago

Commit 62622a81 parent 035c9216 files · +20 −2Browse files

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

Unified · Split

include/uapi/linux/iommufd.h+3−1
@@ -593,13 +593,15 @@ struct iommu_hw_info_arm_smmuv3 { · 592 unmodified lines
593593
594594 /**
595595 * enum iommu_hw_info_type - IOMMU Hardware Info Types
596− * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware
596+ * @IOMMU_HW_INFO_TYPE_NONE: Output by the drivers that do not report hardware
597597 * info
598+ * @IOMMU_HW_INFO_TYPE_DEFAULT: Input to request for a default type
598599 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type
599600 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
600601 */
601602 enum iommu_hw_info_type {
602603 IOMMU_HW_INFO_TYPE_NONE = 0,
604+ IOMMU_HW_INFO_TYPE_DEFAULT = 0,
603605 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
604606 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
605607 };