[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 34/37] vfio: Allow the selection of a given iommu backend for
|
From: |
Zhenzhong Duan |
|
Subject: |
[PATCH v3 34/37] vfio: Allow the selection of a given iommu backend for platform ap and ccw |
|
Date: |
Thu, 26 Oct 2023 18:31:01 +0800 |
Previously we added support to select iommu backend for vfio pci
device. Now we added others, E.g: platform, ap and ccw.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/vfio/vfio-platform.h | 1 +
hw/vfio/ap.c | 5 +++++
hw/vfio/ccw.c | 5 +++++
hw/vfio/platform.c | 4 ++++
4 files changed, 15 insertions(+)
diff --git a/include/hw/vfio/vfio-platform.h b/include/hw/vfio/vfio-platform.h
index c414c3dffc..f57f4276f2 100644
--- a/include/hw/vfio/vfio-platform.h
+++ b/include/hw/vfio/vfio-platform.h
@@ -18,6 +18,7 @@
#include "hw/sysbus.h"
#include "hw/vfio/vfio-common.h"
+#include "sysemu/iommufd.h"
#include "qemu/event_notifier.h"
#include "qemu/queue.h"
#include "qom/object.h"
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index bbf69ff55a..6a4186ccd3 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -15,6 +15,7 @@
#include <sys/ioctl.h>
#include "qapi/error.h"
#include "hw/vfio/vfio-common.h"
+#include "sysemu/iommufd.h"
#include "hw/s390x/ap-device.h"
#include "qemu/error-report.h"
#include "qemu/event_notifier.h"
@@ -204,6 +205,10 @@ static void vfio_ap_unrealize(DeviceState *dev)
static Property vfio_ap_properties[] = {
DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev),
+#ifdef CONFIG_IOMMUFD
+ DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd,
+ TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
+#endif
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index d857bb8d0f..7695ede0fc 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -21,6 +21,7 @@
#include "qapi/error.h"
#include "hw/vfio/vfio-common.h"
+#include "sysemu/iommufd.h"
#include "hw/s390x/s390-ccw.h"
#include "hw/s390x/vfio-ccw.h"
#include "hw/qdev-properties.h"
@@ -677,6 +678,10 @@ static void vfio_ccw_unrealize(DeviceState *dev)
static Property vfio_ccw_properties[] = {
DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev),
DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, false),
+#ifdef CONFIG_IOMMUFD
+ DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd,
+ TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
+#endif
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 8e3d4ac458..a1c25e0337 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -649,6 +649,10 @@ static Property vfio_platform_dev_properties[] = {
DEFINE_PROP_UINT32("mmap-timeout-ms", VFIOPlatformDevice,
mmap_timeout, 1100),
DEFINE_PROP_BOOL("x-irqfd", VFIOPlatformDevice, irqfd_allowed, true),
+#ifdef CONFIG_IOMMUFD
+ DEFINE_PROP_LINK("iommufd", VFIOPlatformDevice, vbasedev.iommufd,
+ TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
+#endif
DEFINE_PROP_END_OF_LIST(),
};
--
2.34.1
- [PATCH v3 23/37] Add iommufd configure option, (continued)
- [PATCH v3 23/37] Add iommufd configure option, Zhenzhong Duan, 2023/10/26
- [PATCH v3 26/37] vfio/iommufd: Implement the iommufd backend, Zhenzhong Duan, 2023/10/26
- [PATCH v3 27/37] vfio/iommufd: Switch to manual hwpt allocation, Zhenzhong Duan, 2023/10/26
- [PATCH v3 28/37] vfio/iommufd: Add support for iova_ranges, Zhenzhong Duan, 2023/10/26
- [PATCH v3 30/37] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info, Zhenzhong Duan, 2023/10/26
- [PATCH v3 31/37] vfio/pci: Adapt vfio pci hot reset support with iommufd BE, Zhenzhong Duan, 2023/10/26
- [PATCH v3 29/37] vfio/iommufd: Bypass EEH if iommufd backend, Zhenzhong Duan, 2023/10/26
- [PATCH v3 32/37] vfio/pci: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/10/26
- [PATCH v3 33/37] vfio/pci: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/26
- [PATCH v3 35/37] vfio/platform: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/26
- [PATCH v3 34/37] vfio: Allow the selection of a given iommu backend for platform ap and ccw,
Zhenzhong Duan <=
- [PATCH v3 36/37] vfio/ap: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/26
- [PATCH v3 37/37] vfio/ccw: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/26
- Re: [PATCH v3 00/37] vfio: Adopt iommufd, Markus Armbruster, 2023/10/26