qemu/hw/vfio
Avihai Horon 3b5948f808 vfio/migration: Report only stop-copy size in vfio_state_pending_exact()
vfio_state_pending_exact() is used to update migration core how much
device data is left for the device migration. Currently, the sum of
pre-copy and stop-copy sizes of the VFIO device are reported.

The pre-copy size is obtained via the VFIO_MIG_GET_PRECOPY_INFO ioctl,
which returns the amount of device data available to be transferred
while the device is in the PRE_COPY states.

The stop-copy size is obtained via the VFIO_DEVICE_FEATURE_MIG_DATA_SIZE
ioctl, which returns the total amount of device data left to be
transferred in order to complete the device migration.

According to the above, current implementation is wrong -- it reports
extra overlapping data because pre-copy size is already contained in
stop-copy size. Fix it by reporting only stop-copy size.

Fixes: eda7362af9 ("vfio/migration: Add VFIO migration pre-copy support")
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
2024-10-23 14:46:24 +02:00
..
amd-xgbe.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ap.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
calxeda-xgmac.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ccw.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
common.c vfio queue: 2024-07-24 12:58:46 +10:00
container-base.c vfio-container-base: Introduce vfio_container_get_iova_ranges() helper 2024-07-09 11:50:37 +02:00
container.c vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device() 2024-07-23 17:14:52 +02:00
cpr.c vfio/cpr: Make vfio_cpr_register_container() return bool 2024-05-16 16:59:20 +02:00
display.c vfio/display: Fix vfio_display_edid_init() error path 2024-07-09 11:50:37 +02:00
helpers.c vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device() 2024-07-23 17:14:52 +02:00
igd.c vfio/igd: correctly calculate stolen memory size for gen 9 and later 2024-09-17 10:37:55 +02:00
iommufd.c vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support 2024-07-23 17:14:52 +02:00
Kconfig hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
meson.build vfio: register container for cpr 2024-03-08 22:10:13 +01:00
migration.c vfio/migration: Report only stop-copy size in vfio_state_pending_exact() 2024-10-23 14:46:24 +02:00
pci-quirks.c vfio/igd: add new bar0 quirk to emulate BDSM mirror 2024-09-17 10:37:55 +02:00
pci.c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
pci.h vfio/igd: add new bar0 quirk to emulate BDSM mirror 2024-09-17 10:37:55 +02:00
platform.c vfio/platform: Make vfio_populate_device() and vfio_base_device_init() return bool 2024-05-22 10:04:21 +02:00
spapr.c vfio/container: Change VFIOContainerBase to use QOM 2024-06-24 23:15:31 +02:00
trace-events hw/vfio/pci.c: Use correct type in trace_vfio_msix_early_setup() 2024-09-17 10:37:55 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00