Re: [PATCH v6 8/9] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-16 Thread Avihai Horon
d_listener_dirty_bitmap(bcontainer, section); +int ret; + +ret = vfio_sync_ram_discard_listener_dirty_bitmap(bcontainer, section); +if (ret) { +error_setg(errp, + "Failed to sync dirty bitmap with RAM discard listener"); +

Re: [PATCH v6 7/9] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-16 Thread Avihai Horon
-by: Cédric Le Goater FWIW, Reviewed-by: Avihai Horon --- Changes in v6: - Fixed memory_get_xlat_addr documentation (Avihai) include/exec/memory.h | 15 ++- hw/vfio/common.c | 13 + hw/virtio/vhost-vdpa.c | 5 - system/memory.c| 10

Re: [PATCH v6 5/9] vfio/migration: Add Error** argument to .vfio_save_config() handler

2024-05-16 Thread Avihai Horon
Mathieu-Daudé Signed-off-by: Cédric Le Goater Reviewed-by: Avihai Horon --- Changes in v6: - Modified title (Avihai) - vfio_save_device_config_state() : Set errp if the migration stream is in error (Avihai) - vfio_save_state() : Changed error prefix (Avihai) include/hw/vfio/vfio

Re: [PATCH v6 4/9] vfio/migration: Add an Error** argument to vfio_migration_set_state()

2024-05-16 Thread Avihai Horon
() handler is executed. Modify vfio_vmstate_change_prepare() and vfio_vmstate_change() to store a reported error under the migration stream if a migration is in progress. Signed-off-by: Cédric Le Goater With/without Eric's suggestion: Reviewed-by: Avihai Horon Two nits below though (if you respin

[PATCH v3 3/4] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-15 Thread Avihai Horon
pre-copy, for migrating an already stopped guest and for snapshots. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/migration.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 2e1a8f6031..f2b7a3067b 100644 --- a/hw/v

[PATCH v3 2/4] vfio/migration: Emit VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
abled only for the required devices. It is disabled by default. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/migration.c | 59 +-- hw/vfio/pci.c | 2 ++ 3 files changed, 59 insertions(+), 3 deletions(-)

[PATCH v3 4/4] vfio/migration: Enhance VFIO migration state tracing

2024-05-15 Thread Avihai Horon
state and device reset transitions) and in no-op state transitions to the same state. Suggested-by: Cédric Le Goater Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 8 ++-- hw/vfio/trace-events | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/vfio/migration.c b

[PATCH v3 1/4] qapi/vfio: Add VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
for their own purposes. Note that this new event is introduced since VFIO devices have a unique set of migration states which cannot be described as accurately by other existing events such as run state or migration status. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- MAINTAINERS

[PATCH v3 0/4] qapi/vfio: Add VFIO migration QAPI event

2024-05-15 Thread Avihai Horon
eter) [1] https://lore.kernel.org/qemu-devel/20240430051621.19597-1-avih...@nvidia.com/ [2] https://lore.kernel.org/qemu-devel/20240509090954.16447-1-avih...@nvidia.com/ Avihai Horon (4): qapi/vfio: Add VFIO migration QAPI event vfio/migration: Emit VFIO migration QAPI event vfio/migration: Don't emi

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Avihai Horon
On 15/05/2024 15:36, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:29, Avihai Horon wrote: On 15/05/2024 15:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:17, Avihai Horon wrote: On 13

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Avihai Horon
On 15/05/2024 15:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:17, Avihai Horon wrote: On 13/05/2024 19:27, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/13/24 15:03, Avihai Horon wrote: Hi

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Avihai Horon
On 13/05/2024 19:27, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/13/24 15:03, Avihai Horon wrote: Hi Cedric, On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments We will use the Error object

