[PATCH v4 25/25] vfio: Extend vfio_set_migration_error() with Error* argument

2024-03-06 Thread Cédric Le Goater
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 on the migration stream, if a migration is progress. Signed-off-by: Cédric Le Goater --- Changes in v4

[PATCH v4 00/25] migration: Improve error reporting

2024-03-06 Thread Cédric Le Goater
adjustments in callers. - new MEMORY_LISTENER_CALL_LOG_GLOBAL macro for .log_global*() handlers - Handled SETUP state when migration terminates - Modified memory_get_xlat_addr() to take an Error** argument - Various refinements on error handling Cédric Le Goater (25): migration: Report error when

[PATCH v4 08/25] migration: Always report an error in ram_save_setup()

2024-03-06 Thread Cédric Le Goater
This will prepare ground for future changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, ram_save_setup() sets a new error. Signed-off-by: Cédric Le Goater --- Changes in v4: - Fixed test on error returned by qemu_fflush() migration/ram.c

[PATCH v4 21/25] vfio: Reverse test on vfio_get_dirty_bitmap()

2024-03-06 Thread Cédric Le Goater
It will simplify the changes coming after. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 5b2e6a179cdd5f8ca5be84b7097661e96b391456

[PATCH v4 16/25] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-03-06 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v3: - Use error_setg_errno() in vfio_legacy_set_dirty_page_tracking() include

[PATCH v4 03/25] migration: Add documentation for SaveVMHandlers

2024-03-06 Thread Cédric Le Goater
The SaveVMHandlers structure is still in use for complex subsystems and devices. Document the handlers since we are going to modify a few later. Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- include/migration/register.h | 263 +++ 1 file changed, 237

[PATCH v4 05/25] s390/stattrib: Add Error** argument to set_migrationmode() handler

2024-03-06 Thread Cédric Le Goater
-by: Cédric Le Goater --- Changes in v4: - Fixed state name printed out in error returned by vfio_save_setup() - Fixed test on error returned by qemu_file_get_error() include/hw/s390x/storage-attributes.h | 2 +- hw/s390x/s390-stattrib-kvm.c | 12 ++-- hw/s390x/s390-stattrib.c

[PATCH v4 01/25] migration: Report error when shutdown fails

2024-03-06 Thread Cédric Le Goater
This will help detect issues regarding I/O channels usage. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- migration/qemu-file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c

[PATCH v4 24/25] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-03-06 Thread Cédric Le Goater
vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index bd48f2ee472a5230c2c84bff829dae1e217db33f

[PATCH v4 11/25] migration: Add Error** argument to .save_setup() handler

2024-03-06 Thread Cédric Le Goater
Cc: Halil Pasic Cc: Thomas Huth Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: John Snow Cc: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- Changes in v3: - Made sure an error is always set

[PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-06 Thread Cédric Le Goater
the cleanup to preserve the error reported by .save_setup() handlers. Since the previous behavior was to ignore errors at this step of migration, this change should be examined closely to check that cleanups are still correctly done. Signed-off-by: Cédric Le Goater --- Changes in v4

[PATCH v4 23/25] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-03-06 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 +- include/hw/vfio/vfio-container-base.h | 17 +++- hw/vfio/common.c | 59 ++- hw/vfio

[PATCH v4 15/25] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-03-06 Thread Cédric Le Goater
-off-by: Cédric Le Goater --- migration/ram.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 397b4c0f218a66d194e44f9c5f9fe8e9885c48b6..1e48eee769d314321e31ea71855f4b49a78b6a13 100644 --- a/migration/ram.c +++ b

[PATCH v4 20/25] vfio: Add Error** argument to .vfio_save_config() handler

2024-03-06 Thread Cédric Le Goater
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 Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 25

[PATCH v4 12/25] migration: Add Error** argument to .load_setup() handler

2024-03-06 Thread Cédric Le Goater
This will be useful to report errors at a higher level, mostly in VFIO today. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v3: - ERRP_GUARD() because of error_prepend use - Made sure an error is always set in case of failure

[PATCH v4 22/25] memory: Add Error** argument to memory_get_xlat_addr()

2024-03-06 Thread Cédric Le Goater
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 Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15 ++- hw/vfio/common.c | 13 + hw/vi

[PATCH v4 17/25] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-03-06 Thread Cédric Le Goater
it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v4: - Dropped log_global_stop() and log_global_sync() changes Changes in v3: - Use error_setg_errno() in vfio_devices_dma_logging_start() - ERRP_GUARD() because of error_prepend use

[PATCH v4 13/25] memory: Add Error** argument to .log_global_start() handler

2024-03-06 Thread Cédric Le Goater
: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: David Hildenbrand Signed-off-by: Cédric Le Goater --- Changes in v4: - Dropped log_global_stop() and log_global_sync() changes - Dropped MEMORY_LISTENER_CALL_LOG_GLOBAL

[PATCH v4 02/25] migration: Remove SaveStateHandler and LoadStateHandler typedefs

2024-03-06 Thread Cédric Le Goater
They are only used once. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- include/migration/register.h | 4 ++-- include/qemu/typedefs.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/migration/register.h b/include

[PATCH v4 18/25] vfio: Add Error** argument to vfio_devices_dma_logging_stop()

2024-03-06 Thread Cédric Le Goater
This improves error reporting in the log_global_stop() VFIO handler. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v4: - Dropped log_global_stop() and log_global_sync() changes Changes in v3: - Use error_setg_errno

[PATCH v4 07/25] migration: Always report an error in block_save_setup()

2024-03-06 Thread Cédric Le Goater
This will prepare ground for future changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, block_save_setup() always sets a new error. Cc: Stefan Hajnoczi Signed-off-by: Cédric Le Goater --- Changes in v4: - Added an error when bdrv_nb_sectors

[PATCH v4 14/25] memory: Add Error** argument to the global_dirty_log routines

2024-03-06 Thread Cédric Le Goater
Cc: Paolo Bonzini Cc: David Hildenbrand Cc: Hyman Huang Reviewed-by: Hyman Huang Signed-off-by: Cédric Le Goater --- Changes in v4: - Dropped log_global_stop() and log_global_sync() changes include/exec/memory.h | 5 - hw/i386/xen/xen-hvm.c | 2 +- migration/dirtyr

[PATCH v4 09/25] migration: Add Error** argument to vmstate_save()

2024-03-06 Thread Cédric Le Goater
This will prepare ground for future changes adding an Error** argument to qemu_savevm_state_setup(). Reviewed-by: Prasad Pandit Signed-off-by: Cédric Le Goater --- migration/savevm.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/migration

[PATCH v4 06/25] vfio: Always report an error in vfio_save_setup()

2024-03-06 Thread Cédric Le Goater
This will prepare ground for future 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. Reviewed-by: Fabiano Rosas Signed-off-by: Cédric Le Goater --- Changes in v4: - Fixed state name printed out

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

2024-03-06 Thread Cédric Le Goater
On 3/6/24 11:16, Avihai Horon wrote: 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

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

2024-03-06 Thread Cédric Le Goater
On 3/6/24 10: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, vfio_save_setup

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

2024-03-05 Thread Cédric Le Goater
On 3/5/24 08:57, Peter Xu wrote: On Mon, Mar 04, 2024 at 01:28:32PM +0100, Cédric Le Goater wrote: @@ -2936,15 +2975,22 @@ void memory_global_dirty_log_start(unsigned int flags) trace_global_dirty_changed(global_dirty_tracking); if (!old_flags

Re: [PATCH v3 04/26] migration: Always report an error in ram_save_setup()

2024-03-05 Thread Cédric Le Goater
On 3/5/24 06:29, Prasad Pandit wrote: On Mon, 4 Mar 2024 at 18:01, Cédric Le Goater wrote: This will prepare ground for futur changes adding an Error** argument * futur -> future Fixed in all first 5 patches. +ret = qemu_fflush(f); +if (ret) { * if (ret) -> if (ret <

Re: [PATCH v3 04/26] migration: Always report an error in ram_save_setup()

2024-03-05 Thread Cédric Le Goater
On 3/4/24 22:30, Fabiano Rosas wrote: Cédric Le Goater writes: This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, ram_save_setup() sets a new error. Signed-off-by: Cédric Le Goater --- migration/ram.c

Re: [PATCH v3 00/26] migration: Improve error reporting

2024-03-05 Thread Cédric Le Goater
On 3/5/24 09:06, Peter Xu wrote: On Mon, Mar 04, 2024 at 01:28:18PM +0100, Cédric Le Goater wrote: migration: Report error when shutdown fails migration: Remove SaveStateHandler and LoadStateHandler typedefs migration: Add documentation for SaveVMHandlers migration: Do not call

Re: [PATCH v3 03/26] migration: Always report an error in block_save_setup()

2024-03-05 Thread Cédric Le Goater
On 3/4/24 22:04, Fabiano Rosas wrote: Cédric Le Goater writes: This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, block_save_setup() always sets a new error. Cc: Stefan Hajnoczi Signed-off-by: Cédric Le

Re: [PATCH v3 10/26] migration: Move cleanup after after error reporting in qemu_savevm_state_setup()

2024-03-04 Thread Cédric Le Goater
On 3/5/24 04:32, Peter Xu wrote: On Mon, Mar 04, 2024 at 01:28:28PM +0100, Cédric Le Goater wrote: This will help preserving the error set by .save_setup() handlers. Signed-off-by: Cédric Le Goater IIUC this is about the next patch. I got fully confused before reading into the next one

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

2024-03-04 Thread Cédric Le Goater
On 3/4/24 21:49, Fabiano Rosas wrote: Cédric Le Goater writes: 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 Rules section in qapi/error.h. Cc

Re: [PATCH v7 2/2] hw/acpi: Implement the SRAT GI affinity structure

2024-03-04 Thread Cédric Le Goater
On 3/5/24 06:59, Ankit Agrawal wrote: One thing I forgot. Please add a test.  tests/qtest/bios-tables-test.c + relevant table dumps. Here I need to add a test that creates a vfio-pci device and numa nodes and link using the acpi-generic-initiator object. One thing here is that the -device

Re: [PATCH v7 7/9] misc: Add a pca9554 GPIO device model

2024-03-04 Thread Cédric Le Goater
but the model does not yet support this. Reviewed-by: Cédric Le Goater Signed-off-by: Glenn Miles --- No changes from previous version   MAINTAINERS    |  10 +-   hw/misc/pca9554.c  | 328 + Not a huge deal, but this should have been in hw/gpio

Re: [PATCH v2 0/9] Add AST2700 support

2024-03-04 Thread Cédric Le Goater
Hello Jamin, On 3/4/24 10:29, Jamin Lin wrote: Changes from v1: The patch series supports WDT, SDMC, SMC, SCU, SLI and INTC for AST2700 SoC. Changes from v2: - replace is_aarch64 with is_bus64bit for sdmc patch review. - fix incorrect dram size for AST2700 Test steps: 1. Download openbmc

Re: [PATCH v2 7/9] aspeed/soc: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
On 3/4/24 10:29, Jamin Lin wrote: Initial definitions for a simple machine using an AST2700 SOC (Cortex-a35 CPU). AST2700 SOC and its interrupt controller are too complex to handle in the common Aspeed SoC framework. We introduce a new ast2700 class with instance_init and realize handlers.

Re: [PATCH v2 8/9] aspeed: Add an AST2700 eval board

2024-03-04 Thread Cédric Le Goater
amc->num_cs= 2; +amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON | ASPEED_MAC2_ON; +amc->uart_default = ASPEED_DEV_UART12; +mc->default_ram_size = 1 * GiB; This seems low. What's the size on real HW ? Anyhow, Reviewed-by: Cédric Le Goater Thanks, C. +a

Re: [PATCH v2 5/9] aspeed/scu: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
] and the pclk divider selection of SCU is defined in SCU280[25:23]. Both of them are not compatible AST2600 SOCs, adds a get_apb_freq function and trace-event for AST2700 SCU and SCUIO. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater Thanks, C. --- hw/misc

Re: [PATCH v2 4/9] aspeed/smc: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
On 3/4/24 10:29, Jamin Lin wrote: AST2700 fmc/spi controller's address decoding unit is 64KB and only bits [31:16] are used for decoding. Introduce seg_to_reg and reg_to_seg handlers for ast2700 fmc/spi controller. In addition, adds ast2700 fmc, spi0, spi1, and spi2 class init handler. AST2700

Re: [PATCH v2 3/9] aspeed/sdmc: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
On 3/4/24 10:29, Jamin Lin wrote: The SDRAM memory controller(DRAMC) controls the access to external DDR4 and DDR5 SDRAM and power up to DDR4 and DDR5 PHY. The DRAM memory controller of AST2700 is not backward compatible to previous chips such AST2600, AST2500 and AST2400. Max memory is now

Re: [PATCH v2 2/9] aspeed/sli: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
On 3/4/24 10:29, Jamin Lin wrote: AST2700 SLI engine is designed to accelerate the throughput between cross-die connections. It have CPU_SLI at CPU die and IO_SLI at IO die. Introduce new ast2700_sli and ast2700_sliio class with instance_init and realize handlers. This should say that the

Re: [PATCH v2 1/9] aspeed/wdt: Add AST2700 support

2024-03-04 Thread Cédric Le Goater
) of .. increase ... ast2700 model. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater Thanks, C. --- hw/watchdog/wdt_aspeed.c | 24 include/hw/watchdog/wdt_aspeed.h | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff

Re: [PATCH v2 08/21] memory: Add Error** argument to .log_global*() handlers

2024-03-04 Thread Cédric Le Goater
Hello Peter, I missed this email last week, so I might not have addressed your comments. sorry about that. On 2/29/24 06:29, Peter Xu wrote: On Tue, Feb 27, 2024 at 07:03:32PM +0100, Cédric Le Goater wrote: Modify all log_global*() handlers to take an Error** parameter and return a bool

[PATCH v3 24/26] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-03-04 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 +- include/hw/vfio/vfio-container-base.h | 17 +++- hw/vfio/common.c | 59 ++- hw/vfio

[PATCH v3 21/26] vfio: Add Error** argument to .vfio_save_config() handler

2024-03-04 Thread Cédric Le Goater
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 Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 25

[PATCH v3 05/26] migration: Add Error** argument to vmstate_save()

2024-03-04 Thread Cédric Le Goater
This will prepare ground for futur changes adding an Error** argument to qemu_savevm_state_setup(). Signed-off-by: Cédric Le Goater --- migration/savevm.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c

[PATCH v3 16/26] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-03-04 Thread Cédric Le Goater
-off-by: Cédric Le Goater --- migration/ram.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 3d9c08cfae8a59031a7c1b3c70721c2a90daceba..b12a2f24335be4b2b009aabfe431f4e5a6b4d9a9 100644 --- a/migration/ram.c +++ b

[PATCH v3 18/26] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-03-04 Thread Cédric Le Goater
it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v3: - Use error_setg_errno() in vfio_devices_dma_logging_start() - ERRP_GUARD() because of error_prepend use in vfio_listener_log_global_start() hw/vfio/common.c | 23 +++ 1 file

[PATCH v3 22/26] vfio: Reverse test on vfio_get_dirty_bitmap()

2024-03-04 Thread Cédric Le Goater
It will simplify the changes coming after. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 8fa232538d482f094643e0f1601b8ebe25fe077f

[PATCH v3 23/26] memory: Add Error** argument to memory_get_xlat_addr()

2024-03-04 Thread Cédric Le Goater
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 Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15 ++- hw/vfio/common.c | 13 + hw/vi

[PATCH v3 26/26] vfio: Extend vfio_set_migration_error() with Error* argument

2024-03-04 Thread Cédric Le Goater
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 on the migration stream, if a migration is progress. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c

[PATCH v3 11/26] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-04 Thread Cédric Le Goater
was to ignore errors at this step of migration, this change should be examined closely to check that cleanups are still correctly done. Signed-off-by: Cédric Le Goater --- Changes in v3: - Set migration state to MIGRATION_STATUS_FAILED - Fixed error handling to be done under lock

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

2024-03-04 Thread Cédric Le Goater
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. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 15 --- 1 file changed, 12 insertions(+), 3

[PATCH v3 20/26] vfio: Use new Error** argument in vfio_save_setup()

2024-03-04 Thread Cédric Le Goater
under the migration stream if a migration is in progress. Signed-off-by: Cédric Le Goater --- Changes in v3: - Use error_setg_errno() in vfio_save_setup() - Made sure an error is always set in case of failure in vfio_load_setup() hw/vfio/migration.c | 67

[PATCH v3 19/26] vfio: Add Error** argument to vfio_devices_dma_logging_stop()

2024-03-04 Thread Cédric Le Goater
This improves error reporting in the log_global_stop() VFIO handler. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v3: - Use error_setg_errno() in vfio_devices_dma_logging_stop() hw/vfio/common.c | 19 ++- 1 file changed, 14

[PATCH v3 15/26] memory: Add Error** argument to the global_dirty_log routines

2024-03-04 Thread Cédric Le Goater
Cc: Paolo Bonzini Cc: David Hildenbrand Cc: Hyman Huang Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 10 -- hw/i386/xen/xen-hvm.c | 4 ++-- migration/dirtyrate.c | 21 + migration/ram.c | 34 ++ system/memory.c

[PATCH v3 25/26] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-03-04 Thread Cédric Le Goater
vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 4c4ccbaed10b82e7baa992770ec0ec5a6c82b757

[PATCH v3 12/26] migration: Add Error** argument to .save_setup() handler

2024-03-04 Thread Cédric Le Goater
Cc: Halil Pasic Cc: Thomas Huth Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: John Snow Cc: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v3: - Made sure an error is always set in case of failure

[PATCH v3 17/26] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-03-04 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v3: - Use error_setg_errno() in vfio_legacy_set_dirty_page_tracking() include

[PATCH v3 03/26] migration: Always report an error in block_save_setup()

2024-03-04 Thread Cédric Le Goater
This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, block_save_setup() always sets a new error. Cc: Stefan Hajnoczi Signed-off-by: Cédric Le Goater --- migration/block.c | 18 +- 1 file changed

[PATCH v3 08/26] migration: Add documentation for SaveVMHandlers

2024-03-04 Thread Cédric Le Goater
The SaveVMHandlers structure is still in use for complex subsystems and devices. Document the handlers since we are going to modify a few later. Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v3: - VMState -> VMStateDescription - Rephrased .save_live_complete_prec

[PATCH v3 00/26] migration: Improve error reporting

2024-03-04 Thread Cédric Le Goater
for .log_global*() handlers - Handled SETUP state when migration terminates - Modified memory_get_xlat_addr() to take an Error** argument - Various refinements on error handling Cédric Le Goater (26): s390/stattrib: Add Error** argument to set_migrationmode() handler vfio: Always report an error

[PATCH v3 06/26] migration: Report error when shutdown fails

2024-03-04 Thread Cédric Le Goater
This will help detect issues regarding I/O channels usage. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- migration/qemu-file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c

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

2024-03-04 Thread Cédric Le Goater
in memory_global_dirty_log_start() behavior as it will return as soon as an error is detected. Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: David Hildenbrand Signed-off-by: Cédric Le Goater --- Changes in v3: - Fixed re

[PATCH v3 13/26] migration: Add Error** argument to .load_setup() handler

2024-03-04 Thread Cédric Le Goater
This will be useful to report errors at a higher level, mostly in VFIO today. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v3: - ERRP_GUARD() because of error_prepend use - Made sure an error is always set in case of failure

[PATCH v3 04/26] migration: Always report an error in ram_save_setup()

2024-03-04 Thread Cédric Le Goater
This will prepare ground for futur changes adding an Error** argument to the save_setup() handler. We need to make sure that on failure, ram_save_setup() sets a new error. Signed-off-by: Cédric Le Goater --- migration/ram.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff

[PATCH v3 07/26] migration: Remove SaveStateHandler and LoadStateHandler typedefs

2024-03-04 Thread Cédric Le Goater
They are only used once. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- include/migration/register.h | 4 ++-- include/qemu/typedefs.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/migration/register.h b/include

[PATCH v3 10/26] migration: Move cleanup after after error reporting in qemu_savevm_state_setup()

2024-03-04 Thread Cédric Le Goater
This will help preserving the error set by .save_setup() handlers. Signed-off-by: Cédric Le Goater --- migration/savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 31ce9391d49c825d4ec835e26ac0246e192783a0

[PATCH v3 09/26] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error

2024-03-04 Thread Cédric Le Goater
re calling the notifiers. Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- migration/savevm.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index c3642fac9dad3e314fe3fd5058889db1d2cecd47..31ce9391d49c825d4ec835e26ac024

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

2024-03-04 Thread Cédric Le Goater
-by: Cédric Le Goater --- include/hw/s390x/storage-attributes.h | 2 +- hw/s390x/s390-stattrib-kvm.c | 12 ++-- hw/s390x/s390-stattrib.c | 14 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/include/hw/s390x/storage-attributes.h b/include

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

2024-03-04 Thread Cédric Le Goater
On 3/4/24 10:05, Avihai Horon wrote: Hi Cedric, A few nits below. Just in time for v3 I was about to send ! I will include these suggestions. Thanks, C. On 27/02/2024 20:03, Cédric Le Goater wrote: External email: Use caution opening links or attachments The SaveVMHandlers

Re: [PATCH] Fix typo in comment (uin32_t -> uint32_t)

2024-03-03 Thread Cédric Le Goater
On 3/2/24 08:06, Zhao Liu wrote: On Fri, Mar 01, 2024 at 06:55:35PM +, Frediano Ziglio wrote: Date: Fri, 1 Mar 2024 18:55:35 + From: Frediano Ziglio Subject: [PATCH] Fix typo in comment (uin32_t -> uint32_t) Signed-off-by: Frediano Ziglio --- hw/vfio/pci.h | 2 +- 1 file changed,

Re: [PATCH v1 0/5] hw/ppc: SPI model

2024-03-01 Thread Cédric Le Goater
Chalapathi, On 3/1/24 17:17, Chalapathi V wrote: Hello, I would greatly appreciate the review comments/suggestions on PATCH V1. Thank You and Regards, I didn't forget but I lacked the time in this release cycle. Sorry about that. I have one quick comment though. There are already a few

Re: [PATCH V4 10/14] migration: stop vm for cpr

2024-03-01 Thread Cédric Le Goater
On 3/1/24 02:28, Peter Xu wrote: On Thu, Feb 29, 2024 at 10:21:14AM -0500, Steven Sistare wrote: On 2/25/2024 9:08 PM, Peter Xu wrote: On Thu, Feb 22, 2024 at 09:28:36AM -0800, Steve Sistare wrote: When migration for cpr is initiated, stop the vm and set state RUN_STATE_FINISH_MIGRATE before

Re: [PATCH 11/17] hw/vfio/platform: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index a8d9b7da633e..dcd2365fb353 100644 --- a/hw/vfio/plat

Re: [PATCH 10/17] hw/vfio/pci: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
ERRP_GUARD() at their beginning. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 09/17] hw/vfio/pci-quirks: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/pci-quirks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci-qu

Re: [PATCH 08/17] hw/vfio/iommufd: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/iommufd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 9bfddc136089..7baf49e6ee9e 100644 --- a/hw/vfi

Re: [PATCH 07/17] hw/vfio/helpers: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/helpers.c | 3 +++ 1 file changed, 3 insertions(+)

Re: [PATCH 06/17] hw/vfio/container: Fix missing ERRP_GUARD() for error_prepend()

2024-02-29 Thread Cédric Le Goater
uot;). Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH v2 11/21] migration: Fix migration termination

