Skip to content

RFC vfio/hisilicon: add acc live migration driver

Longfang Liu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3vfio/hisilicon: add acc live migration driverdrivers/vfio/pci/Kconfig drivers/vfio/pci/Makefile drivers/vfio/pci/hisilicon/acc_vf_migration.c +1 more+1321 -00 replies
2/3vfio/hisilicon: register the driver to vfiodrivers/vfio/pci/vfio_pci.c drivers/vfio/pci/vfio_pci_private.h+20 -027 replies
3/3vfio/hisilicom: add debugfs for driverdrivers/vfio/pci/hisilicon/acc_vf_migration.c drivers/vfio/pci/hisilicon/acc_vf_migration.h+195 -00 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/hisilicon: add acc live migration driver

The live migration solution relies on the vfio_device_migration_info protocol. The structure vfio_device_migration_info is placed at the 0th offset of the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related migration information. Field accesses from this structure are only supported at their native width and alignment. Otherwise, the result is undefined and vendor drivers should return an error.

(1).The driver framework is based on vfio_pci_register_dev_region() of vfio-pci, and then a new live migration region is added, and the live migration is realized through the ops of this region.

(2).In order to ensure the compatibility of the devices before and after the migration, the device compatibility information check will be performed in the Pre-copy stage. If the check fails, an error will be returned and the source VM will exit the migration function.

(3).After the compatibility check is passed, it will enter the Stop-and-copy stage. At this time, all the live migration data will be copied, and then saved to the VF device of the destination, and then the VF device of the destination will be started and the VM of the source will be exited.

Longfang Liu (3):
vfio/hisilicon: add acc live migration driver
vfio/hisilicon: register the driver to vfio
vfio/hisilicom: add debugfs for driver

 drivers/vfio/pci/Kconfig                      |    8 +
 drivers/vfio/pci/Makefile                     |    1 +
 drivers/vfio/pci/hisilicon/acc_vf_migration.c | 1337 +++++++++++++++++++++++++
 drivers/vfio/pci/hisilicon/acc_vf_migration.h |  170 ++++
 drivers/vfio/pci/vfio_pci.c                   |   11 +
 drivers/vfio/pci/vfio_pci_private.h           |    9 +
 6 files changed, 1536 insertions(+)
 create mode 100644 drivers/vfio/pci/hisilicon/acc_vf_migration.c
 create mode 100644 drivers/vfio/pci/hisilicon/acc_vf_migration.h
Signature · 1 line
2.8.1