Hello, Following VFIO migration protocol v2 acceptance in kernel, this series implements VFIO migration according to the new v2 protocol and replaces the now deprecated v1 implementation.
The main differences between v1 and v2 migration protocols are: 1. VFIO device state is represented as a finite state machine instead of a bitmap. 2. The migration interface with kernel is done using VFIO_DEVICE_FEATURE ioctl and normal read() and write() instead of the migration region used in v1. 3. Migration protocol v2 currently doesn't support the pre-copy phase of migration. Full description of the v2 protocol and the differences from v1 can be found here [1]. Patches 1-5 are prep patches importing the new uAPI headers, fixing bugs and adding QEMUFile function that will be used later. Patches 6-9 are the main patches that replace the v1 implementation with v2. Thanks. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Avihai Horon (9): linux-headers: Update headers to v5.18-rc6 vfio: Fix compilation errors caused by VFIO migration v1 deprecation vfio/migration: Fix NULL pointer dereference bug vfio/migration: Skip pre-copy if dirty page tracking is not supported migration/qemu-file: Add qemu_file_get_to_fd() vfio/migration: Implement VFIO migration protocol v2 vfio/migration: Reset device if setting recover state fails vfio: Alphabetize migration section of VFIO trace-events file docs/devel: Align vfio-migration docs to VFIO migration v2 docs/devel/vfio-migration.rst | 77 +-- hw/vfio/common.c | 21 +- hw/vfio/migration.c | 640 ++++-------------- hw/vfio/trace-events | 25 +- include/hw/vfio/vfio-common.h | 8 +- .../linux/input-event-codes.h | 25 +- .../standard-headers/linux/virtio_config.h | 6 + .../standard-headers/linux/virtio_crypto.h | 82 ++- linux-headers/asm-arm64/kvm.h | 16 + linux-headers/asm-generic/mman-common.h | 2 + linux-headers/asm-mips/mman.h | 2 + linux-headers/linux/kvm.h | 27 +- linux-headers/linux/psci.h | 4 + linux-headers/linux/userfaultfd.h | 8 +- linux-headers/linux/vfio.h | 406 ++++++----- linux-headers/linux/vhost.h | 7 + migration/migration.c | 5 + migration/migration.h | 3 + migration/qemu-file.c | 34 + migration/qemu-file.h | 1 + 20 files changed, 618 insertions(+), 781 deletions(-) -- 2.21.3