2024-02-29 Thread Cédric Le Goater
On 2/29/24 06:34, Peter Xu wrote: On Tue, Feb 27, 2024 at 07:03:35PM +0100, Cédric Le Goater wrote: Handle migration termination when in SETUP state. This can happen if qemu_savevm_state_setup() fails. Signed-off-by: Cédric Le Goater --- migration/migration.c | 4 1 file changed, 4

Re: [PATCH v2 06/21] migration: Add Error** argument to .save_setup() handler

2024-02-29 Thread Cédric Le Goater
On 2/29/24 07:32, Markus Armbruster wrote: Cédric Le Goater writes: 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 argument instead of managing their own

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

2024-02-29 Thread Cédric Le Goater
On 2/29/24 05:10, Peter Xu wrote: On Tue, Feb 27, 2024 at 07:03:27PM +0100, Cédric Le Goater wrote: 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: Cédric Le Goater Reviewed

Re: [PATCH V4 12/14] vfio: allow cpr-reboot migration if suspended

2024-02-29 Thread Cédric Le Goater
the guest before initiating cpr, such as by issuing guest-suspend-ram to the qemu guest agent. Relax the vfio blocker so it does not apply to cpr, and add a notifier that verifies the guest is suspended. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater Thanks, C. --- hw

Re: [PATCH V4 11/14] vfio: register container for cpr

