Skip to content

RFC Qemu: Add live migration support for SRIOV NIC

Lan Tianyu kvm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest posting 2/210 patches 60 repliesIn review
  2. v2 RFC posting 1/23 patches 36 repliesSuperseded
  3. v1 RFC3 patches 2 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10Qemu/VFIO: Create head file pci.h to share data struct.hw/vfio/pci.c hw/vfio/pci.h+159 -1360 replies
2/10Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definitionlinux-headers/linux/vfio.h+16 -03 replies
3/10Qemu/VFIO: Rework vfio_std_cap_max_size() functionhw/vfio/pci.c+12 -100 replies
4/10Qemu/VFIO: Add vfio_find_free_cfg_reg() to find free PCI config space regshw/vfio/pci.c hw/vfio/pci.h+21 -00 replies
5/10Qemu/VFIO: Expose PCI config space read/write and msix functionshw/vfio/pci.c hw/vfio/pci.h+7 -30 replies
6/10Qemu/PCI: Add macros for faked PCI migration capabilityinclude/hw/pci/pci_regs.h+19 -02 replies
7/10Qemu: Add post_load_state() to run after restoring CPU stateinclude/migration/vmstate.h migration/savevm.c+17 -00 replies
8/10Qemu: Add save_before_stop callback to run just before stopping VCPU during migrationinclude/migration/vmstate.h include/sysemu/sysemu.h migration/migration.c +1 more+19 -10 replies
9/10Qemu/VFIO: Add SRIOV VF migration supporthw/vfio/Makefile.objs hw/vfio/pci.c hw/vfio/pci.h +1 more+189 -15 replies
10/10Qemu/VFIO: Misc change for enable migration with VFIOhw/vfio/pci.c+0 -60 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

This patchset is to propose a solution of adding live migration support for SRIOV NIC.

During migration, Qemu needs to let VF driver in the VM to know migration start and end. Qemu adds faked PCI migration capability to help to sync status between two sides during migration.

Qemu triggers VF's mailbox irq via sending MSIX msg when migration status is changed. VF driver tells Qemu its mailbox vector index via the new PCI capability. In some cases(NIC is suspended or closed), VF mailbox irq is freed and VF driver can disable irq injecting via new capability.

VF driver will put down nic before migration and put up again on the target machine.

Lan Tianyu (10):
Qemu/VFIO: Create head file pci.h to share data struct. Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition Qemu/VFIO: Rework vfio_std_cap_max_size() function Qemu/VFIO: Add vfio_find_free_cfg_reg() to find free PCI config space
regs
Qemu/VFIO: Expose PCI config space read/write and msix functions Qemu/PCI: Add macros for faked PCI migration capability
Qemu: Add post_load_state() to run after restoring CPU state
Qemu: Add save_before_stop callback to run just before stopping VCPU
during migration
Qemu/VFIO: Add SRIOV VF migration support
Qemu/VFIO: Misc change for enable migration with VFIO

 hw/vfio/Makefile.objs       |   2 +-
 hw/vfio/pci.c               | 196 +++++++++-----------------------------------
 hw/vfio/pci.h               | 168 +++++++++++++++++++++++++++++++++++++
 hw/vfio/sriov.c             | 178 ++++++++++++++++++++++++++++++++++++++++
 include/hw/pci/pci_regs.h   |  19 +++++
 include/migration/vmstate.h |   5 ++
 include/sysemu/sysemu.h     |   1 +
 linux-headers/linux/vfio.h  |  16 ++++
 migration/migration.c       |   3 +-
 migration/savevm.c          |  28 +++++++
 10 files changed, 459 insertions(+), 157 deletions(-)
 create mode 100644 hw/vfio/pci.h
 create mode 100644 hw/vfio/sriov.c
Signature · 1 line
1.9.3