Re: [PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-13 Thread Avihai Horon
On 13/05/2024 17:43, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/13/24 16:34, Avihai Horon wrote: On 13/05/2024 17:01, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/9/24 11:09, Avihai Horon wrote: Emit

Re: [PATCH v2 3/3] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-13 Thread Avihai Horon
On 13/05/2024 17:13, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/9/24 11:09, Avihai Horon wrote: When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second time

Re: [PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-13 Thread Avihai Horon
On 13/05/2024 17:01, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/9/24 11:09, Avihai Horon wrote: Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current

Re: [PATCH v5 10/10] vfio: Extend vfio_set_migration_error() with Error* argument

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress. To improve error reporting, add a new Error* argument to also set the Error object

Re: [PATCH v5 09/10] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Signed-off-by: Cédric Le Goater Reviewed-by: Avihai Horon --- hw/vfio/migration.c | 3

Re: [PATCH v5 08/10] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- Changes in v5: - Replaced error_setg() by error_setg_errno() in

Re: [PATCH v5 07/10] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Let the callers do the reporting. This will be useful in vfio_iommu_map_dirty_notify(). Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: David Hildenbrand Reviewed-by: Peter Xu

Re: [PATCH v5 06/10] vfio: Reverse test on vfio_get_dirty_bitmap()

2024-05-13 Thread Avihai Horon
ADDR_PRIx", " + "0x%"HWADDR_PRIx") = %d (%s)", + bcontainer, iova, iotlb->addr_mask + 1, ret, + strerror(-ret)); +} + +out_lock: s/out_lock/out_unlock? With the above, Reviewed-by: Avihai Horon rcu_read_unlock(); out: -- 2.45.0

Re: [PATCH v5 05/10] vfio: Add Error** argument to .vfio_save_config() handler

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Use vmstate_save_state_with_err() to improve error reporting in the callers and store a reported error under the migration stream. Add documentation while at it. Reviewed-by: Philippe

Re: [PATCH v5 04/10] vfio: Use new Error** argument in vfio_save_setup()

2024-05-13 Thread Avihai Horon
On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Nit: change commit title prefix to vfio/migration (also in other patches that are closely related to vfio migration) Plus, maybe change subject to "Add an Error** argument to

Re: [PATCH v5 03/10] vfio: Extend migration_file_set_error() with Error** argument

2024-05-13 Thread Avihai Horon
-by: Avihai Horon Use it to update the current error of the migration stream if available and if not, simply print out the error. Next changes will update with an error to report. Signed-off-by: Cédric Le Goater --- include/migration/misc.h | 2 +- hw/vfio/common.c | 2 +- hw/vfio

Re: [PATCH v5 02/10] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-13 Thread Avihai Horon
-by: Avihai Horon Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v5: - Used error_setg_errno() in vfio_devices_dma_logging_start() hw/vfio/common.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/vfio

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-13 Thread Avihai Horon
this patch, personally, I found the split of patch #1 and #2 a bit confusing. Maybe consider squashing patch #1 and #2 so container based and device based DPT start/stop are changed in the same patch? Like you did in patch #8? Whatever you think is better. In any case: Reviewed-by: Avihai Horon

[PATCH v2 1/3] qapi/vfio: Add VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
for their own purposes. Note that this new event is introduced since VFIO devices have a unique set of migration states which cannot be described as accurately by other existing events such as run state or migration status. Signed-off-by: Avihai Horon --- MAINTAINERS | 1 + qapi/qapi

[PATCH v2 0/3] qapi/vfio: Add VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
ded helper to set VFIO state and emit VFIO event. (Peter) [1] https://lore.kernel.org/qemu-devel/20240430051621.19597-1-avih...@nvidia.com/ Avihai Horon (3): qapi/vfio: Add VFIO migration QAPI event vfio/migration: Emit VFIO migration QAPI event vfio/migration: Don't emit STOP_COPY VFIO migr

[PATCH v2 3/3] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-09 Thread Avihai Horon
pre-copy, for migrating an already stopped guest and for snapshots. Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 5a359c4c78..14ef9c924e 100644 --- a/hw/vfio/migration.c +++ b/hw/v

[PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
abled only for the required devices. It is disabled by default. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/migration.c | 56 +-- hw/vfio/pci.c | 2 ++ 3 files changed, 56 insertions(+), 3 deletions(-)

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-05-07 Thread Avihai Horon
On 07/05/2024 19:13, Peter Xu wrote: External email: Use caution opening links or attachments On Tue, May 07, 2024 at 11:41:05AM +0300, Avihai Horon wrote: Yes, I was working on parallel VFIO migration, but in a different approach (not over multifd) which I'm not sure is relevant

Re: [PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-05-07 Thread Avihai Horon
On 07/05/2024 18:51, Peter Xu wrote: External email: Use caution opening links or attachments On Tue, May 07, 2024 at 10:47:13AM +0300, Avihai Horon wrote: While at it, another trivial comment is maybe it's nice to have a helper to both update the vfio migration state, plus emitting events

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-05-07 Thread Avihai Horon
On 06/05/2024 20:56, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, May 06, 2024 at 06:26:46PM +0200, Maciej S. Szmigiero wrote: On 29.04.2024 17:09, Peter Xu wrote: On Fri, Apr 26, 2024 at 07:34:09PM +0200, Maciej S. Szmigiero wrote: On 24.04.2024 00:35,

Re: [PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-05-07 Thread Avihai Horon
On 06/05/2024 18:07, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, May 06, 2024 at 11:38:00AM -0300, Fabiano Rosas wrote: Markus Armbruster writes: Peter, Fabiano, I'd like to hear your opinion on the issue discussed below. Avihai Horon writes

Re: [PATCH 3/3] vfio/migration: Don't emit STOP_COPY state change event twice

2024-05-06 Thread Avihai Horon
On 06/05/2024 17:39, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 4/30/24 07:16, Avihai Horon wrote: When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second

Re: [PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-05-06 Thread Avihai Horon
On 06/05/2024 13:36, Markus Armbruster wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 06/05/2024 7:52, Markus Armbruster wrote: Avihai Horon writes: On 01/05/2024 14:50, Joao Martins wrote: On 30/04/2024 06:16, Avihai Horon wrote: Add a new

Re: [PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-05-06 Thread Avihai Horon
On 06/05/2024 7:52, Markus Armbruster wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 01/05/2024 14:50, Joao Martins wrote: External email: Use caution opening links or attachments On 30/04/2024 06:16, Avihai Horon wrote: Add a new QAPI event

Re: [PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-05-06 Thread Avihai Horon
On 06/05/2024 7:35, Markus Armbruster wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 02/05/2024 14:19, Markus Armbruster wrote: External email: Use caution opening links or attachments Avihai Horon writes: Add a new QAPI event for VFIO device

Re: [PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-05-05 Thread Avihai Horon
On 02/05/2024 14:19, Markus Armbruster wrote: External email: Use caution opening links or attachments Avihai Horon writes: Add a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its migration state, for example, during migration

Re: [PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-05-05 Thread Avihai Horon
On 02/05/2024 13:22, Joao Martins wrote: External email: Use caution opening links or attachments On 01/05/2024 13:28, Avihai Horon wrote: On 01/05/2024 14:50, Joao Martins wrote: External email: Use caution opening links or attachments On 30/04/2024 06:16, Avihai Horon wrote: Emit VFIO

Re: [PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-05-01 Thread Avihai Horon
On 01/05/2024 14:50, Joao Martins wrote: External email: Use caution opening links or attachments On 30/04/2024 06:16, Avihai Horon wrote: Emit VFIO device migration state change QAPI event when a VFIO device changes its migration state. This can be used by management applications to get

Re: [PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-05-01 Thread Avihai Horon
On 01/05/2024 14:50, Joao Martins wrote: External email: Use caution opening links or attachments On 30/04/2024 06:16, Avihai Horon wrote: Add a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its migration state, for example

[PATCH 0/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is added so events can be enabled only for the required devices. It is disabled by default. Feedback/comments are appreciated, Thanks. Avihai Horon (3): qapi/vfio: Add VFIO device

[PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
of the VFIO device for their own purposes. Signed-off-by: Avihai Horon --- MAINTAINERS | 1 + qapi/qapi-schema.json | 1 + qapi/vfio.json| 61 +++ qapi/meson.build | 1 + 4 files changed, 64 insertions(+) create mode 100644 qapi/vfio.json

[PATCH 3/3] vfio/migration: Don't emit STOP_COPY state change event twice

2024-04-29 Thread Avihai Horon
ort pre-copy, for migrating an already stopped guest and for snapshots. Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 6bbccf6545..30a2b2ea74 100644 --- a/hw/v

[PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
so events can be enabled only for the required devices. It is disabled by default. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/migration.c | 44 +++ hw/vfio/pci.c | 2 ++ 3 files changed, 47 insertions(+)

[PATCH for-9.0] MAINTAINERS: Adjust migration documentation files

2024-04-07 Thread Avihai Horon
o a new file without updating dirty limit section in MAINTAINERS file. Fix the above. Fixes: 8cb2f8b172e7 ("docs/migration: Create migration/ directory") Fixes: 4c6f8a79ae53 ("docs/migration: Split 'dirty limit'") Signed-off-by: Avihai Horon --- MAINTAINERS | 6 -- 1 file change

Re: [PATCH for-9.0 1/2] migration: Set migration error in migration_completion()

2024-03-28 Thread Avihai Horon
On 28/03/2024 17:09, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Mar 28, 2024 at 04:02:51PM +0200, Avihai Horon wrote: After commit 9425ef3f990a ("migration: Use migrate_has_error() in close_return_path_on_source()"), close_return_path

Re: [PATCH for-9.0 1/2] migration: Set migration error in migration_completion()

2024-03-28 Thread Avihai Horon
On 28/03/2024 17:21, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 3/28/24 15:02, Avihai Horon wrote: After commit 9425ef3f990a ("migration: Use migrate_has_error() in close_return_path_on_source()"), close_return_path_on_source

[PATCH for-9.0 0/2] migration: Two migration bug fixes

2024-03-28 Thread Avihai Horon
Hello, This small series fixes two migration bugs I stumbled upon recently. Comments are welcome, thanks for reviewing. Avihai Horon (2): migration: Set migration error in migration_completion() migration/postcopy: Ensure postcopy_start() sets errp if it fails migration/migration.c | 18

[PATCH for-9.0 2/2] migration/postcopy: Ensure postcopy_start() sets errp if it fails

2024-03-28 Thread Avihai Horon
("migration: Update error description whenever migration fails") Signed-off-by: Avihai Horon --- migration/migration.c | 8 1 file changed, 8 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index b73ae3a72c4..86bf76e9258 100644 --- a/migration/migrati

[PATCH for-9.0 1/2] migration: Set migration error in migration_completion()

2024-03-28 Thread Avihai Horon
for the return-path channel. Fix it by ensuring migration error is set in case of error in migration_completion(). Signed-off-by: Avihai Horon --- migration/migration.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 9fe8fd2afd7

Re: [PATCH v3 02/26] vfio: Always report an error in vfio_save_setup()

2024-03-06 Thread Avihai Horon
On 06/03/2024 11:56, Avihai Horon wrote: On 04/03/2024 14:28, Cédric Le Goater wrote: External email: Use caution opening links or attachments This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure

Re: [PATCH v3 02/26] vfio: Always report an error in vfio_save_setup()

2024-03-06 Thread Avihai Horon
On 04/03/2024 14:28, Cédric Le Goater wrote: External email: Use caution opening links or attachments This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, vfio_save_setup() always sets a new error.

Re: [PATCH v3 01/26] s390/stattrib: Add Error** argument to set_migrationmode() handler

2024-03-05 Thread Avihai Horon
On 04/03/2024 14:28, Cédric Le Goater wrote: External email: Use caution opening links or attachments This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, set_migrationmode() always sets a new error. See the

[PATCH v2 1/3] migration: Don't serialize devices in qemu_savevm_state_iterate()

2024-03-04 Thread Avihai Horon
ikely to happen only if max-bandwidth is low. [1] https://lore.kernel.org/qemu-devel/Zd6iw9dBhW6wKNxx@x1n/ Signed-off-by: Avihai Horon --- migration/savevm.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index d612

[PATCH v2 3/3] vfio/migration: Add a note about migration rate limiting

2024-03-04 Thread Avihai Horon
to migration RAM code). Add a note about this in vfio_save_iterate() to serve as a reminder. Suggested-by: Peter Xu Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 0af783a5892..f82dcabc49a

[PATCH v2 0/3] migration: Don't serialize devices in qemu_savevm_state_iterate()

2024-03-04 Thread Avihai Horon
ion in qemu_savevm_state_iterate() always, regardless of switchover-ack. * Refactor vfio_save_iterate() return value. * Add a note about migration rate limiting in vfio_save_iterate(). [1] https://lore.kernel.org/qemu-devel/20240222155627.14563-1-avih...@nvidia.com/ Avihai Horon (3): migration: Don't serial

[PATCH v2 2/3] vfio/migration: Refactor vfio_save_state() return value

2024-03-04 Thread Avihai Horon
that qemu_savevm_state_iterate() no longer serializes devices, there is no need for that. Refactor vfio_save_state() to return 0 if more data is available and 1 if no more data is available. Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/vfio

Re: [PATCH v2 03/21] migration: Add documentation for SaveVMHandlers

2024-03-04 Thread Avihai Horon
Hi Cedric, A few nits below. On 27/02/2024 20:03, Cédric Le Goater wrote: External email: Use caution opening links or attachments The SaveVMHandlers structure is still in use for complex subsystems and devices. Document the handlers since we are going to modify a few later. Signed-off-by:

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-28 Thread Avihai Horon
On 28/02/2024 12:17, Peter Xu wrote: External email: Use caution opening links or attachments On Wed, Feb 28, 2024 at 11:39:52AM +0200, Avihai Horon wrote: On 28/02/2024 5:04, Peter Xu wrote: External email: Use caution opening links or attachments On Wed, Feb 28, 2024 at 02:00:26AM

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-28 Thread Avihai Horon
On 27/02/2024 5:16, Wang, Lei wrote: External email: Use caution opening links or attachments On 2/22/2024 23:56, Avihai Horon wrote: Currently, migration code serializes device data sending during pre-copy iterative phase. As noted in the code comment, this is done to prevent faster

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-28 Thread Avihai Horon
On 28/02/2024 5:04, Peter Xu wrote: External email: Use caution opening links or attachments On Wed, Feb 28, 2024 at 02:00:26AM +0200, Avihai Horon wrote: On 27/02/2024 9:41, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Feb 22, 2024 at 05:56:27PM +0200

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-27 Thread Avihai Horon
On 27/02/2024 9:41, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Feb 22, 2024 at 05:56:27PM +0200, Avihai Horon wrote: Currently, migration code serializes device data sending during pre-copy iterative phase. As noted in the code comment, this is done

[PATCH] migration: Don't serialize migration while can't switchover

2024-02-22 Thread Avihai Horon
: 1b4adb10f898 ("migration: Implement switchover ack logic") Signed-off-by: Avihai Horon --- migration/savevm.h| 2 +- migration/migration.c | 4 ++-- migration/savevm.c| 22 +++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/migration/savevm.h b

Re: [PATCH RFCv2 5/8] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-02-20 Thread Avihai Horon
On 20/02/2024 12:59, Joao Martins wrote: External email: Use caution opening links or attachments On 19/02/2024 09:30, Avihai Horon wrote: Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments ioctl(iommufd

Re: [PATCH RFCv2 3/8] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-02-20 Thread Avihai Horon
On 20/02/2024 12:51, Joao Martins wrote: External email: Use caution opening links or attachments On 19/02/2024 09:03, Avihai Horon wrote: Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments Probe hardware dirty tracking support

Re: [PATCH RFCv2 7/8] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can

Re: [PATCH RFCv2 6/8] backends/iommufd: Add ability to disable hugepages

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments Allow disabling hugepages to be dirty track at base page granularity in similar vein to vfio_type1_iommu.disable_hugepages but per IOAS. Signed-off-by: Joao Martins ---

Re: [PATCH RFCv2 5/8] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI that fetches the bitmap that tells what was dirty in an IOVA range. A single bitmap is allocated and used across all the

Re: [PATCH RFCv2 4/8] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that enables or disables dirty page tracking. It is called on the whole list of iommu domains it is are tracking, and on

Re: [PATCH RFCv2 3/8] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments Probe hardware dirty tracking support by querying device hw capabilities via IOMMUFD_GET_HW_INFO. In preparation to using the dirty tracking UAPI, request dirty tracking in the HWPT

Re: [PATCH RFCv2 2/8] vfio/iommufd: Introduce auto domain creation

2024-02-19 Thread Avihai Horon
Hi Joao, On 12/02/2024 15:56, Joao Martins wrote: External email: Use caution opening links or attachments There's generally two modes of operation for IOMMUFD: * The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. It generally creates an IOAS and

Re: [PATCH 08/14] vfio: Use new Error** argument in vfio_save_setup()

2024-02-13 Thread Avihai Horon
On 12/02/2024 19:54, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/12/24 10:17, Avihai Horon wrote: Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments Add an Error** argument

Re: [PATCH 01/14] migration: Add Error** argument to .save_setup() handler

2024-02-12 Thread Avihai Horon
On 12/02/2024 16:49, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/12/24 09:36, Avihai Horon wrote: Hi, Cedric On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The purpose is to record

Re: [PATCH 11/14] vfio: Extend vfio_set_migration_error() with Error* argument

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress. To improve error reporting, add a new Error* argument to also set the

Re: [PATCH 09/14] vfio: Add Error** argument to .vfio_save_config() handler

2024-02-12 Thread Avihai Horon
On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments Use vmstate_save_state_with_err() to improve error reporting in the callers. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/migration.c |

Re: [PATCH 08/14] vfio: Use new Error** argument in vfio_save_setup()

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments Add an Error** argument to vfio_migration_set_state() and adjust callers, including vfio_save_setup(). The error will be propagated up to qemu_savevm_state_setup() where the

Re: [PATCH 04/14] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-02-12 Thread Avihai Horon
Hi Cedric, On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The .save_setup() handler has now an Error** argument that we can use to propagate errors reported by the .log_global_start() handler. Do that for the RAM.

Re: [PATCH 03/14] memory: Add Error** argument to .log_global*() handlers

2024-02-12 Thread Avihai Horon
Hi Cedric, On 09/02/2024 12:14, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/8/24 06:48, Peter Xu wrote: On Wed, Feb 07, 2024 at 02:33:36PM +0100, Cédric Le Goater wrote: @@ -2936,14 +2940,14 @@ void memory_global_dirty_log_start(unsigned int flags)

Re: [PATCH 01/14] migration: Add Error** argument to .save_setup() handler

2024-02-12 Thread Avihai Horon
Hi, Cedric On 07/02/2024 15:33, Cédric Le Goater wrote: External email: Use caution opening links or attachments The purpose is to record a potential error in the migration stream if qemu_savevm_state_setup() fails. Most of the current .save_setup() handlers can be modified to use the Error

Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place

2024-02-08 Thread Avihai Horon
On 06/02/2024 12:25, Peter Xu wrote: External email: Use caution opening links or attachments On Tue, Jan 30, 2024 at 08:44:19PM +0200, Avihai Horon wrote: On 30/01/2024 7:57, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Jan 29, 2024 at 02:20:35PM

Re: [PATCH 1/2] migration/multifd: Cleanup TLS iochannel referencing

2024-02-08 Thread Avihai Horon
On 08/02/2024 5:51, pet...@redhat.com wrote: External email: Use caution opening links or attachments From: Peter Xu Commit a1af605bd5 ("migration/multifd: fix hangup with TLS-Multifd due to blocking handshake") introduced a thread for TLS channels, which will resolve the issue on blocking

Re: [PATCH v2 5/6] migration/multifd: Unify multifd and TLS connection paths

2024-02-06 Thread Avihai Horon
On 06/02/2024 16:30, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 05/02/2024 21:49, Fabiano Rosas wrote: External email: Use caution opening links or attachments During multifd channel creation (multifd_send_new_channel_async

Re: [PATCH 00/17] migration: Add new migration channel connect and TLS upgrade APIs

2024-02-06 Thread Avihai Horon
On 06/02/2024 12:04, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Jan 25, 2024 at 06:25:11PM +0200, Avihai Horon wrote: Hello, Today there are several types of migration channels that can be used during migration: main migration channel, multifd channels

Re: [PATCH v2 5/6] migration/multifd: Unify multifd and TLS connection paths

2024-02-06 Thread Avihai Horon
On 05/02/2024 21:49, Fabiano Rosas wrote: External email: Use caution opening links or attachments During multifd channel creation (multifd_send_new_channel_async) when TLS is enabled, the multifd_channel_connect function is called twice, once to create the TLS handshake thread and another

Re: [PATCH 5/5] migration/multifd: Add a synchronization point for channel creation

2024-02-05 Thread Avihai Horon
On 05/02/2024 8:20, Peter Xu wrote: External email: Use caution opening links or attachments On Fri, Feb 02, 2024 at 04:11:28PM -0300, Fabiano Rosas wrote: It is possible that one of the multifd channels fails to be created at multifd_new_send_channel_async() while the rest of the channel

Re: [PATCH 00/14] migration/multifd: Refactor ->send_prepare() and cleanups

2024-02-01 Thread Avihai Horon
On 01/02/2024 7:47, Peter Xu wrote: External email: Use caution opening links or attachments On Wed, Jan 31, 2024 at 07:49:51PM -0300, Fabiano Rosas wrote: pet...@redhat.com writes: From: Peter Xu This patchset contains quite a few refactorings to current multifd: - It picked up

Re: [PATCH 05/17] migration/multifd: Wait for multifd channels creation before proceeding

2024-01-31 Thread Avihai Horon
On 30/01/2024 23:32, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 29/01/2024 16:34, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: Currently, multifd channels are created

Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place

2024-01-30 Thread Avihai Horon
On 30/01/2024 7:57, Peter Xu wrote: External email: Use caution opening links or attachments On Mon, Jan 29, 2024 at 02:20:35PM +0200, Avihai Horon wrote: On 29/01/2024 6:17, Peter Xu wrote: External email: Use caution opening links or attachments On Sun, Jan 28, 2024 at 05:43:52PM +0200

Re: [PATCH 05/17] migration/multifd: Wait for multifd channels creation before proceeding

2024-01-30 Thread Avihai Horon
On 29/01/2024 16:34, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: Currently, multifd channels are created asynchronously without waiting for their creation -- migration simply proceeds and may wait in multifd_send_sync_main(), which

Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place

2024-01-29 Thread Avihai Horon
On 29/01/2024 6:17, Peter Xu wrote: External email: Use caution opening links or attachments On Sun, Jan 28, 2024 at 05:43:52PM +0200, Avihai Horon wrote: On 25/01/2024 22:57, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: The commit

Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place

2024-01-28 Thread Avihai Horon
On 25/01/2024 22:57, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: The commit in the fixes line moved multifd thread creation to a different location, but forgot to move the p->running = true assignment as well. Thus, p->running

[PATCH 00/17] migration: Add new migration channel connect and TLS upgrade APIs

2024-01-25 Thread Avihai Horon
. Thanks for reviewing. Avihai Horon (17): migration: Fix logic of channels and transport compatibility check migration: Move local_err check in migration_ioc_process_incoming() migration: Rename default_channel to main_channel migration/multifd: Set p->running = true in the right pl

[PATCH 10/17] migration/postcopy: Use the new TLS upgrade API for preempt channel

2024-01-25 Thread Avihai Horon
Use the new TLS upgrade API for postcopy preempt channel and remove old TLS code. Signed-off-by: Avihai Horon --- migration/postcopy-ram.c | 20 +++- migration/trace-events | 1 - 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/migration/postcopy-ram.c b

[PATCH 12/17] migration/multifd: Consolidate TLS/non-TLS multifd channel error flow

2024-01-25 Thread Avihai Horon
The error flows of TLS and non-TLS multifd channel creation are similar yet they don't share code. Consolidate the flows by using multifd_new_send_channel_cleanup() also in TLS error flow. Signed-off-by: Avihai Horon --- migration/multifd.c | 15 --- 1 file changed, 4 insertions

[PATCH 13/17] migration: Store MigrationAddress in MigrationState

2024-01-25 Thread Avihai Horon
This will be used in the new migration channel creation API in the following patches. Signed-off-by: Avihai Horon --- migration/migration.h | 3 +++ migration/migration.c | 6 ++ 2 files changed, 9 insertions(+) diff --git a/migration/migration.h b/migration/migration.h index 17972dac34

[PATCH 17/17] migration/postcopy: Use the new migration channel connect API for postcopy preempt

2024-01-25 Thread Avihai Horon
Use the new migration channel connect API for postcopy preempt and remove old channel connect code. Signed-off-by: Avihai Horon --- migration/postcopy-ram.h | 2 +- migration/postcopy-ram.c | 105 +++ 2 files changed, 42 insertions(+), 65 deletions(-) diff

[PATCH 07/17] migration/tls: Add new migration channel TLS upgrade API

2024-01-25 Thread Avihai Horon
to TLS upgrade migration channels. This will make the code clearer and avoid duplicate code such as TLS handshake, trace handling and threading. Signed-off-by: Avihai Horon --- migration/tls.h| 27 migration/tls.c| 72

[PATCH 14/17] migration: Rename migration_channel_connect()

2024-01-25 Thread Avihai Horon
The following patches will add a new API to create migration channels with the same name, so rename migration_channel_connect() to migration_channel_connect_main(). No functional changes intended. Signed-off-by: Avihai Horon --- migration/channel.h | 6 ++ migration/channel.c | 10

[PATCH 02/17] migration: Move local_err check in migration_ioc_process_incoming()

2024-01-25 Thread Avihai Horon
local_err in migration_ioc_process_incoming() is used only in the multifd if branch. Move the local_err check under the multifd branch, where it is actually used. Signed-off-by: Avihai Horon --- migration/migration.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

  1   2   3   4   5   6   >