[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH rfcv2 01/18] Introduce a common abstract struct HostIOMMUDevice
From: |
Zhenzhong Duan |
Subject: |
[PATCH rfcv2 01/18] Introduce a common abstract struct HostIOMMUDevice |
Date: |
Thu, 1 Feb 2024 15:28:01 +0800 |
HostIOMMUDevice will be inherited by two sub classes,
legacy and iommufd currently.
Introduce a helper function host_iommu_base_device_init to initialize it.
Suggested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
include/sysemu/host_iommu_device.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 include/sysemu/host_iommu_device.h
diff --git a/include/sysemu/host_iommu_device.h
b/include/sysemu/host_iommu_device.h
new file mode 100644
index 0000000000..fe80ab25fb
--- /dev/null
+++ b/include/sysemu/host_iommu_device.h
@@ -0,0 +1,22 @@
+#ifndef HOST_IOMMU_DEVICE_H
+#define HOST_IOMMU_DEVICE_H
+
+typedef enum HostIOMMUDevice_Type {
+ HID_LEGACY,
+ HID_IOMMUFD,
+ HID_MAX,
+} HostIOMMUDevice_Type;
+
+typedef struct HostIOMMUDevice {
+ HostIOMMUDevice_Type type;
+ size_t size;
+} HostIOMMUDevice;
+
+static inline void host_iommu_base_device_init(HostIOMMUDevice *dev,
+ HostIOMMUDevice_Type type,
+ size_t size)
+{
+ dev->type = type;
+ dev->size = size;
+}
+#endif
--
2.34.1
- [PATCH rfcv2 00/18] Check and sync host IOMMU cap/ecap with vIOMMU, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 01/18] Introduce a common abstract struct HostIOMMUDevice,
Zhenzhong Duan <=
- [PATCH rfcv2 02/18] backends/iommufd: Introduce IOMMUFDDevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 04/18] vfio: Add host iommu device instance into VFIODevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 03/18] vfio: Introduce IOMMULegacyDevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 05/18] vfio: Remove redundant iommufd and devid elements in VFIODevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 06/18] vfio: Introduce host_iommu_device_init callback, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode, Zhenzhong Duan, 2024/02/01