lback
use status set ioctl to start the mdev
device to put it in running status
|
V
finish migration
Yulei Zhang (5):
vfio: introduce a new VFIO region for migration support
New VFIO region VFIO_PCI_DEVICE_STATE_REGION_INDEX is added to fetch
and restore the pci device status during the live migration.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 17 +
hw/vfio/pci.h | 1 +
linux-headers/linux/vfio.h | 5 -
3 files
Introduce vfio_device_put/vfio_device_get funtion for vfio device state
save/restore usage. And vfio device unmigratable flag will be set to false
during initialization if device flag VFIO_DEVICE_FLAGS_MIGRATABLE is set.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 35
New VFIO ioctl VFIO_DEVICE_PCI_STATUS_SET is added to change the
vfio pci device status during the migration, stop the device on
the source side before fetch its status and start the deivce on
the target side after restore its status.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c
restore
the same states
1. re-setup the pci bar configuration
2. re-setup the pci device msi configuration
3. restore the pci device status
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 105 +-
1 file changed, 104 insertions(+), 1 deletion
New VFIO ioctl VFIO_DEVICE_PCI_GET_DIRTY_BITMAP is used to sync the
pci device dirty pages during the migration.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 32
hw/vfio/pci.h | 2 ++
linux-headers/linux/vfio.h | 14 ++
3
Apply the guest to host gma conversion while guest config the
fence mmio registers due to the host gma change after the migration.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/aperture_gm.c | 6 --
drivers/gpu/drm/i915/gvt/gvt.h | 14 ++
2 files changed, 18
Add new vfio ioctl VFIO_DEVICE_PCI_GET_DIRTY_BITMAP to fetch the dirty
page bitmap from mdev device driver for data sync during live migration.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/kvmgt.c | 33 +
include/uapi/linux/vfio.h| 14
Apply guest to host gma conversion while guest try to access the
GTT mmio registers, as after enable live migration the host gma
will be changed due to the resourece re-allocation, but guest
gma should be remaining unchanged, thus g2h conversion is request
for it.
Signed-off-by: Yulei Zhang
New device flag VFIO_DEVICE_FLAGS_MIGRATABLE is added for vfio mdev
device vGPU to claim the capability for live migration.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/kvmgt.c | 1 +
include/uapi/linux/vfio.h| 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu
.
3. Implement the function to save/retore the device context, which
is accessed through VFIO new region VFIO_PCI_DEVICE_STATE_REGION_INDEX
to transfer device status during the migration.
Yulei Zhang (9):
drm/i915/gvt: Apply g2h adjust for GTT mmio access
drm/i915/gvt: Apply g2h
As after migration the host gm base address will be changed due
to resource re-allocation, in order to make sure the guest gm
address doesn't change with that to retrieve the guest gm base
address from PVINFO.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/cfg_space.c | 3 ++-
dr
Adjust the gma parameter in gpu commands according to the shift
offset in guests' aperture and hidden gm address, and patch
the commands before submit to execute.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/cmd_parser.c | 26 ++
1 file changed, 18 inser
Add new VFIO region VFIO_PCI_DEVICE_STATE_REGION_INDEX support in vGPU, through
this new region it can fetch the status from mdev device for migration, on
the target side it can retrieve the device status and reconfigure the device to
continue running after resume the guest.
Signed-off-by: Yulei
As guest gm aperture region start offset is initialized when vGPU created,
in order to make sure that start offset is remain the same after migration,
align the aperture start offset to 0 for guest.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/kvmgt.c | 3 +--
drivers/gpu/drm/i915
Add handling for new VFIO ioctl VFIO_DEVICE_PCI_STATUS_SET to control
the status of mdev device vGPU. vGPU will stop/start rendering according
to the command comes along with the ioctl.
Signed-off-by: Yulei Zhang
---
drivers/gpu/drm/i915/gvt/kvmgt.c | 9 +
drivers/gpu/drm/i915/gvt
New VFIO sub region VFIO_REGION_SUBTYPE_INTEL_IGD_DEVICE_STATE is added
to fetch and restore the status of mdev device vGPU during the live migration.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 13 -
hw/vfio/pci.h | 1 +
linux-headers/linux/vfio.h | 7
fixed region.
2. remove unnecessary ioctl, use the first byte of subregion to
control the running state of mdev device.
3. for dirty page synchronization, implement the interface with
VFIOContainer instead of vfio pci device.
Yulei Zhang (4):
vfio: introduce a new VFIO sub region fo
device status fetch from device driver
And on the target side with funtion vfio_device_get to restore
the same states
1. re-setup the pci bar configuration
2. re-setup the pci device msi configuration
3. restore the pci device status
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 132
New VFIO ioctl VFIO_IOMMU_GET_DIRTY_BITMAP is used to fetch the
bitmap of pinned memory in iommu container, we need copy those
memory to the target during the migration as they are dirtied by
mdev devices.
Signed-off-by: Yulei Zhang
---
hw/vfio/common.c | 32
-by: Yulei Zhang
---
hw/vfio/pci.c | 19 +++
include/hw/vfio/vfio-common.h | 1 +
linux-headers/linux/vfio.h| 3 +++
3 files changed, 23 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 21a5cef..753da80 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio
New VFIO sub region VFIO_REGION_SUBTYPE_DEVICE_STATE is added
to fetch and restore the status of mdev device vGPU during the
live migration.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 25 -
hw/vfio/pci.h | 2 ++
linux-headers/linux/vfio.h
VFIO PCI fixed region.
2. remove unnecessary ioctl, use the first byte of subregion to
control the running state of mdev device.
3. for dirty page synchronization, implement the interface with
VFIOContainer instead of vfio pci device.
Yulei Zhang (4):
vfio: introduce a new VFIO subregion f
bar configuration
2. re-setup the pci device msi configuration
3. restore the pci device status
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 195 +++--
linux-headers/linux/vfio.h | 14
2 files changed, 204 insertions(+), 5 deletions
-by: Yulei Zhang
---
hw/vfio/pci.c | 20
include/hw/vfio/vfio-common.h | 1 +
linux-headers/linux/vfio.h| 6 ++
roms/seabios | 2 +-
4 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index
New VFIO ioctl VFIO_IOMMU_GET_DIRTY_BITMAP is used to fetch the
bitmap of pinned memory in iommu container, we need copy those
memory to the target during the migration as they are dirtied by
mdev devices.
Signed-off-by: Yulei Zhang
---
hw/vfio/common.c | 34
New VFIO sub region VFIO_REGION_SUBTYPE_DEVICE_STATE is added
to fetch and restore the status of mdev device vGPU during the
live migration.
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 14 +-
hw/vfio/pci.h | 1 +
linux-headers/linux/vfio.h | 9
;s suggestion:
1. use device subtype region instead of VFIO PCI fixed region.
2. remove unnecessary ioctl, use the first byte of subregion to
control the running state of mdev device.
3. for dirty page synchronization, implement the interface with
VFIOContainer instead of vfio pci device.
Yu
-by: Yulei Zhang
---
hw/vfio/pci.c | 20
include/hw/vfio/vfio-common.h | 1 +
linux-headers/linux/vfio.h| 3 +++
3 files changed, 24 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2fe20e4..3e2289c 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio
device status fetch from device driver
And on the target side with funtion vfio_device_get to restore
the same states
1. re-setup the pci bar configuration
2. re-setup the pci device msi configuration
3. restore the pci device status
Signed-off-by: Yulei Zhang
---
hw/vfio/pci.c | 137
New VFIO ioctl VFIO_IOMMU_GET_DIRTY_BITMAP is used to fetch the
bitmap of pinned memory in iommu container, we need copy those
memory to the target during the migration as they are dirtied by
mdev devices.
Signed-off-by: Yulei Zhang
---
hw/vfio/common.c | 34
31 matches
Mail list logo