libvfio-user icon indicating copy to clipboard operation
libvfio-user copied to clipboard

adapt to new (v2) VFIO migration interface

Open jlevon opened this issue 2 years ago • 8 comments

Alex Williamson says:

+The only device-specific region type and subtype supported by vfio-user is +VFIO_REGION_TYPE_MIGRATION (3) and VFIO_REGION_SUBTYPE_MIGRATION (1).

These should be considered deprecated from the kernel interface. I hope there are plans for vfio-user to adopt the new interface that's currently available in linux-next and intended for v5.18.

Which is this:

commit b042b27868c00142da1a7e31f4740a5fbd5628ed
Merge: cfb92440ee71 88faa5e8ead6
Author: Alex Williamson <[email protected]>
Date:   Thu Mar 3 09:51:03 2022 -0700

    Merge tag 'mlx5-vfio-v10' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux into v5.18/vfio/next/mlx5-migration-v10

    Add mlx5 live migration driver and v2 migration protocol

Need to investigate and possibly adopt these changes.

jlevon avatar Mar 10 '22 10:03 jlevon

Main email thread: https://lore.kernel.org/all/[email protected]/ email where v2 is added: https://lore.kernel.org/all/[email protected]/ Support for v2 in QEMU: https://github.com/jgunthorpe/qemu/commits/vfio_migration_v2 spec in the kernel: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=115dcec65f61d53e25e1bed5e380468b30f98b14 (currently in linux-next but soon in v5.18)

tmakatos avatar Mar 10 '22 11:03 tmakatos

Looks like the mmaped migration region isn't supported with the new interface.

changpe1 avatar Mar 14 '22 02:03 changpe1

I've started adopting the new API here: https://github.com/tmakatos/muser/tree/migration-v2

Next, I'll start implementing Python tests.

tmakatos avatar Apr 01 '22 21:04 tmakatos

@tmakatos @jlevon I wonder do you have an estimated timeline for adding the v2 migration support to upstream libvfio-user?

likebreath avatar Sep 13 '22 17:09 likebreath

@likebreath sorry, we don't right now, but we'd be very happy if somebody wanted to make some proposals :)

jlevon avatar Sep 15 '22 09:09 jlevon

@jlevon Thank you for the quick response. I would love to help and contribute.

I know @tmakatos had a WIP branch for this work: https://github.com/tmakatos/muser/tree/migration-v2. Is this the right place to pick-up the work? Also, can you please provide me a summary about what are the missing bits? Thank you.

likebreath avatar Sep 20 '22 15:09 likebreath

I know @tmakatos had a WIP branch for this work: https://github.com/tmakatos/muser/tree/migration-v2. Is this the right place to pick-up the work?

Yes, this is the right branch, specifically this commit: https://github.com/tmakatos/muser/commit/059aa82ff813221e4f42624dcb2b32c001a726af

Also, can you please provide me a summary about what are the missing bits?

Unfortunately it's been so long that I forgot the details, I would have to start from the beginning (re-read the kernel API, re-read my patch etc.). Could you try to see whether the commit makes sense and if not I can see how I could help?

tmakatos avatar Sep 21 '22 09:09 tmakatos

Yes, this is the right branch, specifically this commit: tmakatos@059aa82

Could you try to see whether the commit makes sense and if not I can see how I could help?

Sure. I will let you know when I need your inputs. I will also keep you posted when I have a timeline for this work.

likebreath avatar Sep 22 '22 18:09 likebreath