[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/47] vfio/iommufd: Relax assert check for iommufd backend
From: |
Cédric Le Goater |
Subject: |
[PULL 24/47] vfio/iommufd: Relax assert check for iommufd backend |
Date: |
Tue, 19 Dec 2023 19:56:20 +0100 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
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>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.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
71f727497314b06185fd0201d1472b83aafda703..eee2dcfe760b5530ef428fe341d376a85b47344a
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
6bacf38222ad9d95e05897572995e925e46b54dc..ed2d721b2bc6d175ecd3fb9498cbdc0d7ba6769d
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.43.0
- [PULL 13/47] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container, (continued)
- [PULL 13/47] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container, Cédric Le Goater, 2023/12/19
- [PULL 14/47] vfio/container: Move iova_ranges to base container, Cédric Le Goater, 2023/12/19
- [PULL 16/47] vfio/spapr: Introduce spapr backend and target interface, Cédric Le Goater, 2023/12/19
- [PULL 17/47] vfio/spapr: switch to spapr IOMMU BE add/del_section_window, Cédric Le Goater, 2023/12/19
- [PULL 18/47] vfio/spapr: Move prereg_listener into spapr container, Cédric Le Goater, 2023/12/19
- [PULL 15/47] vfio/container: Implement attach/detach_device, Cédric Le Goater, 2023/12/19
- [PULL 19/47] vfio/spapr: Move hostwin_list into spapr container, Cédric Le Goater, 2023/12/19
- [PULL 21/47] util/char_dev: Add open_cdev(), Cédric Le Goater, 2023/12/19
- [PULL 20/47] backends/iommufd: Introduce the iommufd object, Cédric Le Goater, 2023/12/19
- [PULL 22/47] vfio/common: return early if space isn't empty, Cédric Le Goater, 2023/12/19
- [PULL 24/47] vfio/iommufd: Relax assert check for iommufd backend,
Cédric Le Goater <=
- [PULL 23/47] vfio/iommufd: Implement the iommufd backend, Cédric Le Goater, 2023/12/19
- [PULL 26/47] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info, Cédric Le Goater, 2023/12/19
- [PULL 25/47] vfio/iommufd: Add support for iova_ranges and pgsizes, Cédric Le Goater, 2023/12/19
- [PULL 31/47] vfio/platform: Allow the selection of a given iommu backend, Cédric Le Goater, 2023/12/19
- [PULL 28/47] vfio/iommufd: Enable pci hot reset through iommufd cdev interface, Cédric Le Goater, 2023/12/19
- [PULL 30/47] vfio/pci: Make vfio cdev pre-openable by passing a file handle, Cédric Le Goater, 2023/12/19
- [PULL 33/47] vfio/ap: Allow the selection of a given iommu backend, Cédric Le Goater, 2023/12/19
- [PULL 37/47] vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks, Cédric Le Goater, 2023/12/19
- [PULL 36/47] vfio/ccw: Make vfio cdev pre-openable by passing a file handle, Cédric Le Goater, 2023/12/19
- [PULL 27/47] vfio/pci: Introduce a vfio pci hot reset interface, Cédric Le Goater, 2023/12/19