[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 29/41] vfio/iommufd: Relax assert check for iommufd backend
|
From: |
Zhenzhong Duan |
|
Subject: |
[PATCH v4 29/41] vfio/iommufd: Relax assert check for iommufd backend |
|
Date: |
Thu, 2 Nov 2023 15:12:50 +0800 |
Currently iommufd doesn't support dirty page sync yet,
but it will not block us doing live migration if VFIO
migration is force enabled.
So in this case we allow set_dirty_page_tracking to be NULL.
Note we don't need same change for query_dirty_bitmap because
when dirty page sync isn't supported, query_dirty_bitmap will
never be called.
Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/vfio/container-base.c | 4 ++++
hw/vfio/container.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c
index 71f7274973..eee2dcfe76 100644
--- a/hw/vfio/container-base.c
+++ b/hw/vfio/container-base.c
@@ -55,6 +55,10 @@ void vfio_container_del_section_window(VFIOContainerBase
*bcontainer,
int vfio_container_set_dirty_page_tracking(VFIOContainerBase *bcontainer,
bool start)
{
+ if (!bcontainer->dirty_pages_supported) {
+ return 0;
+ }
+
g_assert(bcontainer->ops->set_dirty_page_tracking);
return bcontainer->ops->set_dirty_page_tracking(bcontainer, start);
}
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index 6bacf38222..ed2d721b2b 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -216,10 +216,6 @@ static int
vfio_legacy_set_dirty_page_tracking(VFIOContainerBase *bcontainer,
.argsz = sizeof(dirty),
};
- if (!bcontainer->dirty_pages_supported) {
- return 0;
- }
-
if (start) {
dirty.flags = VFIO_IOMMU_DIRTY_PAGES_FLAG_START;
} else {
--
2.34.1
- Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend, (continued)
[PATCH v4 31/41] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info, Zhenzhong Duan, 2023/11/02
[PATCH v4 32/41] vfio/pci: Introduce a vfio pci hot reset interface, Zhenzhong Duan, 2023/11/02
[PATCH v4 30/41] vfio/iommufd: Add support for iova_ranges, Zhenzhong Duan, 2023/11/02
[PATCH v4 29/41] vfio/iommufd: Relax assert check for iommufd backend,
Zhenzhong Duan <=
[PATCH v4 33/41] vfio/iommufd: Enable pci hot reset through iommufd cdev interface, Zhenzhong Duan, 2023/11/02
[PATCH v4 34/41] vfio/pci: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/11/02
[PATCH v4 35/41] vfio/pci: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/02
[PATCH v4 37/41] vfio/platform: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/02
[PATCH v4 36/41] vfio: Allow the selection of a given iommu backend for platform ap and ccw, Zhenzhong Duan, 2023/11/02
[PATCH v4 38/41] vfio/ap: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/02
[PATCH v4 39/41] vfio/ccw: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/11/02