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
593 593
594/**594/**
595 * enum iommu_hw_info_type - IOMMU Hardware Info Types595 * enum iommu_hw_info_type - IOMMU Hardware Info Types
596 * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware596 * @IOMMU_HW_INFO_TYPE_NONE: Output by the drivers that do not report hardware
597 * info597 * info
598 * @IOMMU_HW_INFO_TYPE_DEFAULT: Input to request for a default type
598 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type599 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type
599 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type600 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
600 */601 */
601enum iommu_hw_info_type {602enum iommu_hw_info_type {
602 IOMMU_HW_INFO_TYPE_NONE = 0,603 IOMMU_HW_INFO_TYPE_NONE = 0,
604 IOMMU_HW_INFO_TYPE_DEFAULT = 0,
603 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,605 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
604 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,606 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
605};607};