Skip to content

RFC vfio/migration: Support manual clear vfio dirty log

Kunkun Jiang qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 1 replyIn review

v1 -> v2 from the cover letter

- Add a new ioctl VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP_NOCLEAR to get vfio dirty log when support manual clear.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3linux-headers: update against 5.12 and "manual clear vfio dirty log" serieslinux-headers/linux/vfio.h+60 -10 replies
2/3vfio: Maintain DMA mapping range for the containerhw/vfio/common.c include/hw/vfio/vfio-common.h+65 -60 replies
3/3vfio/migration: Add support for manual clear vfio dirty loghw/vfio/common.c include/hw/vfio/vfio-common.h+148 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] vfio/migration: Support manual clear vfio dirty log

In the past, we clear dirty log immediately after sync dirty log to userspace. This may cause redundant dirty handling if userspace handles dirty log iteratively:

After vfio clears dirty log, new dirty log starts to generate. These new dirty log will be reported to userspace even if they are generated before userspace handles the same dirty page.

Since a new dirty log tracking method for vfio based on iommu hwdbm[1] has been introduced in the kernel and added a new capability named VFIO_DIRTY_LOG_MANUAL_CLEAR, we can eliminate some redundant dirty handling by supporting it.

This series include patches as below:
Patch 1:
- updated the linux-headers/linux/vfio.h from kernel side

Patch 2:
- introduced 'struct VFIODMARange' to describe a range of the given DMA mapping and with respect to a VFIO_IOMMU_MAP_DMA operation

Patch 3:
- implemented the operation to manual clear vfio dirty log, which can eliminate some redundant dirty handling

History:
v1 -> v2:
- Add a new ioctl VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP_NOCLEAR to get vfio dirty log when support manual clear.

Thanks,
Kunkun Jiang

[1]
IOMMU part: https://lore.kernel.org/linux-iommu/[email protected]/
VFIO part: https://lore.kernel.org/kvm/[email protected]/

Zenghui Yu (3):
linux-headers: update against 5.12 and "manual clear vfio dirty log"
series
vfio: Maintain DMA mapping range for the container vfio/migration: Add support for manual clear vfio dirty log

 hw/vfio/common.c              | 211 ++++++++++++++++++++++++++++++++--
 include/hw/vfio/vfio-common.h |  10 ++
 linux-headers/linux/vfio.h    |  61 +++++++++-
 3 files changed, 273 insertions(+), 9 deletions(-)
Signature · 1 line
2.23.0