[Intel-gfx][RFC V2 0/7] drm/i915/gvt: Add the live migration support to VFIO mdev deivce - Intel vGPU

Yulei Zhang yulei.zhang at intel.com
Mon Jul 31 07:18:17 UTC 2017


This series RFC patches give a sample about how to enable the live migration
on vfio mdev deivce with the new introduced vfio interface and vfio device
status region.

In order to fulfill the migration requirement we add the following
modifications to the mdev device driver.
1. Add the guest to host graphics address adjustment when guest 
   try to access gma through mmio or graphics commands, so after 
   migraiton the guest view of graphics address will remain the same.
2. Implement the function to save/retore the device context, which 
   is accessed through VFIO new subregion to transfer device status
   during the migration.

V1->V2:
1. replace the original fixed vfio region with igd subtype region for
   device status save and restore.
2. the first byte of the new igd subtype region is used for device running
   state control.

Yulei Zhang (7):
  drm/i915/gvt: Apply g2h adjust for GTT mmio access
  drm/i915/gvt: Apply g2h adjustment during fence mmio access
  drm/i915/gvt: Adjust the gma parameter in gpu commands during command
    parser
  drm/i915/gvt: Retrieve the guest gm base address from PVINFO
  drm/i915/gvt: Align the guest gm aperture start offset for live
    migration
  drm/i915/gvt: Add support to new VFIO subregion
    VFIO_REGION_SUBTYPE_INTEL_IGD_DEVICE_STATE
  drm/i915/gvt: Implement vGPU status save and restore through     new
    VFIO subregion VFIO_REGION_SUBTYPE_INTEL_IGD_DEVICE_STATE

 drivers/gpu/drm/i915/gvt/Makefile      |   2 +-
 drivers/gpu/drm/i915/gvt/aperture_gm.c |   6 +-
 drivers/gpu/drm/i915/gvt/cfg_space.c   |   3 +-
 drivers/gpu/drm/i915/gvt/cmd_parser.c  |  26 +-
 drivers/gpu/drm/i915/gvt/gtt.c         |  19 +-
 drivers/gpu/drm/i915/gvt/gvt.c         |   1 +
 drivers/gpu/drm/i915/gvt/gvt.h         |  41 +-
 drivers/gpu/drm/i915/gvt/kvmgt.c       | 144 +++++-
 drivers/gpu/drm/i915/gvt/migrate.c     | 784 +++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/gvt/migrate.h     |  88 ++++
 drivers/gpu/drm/i915/gvt/mmio.c        |  13 +
 drivers/gpu/drm/i915/gvt/mmio.h        |   1 +
 drivers/gpu/drm/i915/gvt/vgpu.c        |   8 +-
 include/uapi/linux/vfio.h              |  12 +-
 14 files changed, 1111 insertions(+), 37 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gvt/migrate.c
 create mode 100644 drivers/gpu/drm/i915/gvt/migrate.h

-- 
2.7.4



More information about the intel-gvt-dev mailing list