2024-02-29 Thread Cédric Le Goater
, Error **errp); +int vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp); Should we return bool since we have an errp ? the returned value is not an errno AFAICT. Anyhow, Reviewed-by: Cédric Le Goater Thanks, C. +void vfio_cpr_unregister_container(VFIOContaine

Re: [PATCH v1 8/8] aspeed: Add an AST2700 eval board

2024-02-29 Thread Cédric Le Goater
Hello Jamin, I tried to send the patch series to support AST2700 but I encountered some patches were rejected by server IP 211.20.114.70. Error Log: qemu-devel@nongnu.org eggs.gnu.org Remote Server returned '550-[SPF] 211.20.114.70 is not allowed to send mail from aspeedtech.com. 550 Please

Re: [PATCH v2] ppc/pnv: Improve pervasive topology calculation for big-core

2024-02-27 Thread Cédric Le Goater
cores (SMT8). Looks good for SMT4 and this change prepares ground SMT8. We would need a new CPU definition to activate big cores. It can come later. Reviewed-by: Cédric Le Goater Thanks, C. include/hw/ppc/pnv_chip.h | 2 +- include/hw/ppc/pnv_core.h | 1 + hw/ppc/pnv.c

[PATCH v2 08/21] memory: Add Error** argument to .log_global*() handlers

2024-02-27 Thread Cédric Le Goater
() behavior as it will return as soon as an error is detected. Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: David Hildenbrand Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15 ++-- hw/i386/xen/xen-hvm.c | 6

[PATCH v2 06/21] migration: Add Error** argument to .save_setup() handler

2024-02-27 Thread Cédric Le Goater
such changes for VFIO first. Cc: Nicholas Piggin Cc: Harsh Prateek Bora Cc: Halil Pasic Cc: Thomas Huth Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: John Snow Cc: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v2

[PATCH v2 04/21] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error

2024-02-27 Thread Cédric Le Goater
re calling the notifiers. Signed-off-by: Cédric Le Goater --- migration/savevm.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index d612c8a9020b204d5d078d5df85f0e6449c27645..51876f2ef674bb76c7e7ef96e1119a083883deac 100644 --- a

[PATCH v2 16/21] vfio: Add Error** argument to .vfio_save_config() handler

2024-02-27 Thread Cédric Le Goater
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 Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 25

[PATCH v2 11/21] migration: Fix migration termination

2024-02-27 Thread Cédric Le Goater
Handle migration termination when in SETUP state. This can happen if qemu_savevm_state_setup() fails. Signed-off-by: Cédric Le Goater --- migration/migration.c | 4 1 file changed, 4 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH v2 12/21] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-02-27 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 18 -- hw/vfio/common.c

