[PATCH for-9.1 v5 02/14] vfio: Always report an error in vfio_save_setup()

2024-03-19 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 Reviewed-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 15

[PATCH for-9.1 v5 04/14] migration: Always report an error in ram_save_setup()

2024-03-19 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. Reviewed-by: Fabiano Rosas Signed-off-by: Cédric Le Goater --- migration/ram.c | 11 ++- 1 file changed, 10

[PATCH 1/2] aspeed: Make the ast2600-a3 SoC not user creatable

2024-03-19 Thread Cédric Le Goater
Aspeed SoCs are complex devices that can not be specified on the command line. Fix that to avoid QEMU aborts. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2227 Fixes: f25c0ae1079d ("aspeed/soc: Add AST2600 support") Reported-by: Thomas Huth Signed-off-by: Cédric Le Goater -

[PATCH 2/2] aspeed: Make the ast1030-a1 SoC not user creatable

2024-03-19 Thread Cédric Le Goater
Aspeed SoCs are complex devices that can not be specified on the command line. Fix that to avoid QEMU aborts. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2227 Fixes: 356b230ed138 ("aspeed/soc : Add AST1030 support") Reported-by: Thomas Huth Signed-off-by: Cédric Le Goate

[PULL 2/3] ppc/pnv: I2C controller is not user creatable

2024-03-19 Thread Cédric Le Goater
af ("ppc/pnv: Add an I2C controller model") Cc: Glenn Miles Reported-by: Thomas Huth Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Glenn Miles Signed-off-by: Cédric Le Goater --- hw/ppc/pnv_i2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/ppc/

[PULL 0/3] for-9.0 queue

2024-03-19 Thread Cédric Le Goater
ty fix for iommufd -------- Cédric Le Goater (3): vfio/iommufd: Fix memory leak ppc/pnv: I2C controller is not user creatable aspeed/smc: Only wire flash devices at reset include/hw/block/flash.h | 2 ++ hw/arm/xlnx-ver

[PULL 1/3] vfio/iommufd: Fix memory leak

2024-03-19 Thread Cédric Le Goater
") Suggested-by: Zhenzhong Duan Reviewed-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index bafddb8f5a9433a3af6a

[PULL 3/3] aspeed/smc: Only wire flash devices at reset

2024-03-19 Thread Cédric Le Goater
2228 Fixes: 27a2c66c92ec ("aspeed/smc: Wire CS lines at reset") Reported-by: Thomas Huth Reviewed-by: Thomas Huth Tested-by: Thomas Huth [ clg: minor fixes in the commit log ] Signed-off-by: Cédric Le Goater --- include/hw/block/flash.h | 2 ++ hw/arm/xlnx-versal-virt.c | 3 ++- hw/block/

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

2024-03-19 Thread Cédric Le Goater
On 3/15/24 15:52, Peter Xu wrote: On Fri, Mar 15, 2024 at 03:21:27PM +0100, Cédric Le Goater wrote: On 3/15/24 13:20, Cédric Le Goater wrote: On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it

Re: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-19 Thread Cédric Le Goater
Hello Zhenzhong, On 2/28/24 04:58, Zhenzhong Duan wrote: HostIOMMUDevice will be inherited by two sub classes, legacy and iommufd currently. Introduce a helper function host_iommu_base_device_init to initialize it. Suggested-by: Eric Auger Signed-off-by: Zhenzhong Duan --- include/sysemu/h

[PATCH] aspeed/smc: Only wire flash devices at reset

2024-03-19 Thread Cédric Le Goater
2228 Fixes: 27a2c66c92ec ("aspeed/smc: Wire CS lines at reset") Reported-by: Thomas Huth Signed-off-by: Cédric Le Goater --- include/hw/block/flash.h | 2 ++ hw/arm/xlnx-versal-virt.c | 3 ++- hw/block/m25p80.c | 1 - hw/ssi/aspeed_smc.c | 9 + 4 files changed, 13 insert

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

