Aside from the IOPF framework, iommufd provides an additional pathway to report hardware events, via the vEVENTQ of vIOMMU infrastructure. Define an iommu_vevent_arm_smmuv3 uAPI structure, and report stage-1 events in the threaded IRQ handler. Also, add another four event record types that can be forwarded to a VM.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -1054,9 +1054,32 @@ struct iommufd_vevent_header { · 1053 unmodified lines | ||
| 1054 | 1054 | /** |
| 1055 | 1055 | * enum iommu_veventq_type - Virtual Event Queue Type |
| 1056 | 1056 | * @IOMMU_VEVENTQ_TYPE_DEFAULT: Reserved for future use |
| 1057 | + * @IOMMU_VEVENTQ_TYPE_ARM_SMMUV3: ARM SMMUv3 Virtual Event Queue | |
| 1057 | 1058 | */ |
| 1058 | 1059 | enum iommu_veventq_type { |
| 1059 | 1060 | IOMMU_VEVENTQ_TYPE_DEFAULT = 0, |
| 1061 | + IOMMU_VEVENTQ_TYPE_ARM_SMMUV3 = 1, | |
| 1062 | +}; | |
| 1063 | + | |
| 1064 | +/** | |
| 1065 | + * struct iommu_vevent_arm_smmuv3 - ARM SMMUv3 Virtual Event | |
| 1066 | + * (IOMMU_VEVENTQ_TYPE_ARM_SMMUV3) | |
| 1067 | + * @evt: 256-bit ARM SMMUv3 Event record, little-endian. | |
| 1068 | + * Reported event records: (Refer to "7.3 Event records" in SMMUv3 HW Spec) | |
| 1069 | + * - 0x04 C_BAD_STE | |
| 1070 | + * - 0x06 F_STREAM_DISABLED | |
| 1071 | + * - 0x08 C_BAD_SUBSTREAMID | |
| 1072 | + * - 0x0a C_BAD_CD | |
| 1073 | + * - 0x10 F_TRANSLATION | |
| 1074 | + * - 0x11 F_ADDR_SIZE | |
| 1075 | + * - 0x12 F_ACCESS | |
| 1076 | + * - 0x13 F_PERMISSION | |
| 1077 | + * | |
| 1078 | + * StreamID field reports a virtual device ID. To receive a virtual event for a | |
| 1079 | + * device, a vDEVICE must be allocated via IOMMU_VDEVICE_ALLOC. | |
| 1080 | + */ | |
| 1081 | +struct iommu_vevent_arm_smmuv3 { | |
| 1082 | + __aligned_le64 evt[4]; | |
| 1060 | 1083 | }; |
| 1061 | 1084 | |
| 1062 | 1085 | /** |