[PATCH v2 21/21] vfio: Extend vfio_set_migration_error() with Error* argument

2024-02-27 Thread Cédric Le Goater
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 on the migration stream, if a migration is progress. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c

[PATCH v2 19/21] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-02-27 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 +- include/hw/vfio/vfio-container-base.h | 17 +++- hw/vfio/common.c | 59 ++- hw/vfio

[PATCH v2 05/21] migration: Add Error** argument to qemu_savevm_state_setup()

2024-02-27 Thread Cédric Le Goater
This prepares ground for the changes coming next which add an Error** argument to the .save_setup() handler. Callers of qemu_savevm_state_setup() now handle the error and fail earlier. This is a functional change that should be examined closely. Signed-off-by: Cédric Le Goater --- migration

[PATCH v2 20/21] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-02-27 Thread Cédric Le Goater
vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 228e8854594f3714b7c6f4fcfc5468d6b56337cb

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

2024-02-27 Thread Cédric Le Goater
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: Cédric Le Goater --- include/migration/register.h | 257 +++ 1 file changed, 231 insertions(+), 26

[PATCH v2 10/21] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-02-27 Thread Cédric Le Goater
-off-by: Cédric Le Goater --- migration/ram.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 9fb1875aad73b2fa009199bdfa8960339df7287d..23f4df4779309bbbe164c56c1436b60d65749860 100644 --- a/migration/ram.c +++ b

<    1   2   3   4   5   6   7   8   9   10   >