2024-03-18 Thread Cédric Le Goater
On 3/16/24 03:41, Yong Huang wrote: On Wed, Mar 6, 2024 at 9:35 PM Cédric Le Goater mailto:c...@redhat.com>> wrote: Now that the log_global*() handlers take an Error** parameter and return a bool, do the same for memory_global_dirty_log_start() and memory_global_dirty_lo

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

2024-03-18 Thread Cédric Le Goater
--- a/migration/ram.c +++ b/migration/ram.c @@ -2836,18 +2836,31 @@ static void migration_bitmap_clear_discarded_pages(RAMState *rs) static void ram_init_bitmaps(RAMState *rs) { +Error *local_err = NULL; +bool ret = true; + qemu_mutex_lock_ramlist(); WITH_RCU_READ_L

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

2024-03-18 Thread Cédric Le Goater
On 3/15/24 12:34, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:29PM +0100, Cédric Le Goater wrote: Now that the log_global*() handlers take an Error** parameter and return a bool, do the same for memory_global_dirty_log_start() and memory_global_dirty_log_stop(). The error is reported in the

[PATCH v2] ppc/pnv: I2C controller is not user creatable

2024-03-18 Thread Cédric Le Goater
af ("ppc/pnv: Add an I2C controller model") Cc: Glenn Miles Reported-by: Thomas Huth Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- hw/ppc/pnv_i2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c index 4581cc5e5d4645ab3e358d

Re: [PATCH] ppc/pnv: I2C controller is not user creatable

2024-03-18 Thread Cédric Le Goater
On 3/18/24 16:53, Thomas Huth wrote: On 18/03/2024 16.44, Cédric Le Goater wrote: The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes.    $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c    qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521

Re: [PATCH] ppc/pnv: I2C controller is not user creatable

2024-03-18 Thread Cédric Le Goater
On 3/18/24 16:44, Cédric Le Goater wrote: The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes. $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip'

[PATCH] ppc/pnv: I2C controller is not user creatable

2024-03-18 Thread Cédric Le Goater
orted-by: Thomas Huth Signed-off-by: Cédric Le Goater --- hw/ppc/pnv_i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c index 4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2 100644 --- a/hw/ppc/pnv_i2c.c +++

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

2024-03-18 Thread Cédric Le Goater
On 3/15/24 12:18, Peter Xu wrote: @@ -3009,13 +3045,16 @@ static void listener_add_address_space(MemoryListener *listener, { FlatView *view; FlatRange *fr; +Error *local_err = NULL; if (listener->begin) { listener->begin(listener); } if (global_d

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

2024-03-18 Thread Cédric Le Goater
On 3/15/24 12:18, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:28PM +0100, Cédric Le Goater wrote: diff --git a/system/memory.c b/system/memory.c index a229a79988fce2aa3cb77e3a130db4c694e8cd49..3600e716149407c10a1f6bf8f0a81c2611cf15ba 100644 --- a/system/memory.c +++ b/system/memory.c

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

2024-03-18 Thread Cédric Le Goater
--- a/migration/ram.c +++ b/migration/ram.c @@ -2836,18 +2836,31 @@ static void migration_bitmap_clear_discarded_pages(RAMState *rs) static void ram_init_bitmaps(RAMState *rs) { +Error *local_err = NULL; +bool ret = true; + qemu_mutex_lock_ramlist(); WITH_RCU_READ_L

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

2024-03-15 Thread Cédric Le Goater
On 3/15/24 14:11, Peter Xu wrote: On Fri, Mar 15, 2024 at 01:20:49PM +0100, Cédric Le Goater wrote: +static void qemu_savevm_wait_unplug(MigrationState *s, int state) One more trivial comment: I'd even consider dropping "state" altogether, as this should be the only state this

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

2024-03-15 Thread Cédric Le Goater
On 3/15/24 14:09, Peter Xu wrote: On Fri, Mar 15, 2024 at 01:20:49PM +0100, Cédric Le Goater wrote: On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it ignores invalid state transitions and we&#x

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

2024-03-15 Thread Cédric Le Goater
On 3/15/24 13:20, Cédric Le Goater wrote: On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it ignores invalid state transitions and we've been using that property to deal with special states

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

2024-03-15 Thread Cédric Le Goater
On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it ignores invalid state transitions and we've been using that property to deal with special states such as POSTCOPY_PAUSED and FAILED: - Afte

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

2024-03-15 Thread Cédric Le Goater
On 3/12/24 19:28, Fabiano Rosas wrote: Peter Xu writes: On Tue, Mar 12, 2024 at 11:24:39AM -0300, Fabiano Rosas wrote: Cédric Le Goater writes: On 3/12/24 14:34, Cédric Le Goater wrote: On 3/12/24 13:32, Cédric Le Goater wrote: On 3/11/24 20:03, Fabiano Rosas wrote: Cédric Le Goater

[PATCH v2] vfio/iommufd: Fix memory leak

2024-03-14 Thread Cédric Le Goater
") Suggested-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index a75a785e90c64cdcc4d10c88d217801b3f536cdb..b9c7efb3ef11e49e189103ae6fb9

Re: [PATCH] vfio/iommufd: Fix memory leak

2024-03-14 Thread Cédric Le Goater
On 3/14/24 04:31, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Sent: Thursday, March 14, 2024 5:06 AM To: qemu-devel@nongnu.org Cc: Alex Williamson ; Cédric Le Goater ; Eric Auger ; Liu, Yi L ; Duan, Zhenzhong Subject: [PATCH] vfio/iommufd: Fix memory leak Make

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

2024-03-13 Thread Cédric Le Goater
On 3/13/24 15:18, Steven Sistare wrote: On 2/29/2024 8:28 PM, 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 a

[PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Cédric Le Goater
Make sure variable contents is freed if scanf fails. Cc: Eric Auger Cc: Yi Liu Cc: Zhenzhong Duan Fixes: CID 1540007 Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend") Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.c | 5 +++-- 1 file changed, 3 insert

Re: [PATCH] migration: cpr-reboot documentation

2024-03-13 Thread Cédric Le Goater
On 3/13/24 14:55, Steve Sistare wrote: Signed-off-by: Steve Sistare This would be good to have for 9.0. Anyhow, Reviewed-by: Cédric Le Goater Thanks, C. --- docs/devel/migration/CPR.rst | 147 ++ docs/devel/migration/features.rst | 1 + 2

Re: [PATCH for 9.0] migration: Skip only empty block devices

2024-03-12 Thread Cédric Le Goater
On 3/12/24 19:41, Stefan Hajnoczi wrote: On Tue, Mar 12, 2024 at 01:04:31PM +0100, Cédric Le Goater wrote: The block .save_setup() handler calls a helper routine init_blk_migration() which builds a list of block devices to take into account for migration. When one device is found to be empty

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

2024-03-12 Thread Cédric Le Goater
[ ...] Now VFIO allows a migration to happen without this trick. I'm wondering whether all relevant NICs can also support VFIO migrations in the future, then we can drop this tricky feature for good. Currently, VFIO migration requires a VFIO (PCI) variant driver implementing the specific ops

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

2024-03-12 Thread Cédric Le Goater
On 3/12/24 14:34, Cédric Le Goater wrote: On 3/12/24 13:32, Cédric Le Goater wrote: On 3/11/24 20:03, Fabiano Rosas wrote: Cédric Le Goater writes: On 3/8/24 15:36, Fabiano Rosas wrote: Cédric Le Goater writes: This prepares ground for the changes coming next which add an Error

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

2024-03-12 Thread Cédric Le Goater
On 3/12/24 13:32, Cédric Le Goater wrote: On 3/11/24 20:03, Fabiano Rosas wrote: Cédric Le Goater writes: On 3/8/24 15:36, Fabiano Rosas wrote: Cédric Le Goater writes: This prepares ground for the changes coming next which add an Error** argument to the .save_setup() handler. Callers of

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

2024-03-12 Thread Cédric Le Goater
On 3/11/24 21:10, Peter Xu wrote: On Mon, Mar 11, 2024 at 04:03:14PM -0300, Fabiano Rosas wrote: Cédric Le Goater writes: On 3/8/24 15:36, Fabiano Rosas wrote: Cédric Le Goater writes: This prepares ground for the changes coming next which add an Error** argument to the .save_setup

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

2024-03-12 Thread Cédric Le Goater
On 3/11/24 20:03, Fabiano Rosas wrote: Cédric Le Goater writes: On 3/8/24 15:36, Fabiano Rosas wrote: Cédric Le Goater writes: 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

Re: [PATCH for 9.0] migration: Skip only empty block devices

2024-03-12 Thread Cédric Le Goater
On 3/12/24 13:04, Cédric Le Goater wrote: The block .save_setup() handler calls a helper routine init_blk_migration() which builds a list of block devices to take into account for migration. When one device is found to be empty (sectors == 0), the loop exits and all the remaining devices are

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

2024-03-12 Thread Cédric Le Goater
On 3/12/24 12:50, Peter Xu wrote: On Tue, Mar 12, 2024 at 10:58:51AM +0100, Cédric Le Goater wrote: On 3/12/24 08:16, Cédric Le Goater wrote: On 3/11/24 21:24, Peter Xu wrote: On Fri, Mar 08, 2024 at 04:15:08PM +0800, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:15PM +0100, Cédric Le Goater

[PATCH for 9.0] migration: Skip only empty block devices

2024-03-12 Thread Cédric Le Goater
bdrv_iterate() was removed. Change that by skipping only empty devices. Cc: Markus Armbruster Suggested: Kevin Wolf Fixes: fea68bb6e9fa ("block: Eliminate bdrv_iterate(), use bdrv_next()") Signed-off-by: Cédric Le Goater --- migration/block.c | 5 - 1 file changed, 4 insert

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

2024-03-12 Thread Cédric Le Goater
On 3/12/24 08:16, Cédric Le Goater wrote: On 3/11/24 21:24, Peter Xu wrote: On Fri, Mar 08, 2024 at 04:15:08PM +0800, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:15PM +0100, Cédric Le Goater wrote: * [1-4] already queued in migration-next.    migration: Report error when shutdown fails

Re: [PATCH 08/13] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits

2024-03-12 Thread Cédric Le Goater
On 3/12/24 09:54, Nicholas Piggin wrote: On Tue Mar 12, 2024 at 6:06 PM AEST, Cédric Le Goater wrote: On 3/11/24 19:51, Nicholas Piggin wrote: Copy the pa-features arrays from spapr, adjusting slightly as described in comments. Cc: "Cédric Le Goater" Cc: "Frédéric Barrat&

Re: [PATCH 08/13] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits

2024-03-12 Thread Cédric Le Goater
On 3/11/24 19:51, Nicholas Piggin wrote: Copy the pa-features arrays from spapr, adjusting slightly as described in comments. Cc: "Cédric Le Goater" Cc: "Frédéric Barrat" Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 67 +++

Re: [PATCH 07/13] ppc/pnv: Permit ibm,pa-features set per machine variant

2024-03-12 Thread Cédric Le Goater
On 3/11/24 19:51, Nicholas Piggin wrote: This allows different pa-features for powernv8/9/10. Cc: "Cédric Le Goater" Cc: "Frédéric Barrat" Signed-off-by: Nicholas Piggin The features could be a chip class attribute instead. Thanks, C. ---

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

2024-03-12 Thread Cédric Le Goater
On 3/11/24 21:24, Peter Xu wrote: On Fri, Mar 08, 2024 at 04:15:08PM +0800, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:15PM +0100, Cédric Le Goater wrote: * [1-4] already queued in migration-next. migration: Report error when shutdown fails migration: Remove SaveStateHandler and

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

2024-03-11 Thread Cédric Le Goater
On 3/8/24 15:36, Fabiano Rosas wrote: Cédric Le Goater writes: 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 setting the migration state from

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

2024-03-11 Thread Cédric Le Goater
On 3/8/24 15:17, Peter Xu wrote: On Fri, Mar 08, 2024 at 02:55:30PM +0100, Cédric Le Goater wrote: On 3/8/24 14:39, Cédric Le Goater wrote: On 3/8/24 14:14, Cédric Le Goater wrote: On 3/8/24 13:56, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:25PM +0100, Cédric Le Goater wrote: This

Re: [PATCH v2] spapr: Tag pseries-2.1 - 2.11 machines as deprecated

2024-03-11 Thread Cédric Le Goater
On 3/11/24 18:46, Philippe Mathieu-Daudé wrote: Hi, On 14/12/23 19:17, Cédric Le Goater wrote: pseries machines before version 2.11 have undergone many changes to correct issues, mostly regarding migration compatibility. This is obfuscating the code uselessly and makes maintenance more

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

2024-03-11 Thread Cédric Le Goater
On 3/8/24 07:59, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:22PM +0100, Cédric Le Goater wrote: @@ -404,6 +403,10 @@ static int init_blk_migration(QEMUFile *f) sectors = bdrv_nb_sectors(bs); if (sectors <= 0) { Not directly relevant to this patch, but just to ment

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

2024-03-11 Thread Cédric Le Goater
On 3/11/24 08:21, Jamin Lin wrote: -Original Message- From: Cédric Le Goater Sent: Monday, March 4, 2024 10:47 PM To: Jamin Lin ; Peter Maydell ; Andrew Jeffery ; Joel Stanley ; Alistair Francis ; open list:ASPEED BMCs ; open list:All patches CC here Cc: Troy Lee ; Yunlin Tang Subject

Re: [PATCH v9 0/3] acpi: report NUMA nodes for device memory using GI

2024-03-11 Thread Cédric Le Goater
On 3/8/24 15:55, ank...@nvidia.com wrote: From: Ankit Agrawal There are upcoming devices which allow CPU to cache coherently access their memory. It is sensible to expose such memory as NUMA nodes separate from the sysmem node to the OS. The ACPI spec provides a scheme in SRAT called Generic In

Re: [PATCH v2 29/29] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-03-11 Thread Cédric Le Goater
ription in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: David Hildenbrand Cc: Thomas Huth Cc: Richard Henderson Cc: Ilya Leoshkevich Cc: qemu-s3...@nongnu.org Signed-off-by: Zhao Liu --- Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH v2 18/29] hw/vfio/ap: Fix missing ERRP_GUARD() for error_prepend()

2024-03-11 Thread Cédric Le Goater
mmit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Alex Williamson Cc: "Cédric Le Goater" Cc: Tony Krowiak Cc: Halil Pasic Cc: Jason Herne Cc: Thomas Huth Cc: qemu-s3...@nongnu.org Signed-off-by: Zhao Liu Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH v2 29/29] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()

2024-03-11 Thread Cédric Le Goater
ription in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: David Hildenbrand Cc: Thomas Huth Cc: Richard Henderson Cc: Ilya Leoshkevich Cc: qemu-s3...@nongnu.org Signed-off-by: Zhao Liu --- Reviewed-by: Cédric Le Goater Thanks, C.

[PULL 0/2] vfio queue

2024-03-10 Thread Cédric Le Goater
The following changes since commit cbccded4a2b5d685a426a437e25f67d3a375b292: Merge tag 'pull-riscv-to-apply-20240308-1' of https://github.com/alistair23/qemu into staging (2024-03-08 11:47:01 +) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-vfio-202

[PULL 1/2] vfio: register container for cpr

2024-03-10 Thread Cédric Le Goater
From: Steve Sistare Define entry points to perform per-container cpr-specific initialization and teardown. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 3 +++ hw/vfio/container.c | 11 ++- hw/vfio/cpr.c | 19

[PULL 2/2] vfio: allow cpr-reboot migration if suspended

2024-03-10 Thread Cédric Le Goater
efore 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 --- include/hw/vfio/vfio-container-base.h

Re: [PATCH] pci: Add option to disable device level INTx masking

2024-03-08 Thread Cédric Le Goater
, Reviewed-by: Cédric Le Goater Thanks, C. --- hw/pci/pci.c | 14 ++ include/hw/pci/pci.h | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 6496d027ca61..8c78326ad67f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c

Re: [PATCH V4 00/14] allow cpr-reboot for vfio

2024-03-08 Thread Cédric Le Goater
On 2/22/24 18:33, Steven Sistare wrote: Peter (and David if interested): these patches still need RB: migration: notifier error checking migration: stop vm for cpr migration: update cpr-reboot description migration: options incompatible with cpr Alex, these patches still need RB:

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

2024-03-08 Thread Cédric Le Goater
On 3/8/24 14:39, Cédric Le Goater wrote: On 3/8/24 14:14, Cédric Le Goater wrote: On 3/8/24 13:56, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:25PM +0100, Cédric Le Goater wrote: This prepares ground for the changes coming next which add an Error** argument to the .save_setup() handler

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

2024-03-08 Thread Cédric Le Goater
On 3/8/24 14:14, Cédric Le Goater wrote: On 3/8/24 13:56, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:25PM +0100, Cédric Le Goater wrote: 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

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

2024-03-08 Thread Cédric Le Goater
On 3/8/24 13:56, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:25PM +0100, Cédric Le Goater wrote: 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 setting the

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

2024-03-08 Thread Cédric Le Goater
On 3/8/24 09:15, Peter Xu wrote: On Wed, Mar 06, 2024 at 02:34:15PM +0100, Cédric Le Goater wrote: * [1-4] already queued in migration-next. migration: Report error when shutdown fails migration: Remove SaveStateHandler and LoadStateHandler typedefs migration: Add documentation

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

2024-03-08 Thread Cédric Le Goater
On 3/8/24 08:39, Eric Auger wrote: On 3/7/24 13:06, Cédric Le Goater wrote: On 3/7/24 09:09, Eric Auger wrote: Hi Cédric, On 3/6/24 14:34, Cédric Le Goater wrote: We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 09:53, Eric Auger wrote: On 3/6/24 14:34, Cédric Le Goater wrote: 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

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 10:13, Eric Auger wrote: On 3/6/24 14:34, Cédric Le Goater wrote: 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

Re: [PATCH v4 19/25] vfio: Use new Error** argument in vfio_save_setup()

2024-03-07 Thread Cédric Le Goater
On 3/7/24 10:04, Eric Auger wrote: Hi Cédric, On 3/6/24 14:34, Cédric Le Goater wrote: 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 save_setup() handler is executed

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 10:28, Eric Auger wrote: On 3/6/24 14:34, Cédric Le Goater wrote: 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

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 09:15, Eric Auger wrote: Hi Cédric, On 3/6/24 14:34, Cédric Le Goater wrote: This allows to update the Error argument of the VFIO log_global_start() handler. Errors detected when device level logging is started will be propagated up to qemu_savevm_state_setup() when the ram

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 09:09, Eric Auger wrote: Hi Cédric, On 3/6/24 14:34, Cédric Le Goater wrote: 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

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

2024-03-07 Thread Cédric Le Goater
On 3/5/24 04:38, Jamin Lin wrote: -Original Message- From: Cédric Le Goater Sent: Monday, March 4, 2024 11:54 PM To: Jamin Lin ; Peter Maydell ; Andrew Jeffery ; Joel Stanley ; Alistair Francis ; open list:ASPEED BMCs ; open list:All patches CC here Cc: Troy Lee ; Yunlin Tang Subject

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

2024-03-07 Thread Cédric Le Goater
On 3/7/24 10:53, Vladimir Sementsov-Ogievskiy wrote: On 06.03.24 16:34, Cédric Le Goater wrote: 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

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

2024-03-06 Thread Cédric Le Goater
On 3/6/24 21:51, Philippe Mathieu-Daudé wrote: On 6/3/24 14:34, Cédric Le Goater wrote: 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

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

2024-03-06 Thread Cédric Le Goater
before 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 dc1fb9c0d32bbf037471b810bd28e9361c2d7b87..63066f49f3ad5504be6d44ffd

[PATCH v4 19/25] vfio: Use new Error** argument in vfio_save_setup()

2024-03-06 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 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 --- Cha

[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
: 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 in

[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
. 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 in

[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() in

[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 to

<    9   10   11   12   13   14   15   16   17   18   >