Add intel_iommu_hw_info() to report cap_reg and ecap_reg information.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -372,13 +372,36 @@ struct iommu_hwpt_alloc { · 371 unmodified lines | ||
| 372 | 372 | }; |
| 373 | 373 | #define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC) |
| 374 | 374 | |
| 375 | +/** | |
| 376 | + * struct iommu_hw_info_vtd - Intel VT-d hardware information | |
| 377 | + * | |
| 378 | + * @flags: Must be 0 | |
| 379 | + * @__reserved: Must be 0 | |
| 380 | + * | |
| 381 | + * @cap_reg: Value of Intel VT-d capability register defined in VT-d spec | |
| 382 | + * section 11.4.2 Capability Register. | |
| 383 | + * @ecap_reg: Value of Intel VT-d capability register defined in VT-d spec | |
| 384 | + * section 11.4.3 Extended Capability Register. | |
| 385 | + * | |
| 386 | + * User needs to understand the Intel VT-d specification to decode the | |
| 387 | + * register value. | |
| 388 | + */ | |
| 389 | +struct iommu_hw_info_vtd { | |
| 390 | + __u32 flags; | |
| 391 | + __u32 __reserved; | |
| 392 | + __aligned_u64 cap_reg; | |
| 393 | + __aligned_u64 ecap_reg; | |
| 394 | +}; | |
| 395 | + | |
| 375 | 396 | /** |
| 376 | 397 | * enum iommu_hw_info_type - IOMMU Hardware Info Types |
| 377 | 398 | * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware |
| 378 | 399 | * info |
| 400 | + * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type | |
| 379 | 401 | */ |
| 380 | 402 | enum iommu_hw_info_type { |
| 381 | 403 | IOMMU_HW_INFO_TYPE_NONE, |
| 404 | + IOMMU_HW_INFO_TYPE_INTEL_VTD, | |
| 382 | 405 | }; |
| 383 | 406 | |
| 384 | 407 | /** |