Skip to content

migration: Drop/unexport migration_is_device() and migration_is_active()

Avihai Horon qemu-devel 2 versions – Applied

Status from this message: Applied to vfio-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 9 repliesApplied
  2. v19 patches 32 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7vfio/container: Add dirty tracking started flaghw/vfio/container-base.c include/hw/vfio/vfio-container-base.h+12 -10 replies
2/7vfio/migration: Refactor vfio_devices_all_dirty_tracking() logichw/vfio/common.c include/hw/vfio/vfio-common.h+17 -21 reply
3/7vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logichw/vfio/common.c hw/vfio/container.c include/hw/vfio/vfio-common.h+11 -351 reply
4/7vfio/migration: Rename vfio_devices_all_dirty_tracking()hw/vfio/common.c+2 -20 replies
5/7system/dirtylimit: Don't use migration_is_active()system/dirtylimit.c+1 -20 replies
6/7migration: Drop migration_is_device()include/migration/misc.h migration/migration.c+0 -80 replies
7/7migration: Unexport migration_is_active()include/migration/misc.h migration/migration.c+8 -90 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchJoao MartinsCédric Le GoaterPeter XuHyman Huang
SeriesT-b
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b A-b
7/7R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/7] migration: Drop/unexport migration_is_device() and migration_is_active()

Hello,

This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function.

Peter's series tried to drop migration_is_device() and migration_is_active(), however VFIO used them to check if dirty page tracking has been started in order to avoid errors in log sync, so they couldn't simply be dropped without some preliminary cleanups.

This series handles these preliminary cleanups and eventually drops migration_is_device() and unexports migration_is_active().

The series has been migration tested with the following:
- VFIO device dirty tracking.
- Legacy VFIO iommu dirty tracking.
- vIOMMU + Legacy VFIO iommu dirty tracking (migration with vIOMMU is currently blocked, so I used a patched QEMU to allow it).

I also tested calc-dirty-rate as now VFIO dirty pages should be included in its report, and indeed they are.

I didn't test it with iommu DPT as I don't have access to such HW. It would be great if someone with the proper HW could test it.

Patch structure:
1-4: Refactor and clean up VFIO dirty page tracking helpers. 5: Refactor dirty limit code.
6-7: Drop/unexport migration_is_device() and migration_is_running().

Changes from v1 [2]:
* Bail out early in vfio_container_set_dirty_page_tracking() if dirty tracking has already been started/stopped. (Joao)
* Untied the dirty tracking helpers from migration (i.e., removed migration_is_running() check) so VFIO dirty pages will be included in calc-dirty-rate. (Joao)
* Added comment to VFIODevice->dirty_tracking that states it's protected by BQL.
* Added R-b/A-b tags.

Thanks.

[1]
https://lore.kernel.org/qemu-devel/[email protected]/

[2]
https://lore.kernel.org/qemu-devel/[email protected]/

Avihai Horon (7):
vfio/container: Add dirty tracking started flag vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic vfio/migration: Refactor vfio_devices_all_running_and_mig_active()
logic
vfio/migration: Rename vfio_devices_all_dirty_tracking() system/dirtylimit: Don't use migration_is_active()
migration: Drop migration_is_device()
migration: Unexport migration_is_active()

 include/hw/vfio/vfio-common.h         |  6 +--
 include/hw/vfio/vfio-container-base.h |  1 +
 include/migration/misc.h              |  2 -
 hw/vfio/common.c                      | 57 +++++++++++----------------
 hw/vfio/container-base.c              | 12 +++++-
 hw/vfio/container.c                   |  2 +-
 migration/migration.c                 | 23 ++++-------
 system/dirtylimit.c                   |  3 +-
 8 files changed, 49 insertions(+), 57 deletions(-)
Signature · 1 line
2.40.1