[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 07/41] vfio/container: Introduce a empty VFIOIOMMUOps
|
From: |
Zhenzhong Duan |
|
Subject: |
[PATCH v4 07/41] vfio/container: Introduce a empty VFIOIOMMUOps |
|
Date: |
Thu, 2 Nov 2023 15:12:28 +0800 |
This empty VFIOIOMMUOps named vfio_legacy_ops will hold all general
IOMMU ops of legacy container.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
include/hw/vfio/vfio-common.h | 2 +-
hw/vfio/container.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 586d153c12..678161f207 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -255,7 +255,7 @@ typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList;
typedef QLIST_HEAD(VFIODeviceList, VFIODevice) VFIODeviceList;
extern VFIOGroupList vfio_group_list;
extern VFIODeviceList vfio_device_list;
-
+extern const VFIOIOMMUOps vfio_legacy_ops;
extern const MemoryListener vfio_memory_listener;
extern int vfio_kvm_device_fd;
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index 242010036a..4bc43ddfa4 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -472,6 +472,7 @@ static int vfio_connect_container(VFIOGroup *group,
AddressSpace *as,
Error **errp)
{
VFIOContainer *container;
+ VFIOContainerBase *bcontainer;
int ret, fd;
VFIOAddressSpace *space;
@@ -552,6 +553,8 @@ static int vfio_connect_container(VFIOGroup *group,
AddressSpace *as,
container->iova_ranges = NULL;
QLIST_INIT(&container->giommu_list);
QLIST_INIT(&container->vrdl_list);
+ bcontainer = &container->bcontainer;
+ bcontainer->ops = &vfio_legacy_ops;
ret = vfio_init_container(container, group->fd, errp);
if (ret) {
@@ -933,3 +936,5 @@ void vfio_detach_device(VFIODevice *vbasedev)
vfio_put_base_device(vbasedev);
vfio_put_group(group);
}
+
+const VFIOIOMMUOps vfio_legacy_ops;
--
2.34.1
- [PATCH v4 00/41] vfio: Adopt iommufd, Zhenzhong Duan, 2023/11/02
- [PATCH v4 01/41] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c, Zhenzhong Duan, 2023/11/02
- [PATCH v4 02/41] vfio/container: Move vfio_container_add/del_section_window into spapr.c, Zhenzhong Duan, 2023/11/02
- [PATCH v4 03/41] vfio/container: Move spapr specific init/deinit into spapr.c, Zhenzhong Duan, 2023/11/02
- [PATCH v4 04/41] vfio/spapr: Make vfio_spapr_create/remove_window static, Zhenzhong Duan, 2023/11/02
- [PATCH v4 05/41] vfio/common: Move vfio_host_win_add/del into spapr.c, Zhenzhong Duan, 2023/11/02
- [PATCH v4 06/41] vfio: Introduce base object for VFIOContainer and targeted interface, Zhenzhong Duan, 2023/11/02
- [PATCH v4 07/41] vfio/container: Introduce a empty VFIOIOMMUOps,
Zhenzhong Duan <=
- [PATCH v4 08/41] vfio/container: Switch to dma_map|unmap API, Zhenzhong Duan, 2023/11/02
- [PATCH v4 09/41] vfio/common: Introduce vfio_container_init/destroy helper, Zhenzhong Duan, 2023/11/02
- [PATCH v4 10/41] vfio/common: Move giommu_list in base container, Zhenzhong Duan, 2023/11/02
- [PATCH v4 11/41] vfio/container: Move space field to base container, Zhenzhong Duan, 2023/11/02
- [PATCH v4 12/41] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API, Zhenzhong Duan, 2023/11/02