46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
|
|
From b8e67d06ec3036cd3fd6d625c550e0c542e49d60 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= <clg@redhat.com>
|
||
|
|
Date: Tue, 19 Dec 2023 07:58:21 +0100
|
||
|
|
Subject: [PATCH] vfio/container: Intoduce a new VFIOIOMMUClass::setup handler
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
This will help in converting the sPAPR IOMMU backend to a QOM interface.
|
||
|
|
|
||
|
|
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
|
||
|
|
Tested-by: Eric Farman <farman@linux.ibm.com>
|
||
|
|
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||
|
|
---
|
||
|
|
hw/vfio/container.c | 1 +
|
||
|
|
include/hw/vfio/vfio-container-base.h | 1 +
|
||
|
|
2 files changed, 2 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
|
||
|
|
index 6b8de8f471..845239eff4 100644
|
||
|
|
--- a/hw/vfio/container.c
|
||
|
|
+++ b/hw/vfio/container.c
|
||
|
|
@@ -1248,6 +1248,7 @@ static void vfio_iommu_legacy_class_init(ObjectClass *klass, void *data)
|
||
|
|
{
|
||
|
|
VFIOIOMMUClass *vioc = VFIO_IOMMU_CLASS(klass);
|
||
|
|
|
||
|
|
+ vioc->setup = vfio_legacy_setup;
|
||
|
|
vioc->dma_map = vfio_legacy_dma_map;
|
||
|
|
vioc->dma_unmap = vfio_legacy_dma_unmap;
|
||
|
|
vioc->attach_device = vfio_legacy_attach_device;
|
||
|
|
diff --git a/include/hw/vfio/vfio-container-base.h b/include/hw/vfio/vfio-container-base.h
|
||
|
|
index dce801378b..614de90767 100644
|
||
|
|
--- a/include/hw/vfio/vfio-container-base.h
|
||
|
|
+++ b/include/hw/vfio/vfio-container-base.h
|
||
|
|
@@ -109,6 +109,7 @@ struct VFIOIOMMUClass {
|
||
|
|
InterfaceClass parent_class;
|
||
|
|
|
||
|
|
/* basic feature */
|
||
|
|
+ int (*setup)(VFIOContainerBase *bcontainer, Error **errp);
|
||
|
|
int (*dma_map)(const VFIOContainerBase *bcontainer,
|
||
|
|
hwaddr iova, ram_addr_t size,
|
||
|
|
void *vaddr, bool readonly);
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|