Skip to content

vfio/mtty: Add migration support

Alex Williamson kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

Incorporate comments from Cédric
- Fixing eventfd leak turned into SET_IRQS overhaul
- Factored out mtty_data_size()
- Factored mtty_save_state() and paired with mtty_load_state()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vfio/mtty: Overhaul mtty interrupt handlingsamples/vfio-mdev/mtty.c+166 -731 reply
2/2vfio/mtty: Enable migration supportsamples/vfio-mdev/mtty.c+590 -01 reply

Reviews trailers per patch

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

PatchCédric Le Goater
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] vfio/mtty: Add migration support

We've seen a request for CI and development to have access to migratable vfio devices without any specific hardware requirements. One way to do that is to enable migration support on the mtty mdev sample driver, as done here.

This device is particularly easy to migrate because it doesn't actually do DMA, or in fact much of anything. Therefore we can claim P2P and dirty logging as well. PRE_COPY support is also included in a similar fashion to hisi_acc. This provides early compatibility testing, which is probably over-done, but perhaps illustrates good practice with matching data stream magic, versioning, and feature flags. These might later be used for backwards compatibility, particularly since I'm not positive that copying the struct serial_port between source and destination is sufficient.

Along the way, testing migration where the source and target are incompatible revealed an eventfd leak, where peeling back the onion of mtty handling of SET_IRQS proved to require a substantial overhaul.

v2:
Incorporate comments from Cédric
- Fixing eventfd leak turned into SET_IRQS overhaul
- Factored out mtty_data_size()
- Factored mtty_save_state() and paired with mtty_load_state()

Alex Williamson (2):
vfio/mtty: Overhaul mtty interrupt handling
vfio/mtty: Enable migration support

 samples/vfio-mdev/mtty.c | 829 +++++++++++++++++++++++++++++++++++----
 1 file changed, 756 insertions(+), 73 deletions(-)
Signature · 1 line
2.40.1