[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/10] vfio/migration: Don't block migration device dirty trac
From: |
Joao Martins |
Subject: |
[PATCH v3 09/10] vfio/migration: Don't block migration device dirty tracking is unsupported |
Date: |
Mon, 8 Jul 2024 15:34:19 +0100 |
By default VFIO migration is set to auto, which will support live
migration if the migration capability is set *and* also dirty page
tracking is supported.
For testing purposes one can force enable without dirty page tracking
via enable-migration=on, but that option is generally left for testing
purposes.
So starting with IOMMU dirty tracking it can use to acomodate the lack of
VF dirty page tracking allowing us to minimize the VF requirements for
migration and thus enabling migration by default for those.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
hw/vfio/migration.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 34d4be2ce1b1..89195928666f 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -1012,6 +1012,7 @@ void vfio_reset_bytes_transferred(void)
*/
bool vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
{
+ HostIOMMUDeviceClass *hiodc = HOST_IOMMU_DEVICE_GET_CLASS(vbasedev->hiod);
Error *err = NULL;
int ret;
@@ -1036,7 +1037,10 @@ bool vfio_migration_realize(VFIODevice *vbasedev, Error
**errp)
return !vfio_block_migration(vbasedev, err, errp);
}
- if (!vbasedev->dirty_pages_supported) {
+ if (!vbasedev->dirty_pages_supported &&
+ (vbasedev->iommufd &&
+ !hiodc->get_cap(vbasedev->hiod,
+ HOST_IOMMU_DEVICE_CAP_DIRTY_TRACKING, NULL))) {
if (vbasedev->enable_migration == ON_OFF_AUTO_AUTO) {
error_setg(&err,
"%s: VFIO device doesn't support device dirty tracking",
--
2.17.2
- Re: [PATCH v3 05/10] vfio/iommufd: Probe and request hwpt dirty tracking capability, (continued)
[PATCH v3 06/10] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support, Joao Martins, 2024/07/08
[PATCH v3 07/10] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support, Joao Martins, 2024/07/08
[PATCH v3 09/10] vfio/migration: Don't block migration device dirty tracking is unsupported,
Joao Martins <=
[PATCH v3 10/10] vfio/common: Allow disabling device dirty page tracking, Joao Martins, 2024/07/08
[PATCH v3 08/10] vfio/iommufd: Parse hw_caps and store dirty tracking support, Joao Martins, 2024/07/08
Re: [PATCH v3 00/10] hw/vfio: IOMMUFD Dirty Tracking, Cédric Le Goater, 2024/07/11