Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Avihai Horon
On 15/07/2025 12:08, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 7/8/25 10:34, Avihai Horon wrote: On 24/06/2025 20:51, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Thi

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-08 Thread Avihai Horon
that it is loaded as part of the non-iterables: This property allows configuring whether to start the config load only after all iterables were loaded, during non-iterables loading phase. (We can also mention this in docs/code comment) Anyway: Reviewed-by: Avihai Horon Such interlocking i

Re: [PATCH 3/3] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-07-07 Thread Avihai Horon
ej S. Szmigiero Reviewed-by: Avihai Horon

Re: [PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-07-07 Thread Avihai Horon
ned-off-by: Maciej S. Szmigiero Reviewed-by: Avihai Horon But do we really need both x-migration-max-queued-buffers and x-migration-max-queued-buffers-size? I think one is sufficient. I vote for x-migration-max-queued-buffers-size as the actual memory limit won't change depending on

Re: [PATCH for-10.1 30/32] vfio: Rename VFIO dirty tracking services

2025-04-05 Thread Avihai Horon
On 20/03/2025 13:18, Joao Martins wrote: External email: Use caution opening links or attachments On 20/03/2025 11:13, Avihai Horon wrote: On 19/03/2025 14:21, Joao Martins wrote: External email: Use caution opening links or attachments On 18/03/2025 09:54, Cédric Le Goater wrote

Re: [PATCH for-10.1 06/32] vfio: Introduce a new header file for internal migration services

2025-04-05 Thread Avihai Horon
On 18/03/2025 11:53, Cédric Le Goater wrote: External email: Use caution opening links or attachments Gather all VFIO migration related declarations into "migration.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Reviewed-by: Avihai Horon Two nits

Re: [PATCH for-10.1 30/32] vfio: Rename VFIO dirty tracking services

2025-03-28 Thread Avihai Horon
On 19/03/2025 14:21, Joao Martins wrote: External email: Use caution opening links or attachments On 18/03/2025 09:54, Cédric Le Goater wrote: Rename these routines : vfio_devices_all_device_dirty_tracking_started -> vfio_dirty_tracking_devices_is_started_all vfio_devices_all_dirty_t

Re: [PATCH] vfio: Open code vfio_migration_set_error()

2025-03-24 Thread Avihai Horon
On 24/03/2025 17:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/24/25 16:14, Avihai Horon wrote: On 24/03/2025 14:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments VFIO uses migration_file_set_error() in a

Re: [PATCH] vfio: Open code vfio_migration_set_error()

2025-03-24 Thread Avihai Horon
On 24/03/2025 14:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments VFIO uses migration_file_set_error() in a couple of places where an 'Error **' parameter is not provided. In MemoryListener handlers : vfio_listener_region_add vfio_listener_log_global

Re: [PATCH for-10.1 30/32] vfio: Rename VFIO dirty tracking services

2025-03-20 Thread Avihai Horon
On 20/03/2025 13:56, Joao Martins wrote: External email: Use caution opening links or attachments On 20/03/2025 11:45, Avihai Horon wrote: On 20/03/2025 13:18, Joao Martins wrote: External email: Use caution opening links or attachments On 20/03/2025 11:13, Avihai Horon wrote: On 19/03

Re: [PATCH for-10.1 26/32] vfio: Rename vfio-common.h to vfio-device.h

2025-03-19 Thread Avihai Horon
On 18/03/2025 11:54, Cédric Le Goater wrote: External email: Use caution opening links or attachments "hw/vfio/vfio-common.h" has been emptied of most of its declarations by the previous changes and the only declarations left are related to VFIODevice. Rename it to "hw/vfio/vfio-device.h" and

Re: [PATCH for-10.1 03/32] vfio: Introduce a new header file for external migration services

2025-03-19 Thread Avihai Horon
On 18/03/2025 11:53, Cédric Le Goater wrote: External email: Use caution opening links or attachments The migration core subsytem makes uses of the VFIO migration API to collect statistics on the number of bytes transferred. These services are declared in "hw/vfio/vfio-common.h" which also co

Re: [PATCH for-10.1 01/32] vfio: Move vfio_mig_active() into migration.c

2025-03-19 Thread Avihai Horon
On 18/03/2025 11:53, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_mig_active() is part of the VFIO migration API. Move the definitions where VFIO migration is implemented. Signed-off-by: Cédric Le Goater Reviewed-by: Avihai Horon One nit below

Re: [PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()

2025-03-19 Thread Avihai Horon
On 18/03/2025 11:53, Cédric Le Goater wrote: External email: Use caution opening links or attachments Enforce a 'vfio_mig_' prefix for the VFIO migration API to better reflect the namespace these routines belong to. Signed-off-by: Cédric Le Goater Reviewed-by: Avihai Horon S

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-12 Thread Avihai Horon
On 11/03/2025 18:05, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 17:01, Avihai Horon wrote: On 11/03/2025 17:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 15:57, Avihai Horon wrote: On 11

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-11 Thread Avihai Horon
On 05/03/2025 0:03, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Implement the multifd device state transfer via additional per-device thread inside save_live_complete_precopy_thread handler. Switch between doing the data t

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Avihai Horon
On 11/03/2025 17:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 15:57, Avihai Horon wrote: On 11/03/2025 15:04, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/7/25 14:45, Maciej S. Szmigiero wrote

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Avihai Horon
On 11/03/2025 15:04, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/7/25 14:45, Maciej S. Szmigiero wrote: On 7.03.2025 13:03, Cédric Le Goater wrote: On 3/7/25 11:57, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" There's already a max in-f

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Avihai Horon
evice state transfer support - received buffers queuing") Fixes: 6d644baef203 ("vfio/migration: Multifd device state transfer support - send side") Signed-off-by: Maciej S. Szmigiero Reviewed-by: Avihai Horon Thanks. --- hw/vfio/migration-multifd.c | 15 ++-

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-09 Thread Avihai Horon
On 06/03/2025 16:13, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 6.03.2025 14:37, Avihai Horon wrote: On 06/03/2025 12:32, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/6/25 11:15, Maciej S. Szmigiero

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-06 Thread Avihai Horon
On 06/03/2025 12:32, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/6/25 11:15, Maciej S. Szmigiero wrote: On 6.03.2025 07:47, Avihai Horon wrote: On 05/03/2025 0:03, Maciej S. Szmigiero wrote: External email: Use caution opening links or

Re: [PATCH v6 00/36] Multifd 🔀 device state transfer support with VFIO consumer

2025-03-05 Thread Avihai Horon
On 05/03/2025 19:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/5/25 10:29, Cédric Le Goater wrote: Hello, On 3/4/25 23:03, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" This is an updated v6 patch series of the v5 series located here:

Re: [PATCH v6 00/36] Multifd 🔀 device state transfer support with VFIO consumer

2025-03-05 Thread Avihai Horon
On 05/03/2025 11:35, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/5/25 10:33, Avihai Horon wrote: On 05/03/2025 11:29, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello, On 3/4/25 23:03, Maciej S. Szmigiero

Re: [PATCH v6 00/36] Multifd 🔀 device state transfer support with VFIO consumer

2025-03-05 Thread Avihai Horon
On 05/03/2025 11:29, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello, On 3/4/25 23:03, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" This is an updated v6 patch series of the v5 series located here: https://lore.kernel.org/qemu-devel/cover.1

Re: [PATCH v5 27/36] vfio/migration: Multifd device state transfer support - load thread

2025-03-04 Thread Avihai Horon
On 04/03/2025 0:16, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 2.03.2025 15:15, Avihai Horon wrote: On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero"

Re: [PATCH v5 31/36] vfio/migration: Add x-migration-multifd-transfer VFIO property

2025-03-04 Thread Avihai Horon
On 04/03/2025 0:17, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 2.03.2025 15:48, Avihai Horon wrote: On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero&qu

Re: [PATCH v5 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-02 Thread Avihai Horon
On 02/03/2025 16:59, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 2.03.2025 15:54, Maciej S. Szmigiero wrote: On 2.03.2025 15:53, Avihai Horon wrote: On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or

Re: [PATCH v5 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Allow capping the maximum count of in-flight VFIO device state buffers queued at the destination, otherwise a malicious QEMU source could theoretically cause

Re: [PATCH v5 31/36] vfio/migration: Add x-migration-multifd-transfer VFIO property

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" This property allows configuring at runtime whether to transfer the IIUC, in this patch it's not configurable at runtime, so let's drop "at runtime". pa

Re: [PATCH v5 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Implement the multifd device state transfer via additional per-device thread inside save_live_complete_precopy_thread handler. Switch between doing the data

Re: [PATCH v5 28/36] vfio/migration: Multifd device state transfer support - config loading support

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Load device config received via multifd using the existing machinery behind vfio_load_device_config_state(). Also, make sure to process the relevant main mig

Re: [PATCH v5 27/36] vfio/migration: Multifd device state transfer support - load thread

2025-03-02 Thread Avihai Horon
On 26/02/2025 15:49, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/19/25 21:34, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Since it's important to finish loading device state transferred via the main migration channel (via save_live_itera

Re: [PATCH v5 27/36] vfio/migration: Multifd device state transfer support - load thread

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Maybe add a sentence talking about the load thread itself first? E.g.: Add a thread which loads the VFIO device state buffers that were received and via mu

Re: [PATCH v5 26/36] vfio/migration: Multifd device state transfer support - received buffers queuing

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" The multifd received data needs to be reassembled since device state packets sent via different multifd channels can arrive out-of-order. Therefore, each VFI

Re: [PATCH v5 23/36] vfio/migration: Multifd device state transfer support - VFIOStateBuffer(s)

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:34, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Add VFIOStateBuffer(s) types and the associated methods. These store received device state buffers and config state waiting to get loaded into the device. S

Re: [PATCH v5 14/36] migration/multifd: Device state transfer support - send side

2025-03-02 Thread Avihai Horon
On 19/02/2025 22:33, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" A new function multifd_queue_device_state() is provided for device to queue its state for transmission via a multifd channel. Reviewed-by: Peter Xu Signed-o

Re: [PATCH v5 11/36] migration/multifd: Device state transfer support - receive side

2025-03-02 Thread Avihai Horon
Hi Maciej, Sorry for the long delay, I have been busy with other tasks. I got some small comments for the series. On 19/02/2025 22:33, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Add a basic support for receiving device sta

[PATCH v2 1/7] vfio/container: Add dirty tracking started flag

2024-12-18 Thread Avihai Horon
Add a flag to VFIOContainerBase that indicates whether dirty tracking has been started for the container or not. This will be used in the following patches to allow dirty page syncs only if dirty tracking has been started. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- include/hw

[PATCH v2 0/7] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-18 Thread Avihai Horon
calc-dirty-rate. (Joao) * Added comment to VFIODevice->dirty_tracking that states it's protected by BQL. * Added R-b/A-b tags. Thanks. [1] https://lore.kernel.org/qemu-devel/20241024213056.1395400-1-pet...@redhat.com/ [2] https://lore.kernel.org/qemu-devel/20241216094638.26406-1-avih...@nvid

[PATCH v2 2/7] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic

2024-12-18 Thread Avihai Horon
tus, add a comment that states how it's protected. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/common.c | 17 - 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/

[PATCH v2 5/7] system/dirtylimit: Don't use migration_is_active()

2024-12-18 Thread Avihai Horon
. To accommodate this, and since the same functionality can be achieved with migration_is_running(), use it instead of migration_is_active(). Signed-off-by: Avihai Horon Reviewed-by: Hyman Huang --- system/dirtylimit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system

[PATCH v2 7/7] migration: Unexport migration_is_active()

2024-12-18 Thread Avihai Horon
After being removed from VFIO and dirty limit, migration_is_active() no longer has any users outside the migration subsystem, and in fact, it's only used in migration.c. Unexport it and also relocate it so it can be made static. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater

[PATCH v2 6/7] migration: Drop migration_is_device()

2024-12-18 Thread Avihai Horon
After being removed from VFIO, migration_is_device() no longer has any users. Drop it. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Acked-by: Peter Xu --- include/migration/misc.h | 1 - migration/migration.c| 7 --- 2 files changed, 8 deletions(-) diff --git a/include

[PATCH v2 3/7] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic

2024-12-18 Thread Avihai Horon
ned-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 4 ++-- hw/vfio/common.c | 40 +++ hw/vfio/container.c | 2 +- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfi

[PATCH v2 4/7] vfio/migration: Rename vfio_devices_all_dirty_tracking()

2024-12-18 Thread Avihai Horon
code clearer as there are already several helpers with similar names. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- hw/vfio/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 2831f674ff..d113d8f4f5 100644 --- a

Re: [PATCH 7/9] system/dirtylimit: Don't use migration_is_active()

2024-12-17 Thread Avihai Horon
On 17/12/2024 5:01, Yong Huang wrote: *External email: Use caution opening links or attachments* On Mon, Dec 16, 2024 at 5:47 PM Avihai Horon wrote: vcpu_dirty_rate_stat_collect() uses migration_is_active() to detect whether migration is running or not, in order to get the

Re: [PATCH 0/9] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-17 Thread Avihai Horon
On 16/12/2024 23:43, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 12/16/24 10:46, Avihai Horon wrote: Hello, This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function. Peter's serie

Re: [PATCH 3/9] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic

2024-12-17 Thread Avihai Horon
On 16/12/2024 17:58, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 14:55, Avihai Horon wrote: On 16/12/2024 14:45, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: During

Re: [PATCH 2/9] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic

2024-12-17 Thread Avihai Horon
On 16/12/2024 21:53, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 16:05, Joao Martins wrote: On 16/12/2024 15:52, Joao Martins wrote: On 16/12/2024 14:52, Avihai Horon wrote: On 16/12/2024 14:32, Joao Martins wrote: External email: Use

Re: [PATCH 5/9] vfio/migration: Drop vfio_dma_unmap_dirty_sync_needed()

2024-12-16 Thread Avihai Horon
On 16/12/2024 14:57, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: There is no need for vfio_dma_unmap_dirty_sync_needed(), as it simply calls vfio_devices_all_dirty_tracking_started(). Drop

Re: [PATCH 3/9] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic

2024-12-16 Thread Avihai Horon
On 16/12/2024 14:45, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: During DMA unmap with vIOMMU, vfio_devices_all_running_and_mig_active() is used to check whether a dirty page log sync of the unmapped pages is required

Re: [PATCH 2/9] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic

2024-12-16 Thread Avihai Horon
On 16/12/2024 14:32, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: During dirty page log sync, vfio_devices_all_dirty_tracking() is used to check if dirty tracking has been started in order to avoid errors. The current

Re: [PATCH 1/9] vfio/container: Add dirty tracking started flag

2024-12-16 Thread Avihai Horon
On 16/12/2024 14:15, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: Add a flag to VFIOContainerBase that indicates whether dirty tracking has been started for the container or not. This will be used in the following

Re: [PATCH 0/9] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-16 Thread Avihai Horon
On 16/12/2024 14:00, Joao Martins wrote: External email: Use caution opening links or attachments On 16/12/2024 09:46, Avihai Horon wrote: Hello, This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function. Peter's serie

[PATCH 1/9] vfio/container: Add dirty tracking started flag

2024-12-16 Thread Avihai Horon
Add a flag to VFIOContainerBase that indicates whether dirty tracking has been started for the container or not. This will be used in the following patches to allow dirty page syncs only if dirty tracking has been started. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-container-base.h

[PATCH 0/9] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-16 Thread Avihai Horon
41024213056.1395400-1-pet...@redhat.com/ Avihai Horon (9): vfio/container: Add dirty tracking started flag vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic vfio/migration: Add vfio_devices_all_dirty_trackin

[PATCH 2/9] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic

2024-12-16 Thread Avihai Horon
simplify the migration status API and reduce it to a single migration_is_running() function. To accommodate this, refactor vfio_devices_all_dirty_tracking() logic so it won't use migration_is_active() and migration_is_device(). Instead, use internal VFIO dirty tracking flags. Signed-off-by: A

[PATCH 7/9] system/dirtylimit: Don't use migration_is_active()

2024-12-16 Thread Avihai Horon
. To accommodate this, and since the same functionality can be achieved with migration_is_running(), use it instead of migration_is_active(). Signed-off-by: Avihai Horon --- system/dirtylimit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/dirtylimit.c b/system

[PATCH 6/9] vfio/migration: Rename vfio_devices_all_dirty_tracking()

2024-12-16 Thread Avihai Horon
code clearer as there are already several helpers with similar names. Signed-off-by: Avihai Horon --- hw/vfio/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 6e4654218a..dd8c5c52b5 100644 --- a/hw/vfio/common.c +++ b/hw

[PATCH 3/9] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic

2024-12-16 Thread Avihai Horon
g the logic to check if migration is running and dirty tracking has been started. This should be equivalent to the previous logic because when the guest is stopped there shouldn't be DMA unmaps coming from it. Also rename the function properly. Signed-off-by: Avihai Horon --- include/hw

[PATCH 9/9] migration: Unexport migration_is_active()

2024-12-16 Thread Avihai Horon
After being removed from VFIO and dirty limit, migration_is_active() no longer has any users outside the migration subsystem, and in fact, it's only used in migration.c. Unexport it and also relocate it so it can be made static. Signed-off-by: Avihai Horon --- include/migration/misc.h

[PATCH 8/9] migration: Drop migration_is_device()

2024-12-16 Thread Avihai Horon
After being removed from VFIO, migration_is_device() no longer has any users. Drop it. Signed-off-by: Avihai Horon --- include/migration/misc.h | 1 - migration/migration.c| 7 --- 2 files changed, 8 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index

[PATCH 5/9] vfio/migration: Drop vfio_dma_unmap_dirty_sync_needed()

2024-12-16 Thread Avihai Horon
There is no need for vfio_dma_unmap_dirty_sync_needed(), as it simply calls vfio_devices_all_dirty_tracking_started(). Drop vfio_dma_unmap_dirty_sync_needed(), export vfio_devices_all_dirty_tracking_started() and use it instead. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 3

[PATCH 4/9] vfio/migration: Add vfio_devices_all_dirty_tracking_started() helper

2024-12-16 Thread Avihai Horon
vfio_devices_all_dirty_tracking() and vfio_dma_unmap_dirty_sync_needed() share the same code that checks if dirty page tracking has been started. Extract it to a common helper vfio_devices_all_dirty_tracking_started(). Signed-off-by: Avihai Horon --- hw/vfio/common.c | 25

Re: [PATCH v3 24/24] vfio/migration: Multifd device state transfer support - send side

2024-12-12 Thread Avihai Horon
On 11/12/2024 1:06, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 9.12.2024 10:28, Avihai Horon wrote: On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmi

Re: [PATCH v3 18/24] vfio/migration: Don't run load cleanup if load setup didn't run

2024-12-12 Thread Avihai Horon
On 11/12/2024 1:04, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 3.12.2024 16:09, Avihai Horon wrote: On 29/11/2024 19:15, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 29.11.2024 15:08, Cédric Le Goater

Re: [PATCH v3 22/24] vfio/migration: Multifd device state transfer support - receive side

2024-12-12 Thread Avihai Horon
On 11/12/2024 1:06, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments Hi Avihai, On 9.12.2024 10:13, Avihai Horon wrote: Hi Maciej, On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Mac

Re: [PATCH v3 24/24] vfio/migration: Multifd device state transfer support - send side

2024-12-09 Thread Avihai Horon
On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Implement the multifd device state transfer via additional per-device thread inside save_live_complete_precopy_thread handler. Switch between doing the data

Re: [PATCH v3 22/24] vfio/migration: Multifd device state transfer support - receive side

2024-12-09 Thread Avihai Horon
Hi Maciej, On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" The multifd received data needs to be reassembled since device state packets sent via different multifd channels can arrive out-of-order. Therefore

Re: [PATCH v3 18/24] vfio/migration: Don't run load cleanup if load setup didn't run

2024-12-03 Thread Avihai Horon
On 29/11/2024 19:15, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 29.11.2024 15:08, Cédric Le Goater wrote: On 11/17/24 20:20, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" It's possible for load_cleanup SaveVMHandler to get called withou

Re: [PATCH v3 15/24] migration/multifd: Add migration_has_device_state_support()

2024-11-28 Thread Avihai Horon
On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Since device state transfer via multifd channels requires multifd channels with packets and is currently not compatible with multifd compression add an approp

Re: [PATCH v3 08/24] migration: Add thread pool of optional load threads

2024-11-28 Thread Avihai Horon
On 17/11/2024 21:20, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Some drivers might want to make use of auxiliary helper threads during VM state loading, for example to make sure that their blocking (sync) I/O operations do

Re: [PATCH v3 04/24] thread-pool: Implement generic (non-AIO) pool support

2024-11-28 Thread Avihai Horon
Hi Maciej, On 17/11/2024 21:19, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Migration code wants to manage device data sending threads in one place. QEMU has an existing thread pool implementation, however it is limited to

Re: [PATCH 1/4] vfio/migration: Add save_{iterate,complete_precopy}_started trace events

2024-11-04 Thread Avihai Horon
On 04/11/2024 16:00, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 4.11.2024 09:08, Avihai Horon wrote: On 01/11/2024 0:17, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments Hi Avihai, On 31.10.2024 15:21

Re: [PATCH 1/4] vfio/migration: Add save_{iterate,complete_precopy}_started trace events

2024-11-04 Thread Avihai Horon
On 01/11/2024 0:17, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments Hi Avihai, On 31.10.2024 15:21, Avihai Horon wrote: Hi Maciej, On 29/10/2024 16:58, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "M

Re: [PATCH 1/4] vfio/migration: Add save_{iterate,complete_precopy}_started trace events

2024-10-31 Thread Avihai Horon
Hi Maciej, On 29/10/2024 16:58, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" This way both the start and end points of migrating a particular VFIO device are known. Add also a vfio_save_iterate_empty_hit trace event so it is

Re: [PATCH v3 7/8] migration: Unexport migration_is_active()

2024-10-30 Thread Avihai Horon
On 28/10/2024 21:06, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 28, 2024 at 07:20:27PM +0200, Avihai Horon wrote: On 28/10/2024 18:58, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 28, 2024 at 06:41:42PM

Re: [PATCH v3 7/8] migration: Unexport migration_is_active()

2024-10-28 Thread Avihai Horon
On 28/10/2024 18:58, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 28, 2024 at 06:41:42PM +0200, Avihai Horon wrote: On 28/10/2024 17:45, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 28, 2024 at 09:43:16AM

Re: [PATCH v3 7/8] migration: Unexport migration_is_active()

2024-10-28 Thread Avihai Horon
On 28/10/2024 17:45, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 28, 2024 at 09:43:16AM +0200, Avihai Horon wrote: On 25/10/2024 0:30, Peter Xu wrote: External email: Use caution opening links or attachments We have two outside users of this API

Re: [PATCH v3 7/8] migration: Unexport migration_is_active()

2024-10-28 Thread Avihai Horon
On 25/10/2024 0:30, Peter Xu wrote: External email: Use caution opening links or attachments We have two outside users of this API, so it's exported. Is it really necessary? Does it matter whether it must be ACTIVE/POSTCOPY_ACTIVE/DEVICE? I guess no. Actually for VFIO it does matter, bec

Re: [PATCH 1/2] migration: Make all helpers in misc.h safe to use without migration

2024-10-23 Thread Avihai Horon
;s working now. We can move to other things (e.g. RCU) whenever necessary in the future but it's an overkill if we have BQL anyway in most/all existing callers. When at it, update some comments, e.g. migrate_announce_params() is exported from options.c now. Cc: Cédric Le Goater Cc: Avihai Hor

Re: [PATCH 2/3] vfio/migration: Refactor vfio_vmstate_change/_prepare() error reporting

2024-10-22 Thread Avihai Horon
On 22/10/2024 16:24, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 10/22/24 11:38, Avihai Horon wrote: On 21/10/2024 19:54, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 21, 2024 at 06:43:13PM +0200, Cédric Le

Re: [PATCH 2/3] vfio/migration: Refactor vfio_vmstate_change/_prepare() error reporting

2024-10-22 Thread Avihai Horon via
On 21/10/2024 19:54, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Oct 21, 2024 at 06:43:13PM +0200, Cédric Le Goater wrote: Hello, IIUC the migration thread should always see valid migration object, as it takes one refcount at the entrance of migration_t

[PATCH 0/3] vfio/migration: Some bug fixes and cleanups

2024-10-20 Thread Avihai Horon
This small series contains some bug fixes and cleanups. Reviews are welcome. Thanks. Avihai Horon (3): vfio/migration: Report only stop-copy size in vfio_state_pending_exact() vfio/migration: Refactor vfio_vmstate_change/_prepare() error reporting vfio/migration: Change trace

[PATCH 2/3] vfio/migration: Refactor vfio_vmstate_change/_prepare() error reporting

2024-10-20 Thread Avihai Horon
ertion `mutex->initialized' failed. Fix this by not setting migration file error in the shut down flow. Fixes: 20c64c8a51a4 ("migration: migration_file_set_error") Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 31 +-- 1 file changed, 21 ins

[PATCH 1/3] vfio/migration: Report only stop-copy size in vfio_state_pending_exact()

2024-10-20 Thread Avihai Horon
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: eda7362af959 ("vfio/migration: Add VFIO migration pre-copy support") Signed-off-by: Avihai Horon --

[PATCH 3/3] vfio/migration: Change trace formats from hex to decimal

2024-10-20 Thread Avihai Horon
events. Signed-off-by: Avihai Horon --- hw/vfio/trace-events | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index c475c273fd..29789e8d27 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -151,7 +151,7

Re: [PATCH v2 17/17] vfio/migration: Multifd device state transfer support - send side

2024-09-12 Thread Avihai Horon
On 09/09/2024 21:07, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 9.09.2024 13:41, Avihai Horon wrote: On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmi

Re: [PATCH v2 15/17] vfio/migration: Multifd device state transfer support - receive side

2024-09-12 Thread Avihai Horon
On 09/09/2024 21:06, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 9.09.2024 10:55, Avihai Horon wrote: On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero&q

Re: [PATCH v2 09/17] migration/multifd: Device state transfer support - receive side

2024-09-12 Thread Avihai Horon
On 09/09/2024 21:05, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 5.09.2024 18:47, Avihai Horon wrote: On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero&quo

Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2

2024-09-12 Thread Avihai Horon
On 09/09/2024 18:11, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Sep 09, 2024 at 03:52:39PM +0300, Avihai Horon wrote: On 05/09/2024 21:31, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Sep 05, 2024 at 07:45:43PM

Re: [PATCH v2 01/17] vfio/migration: Add save_{iterate,complete_precopy}_started trace events

2024-09-11 Thread Avihai Horon
On 09/09/2024 21:04, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments On 5.09.2024 15:08, Avihai Horon wrote: Hi Maciej, On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmi

Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2

2024-09-09 Thread Avihai Horon
On 05/09/2024 21:31, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Sep 05, 2024 at 07:45:43PM +0300, Avihai Horon wrote: Does it also mean then that the currently reported stop-size - precopy-size will be very close to the constant non-iterable data size

Re: [PATCH v2 17/17] vfio/migration: Multifd device state transfer support - send side

2024-09-09 Thread Avihai Horon
On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Implement the multifd device state transfer via additional per-device thread inside save_live_complete_precopy_thread handler. Switch between doing the data

Re: [PATCH v2 15/17] vfio/migration: Multifd device state transfer support - receive side

2024-09-09 Thread Avihai Horon
On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" The multifd received data needs to be reassembled since device state packets sent via different multifd channels can arrive out-of-order. Therefore, each VFI

Re: [PATCH v2 09/17] migration/multifd: Device state transfer support - receive side

2024-09-05 Thread Avihai Horon
On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" Add a basic support for receiving device state via multifd channels - channels that are shared with RAM transfers. To differentiate between a device state an

Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2

2024-09-05 Thread Avihai Horon
On 05/09/2024 19:23, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Sep 05, 2024 at 07:07:28PM +0300, Avihai Horon wrote: So I wonder why stop-size can change from a driver, and whether that can be reported in a more predictable fashion. Otherwise I see

Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2

2024-09-05 Thread Avihai Horon
On 05/09/2024 18:17, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Sep 05, 2024 at 02:41:09PM +0300, Avihai Horon wrote: On 04/09/2024 19:16, Peter Xu wrote: External email: Use caution opening links or attachments On Wed, Sep 04, 2024 at 06:41:03PM

Re: [PATCH v2 08/17] migration: Add load_finish handler and associated functions

2024-09-05 Thread Avihai Horon
On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" load_finish SaveVMHandler allows migration code to poll whether a device-specific asynchronous device state loading operation had finished. In order to avoid

Re: [PATCH v2 07/17] migration: Add qemu_loadvm_load_state_buffer() and its handler

2024-09-05 Thread Avihai Horon
On 27/08/2024 20:54, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" qemu_loadvm_load_state_buffer() and its load_state_buffer SaveVMHandler allow providing device state buffer to explicitly specified device via its idstr and i

  1   2   3   4   5   6   7   >