Re: [PATCH 0/5] linux-user: clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Review would be nice; cc'ing a few people who have left their mark in git.

Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs

2023-09-29 Thread Markus Armbruster
Jonathan Cameron writes: > On Wed, 27 Sep 2023 19:13:35 + > Fan Ni wrote: > >> On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote: >> >> > Rename the version not burried in the macro to cap_h. >> The change looks good to me. Just one minor thing. why "version" get >> involve

Re: [PATCH 0/4] ui/console: multihead: fix crash, simplify logic

2023-09-29 Thread Mark Cave-Ayland
On 26/09/2023 09:00, Marc-André Lureau wrote: Hi Laszlo On Mon, Sep 25, 2023 at 7:36 PM Laszlo Ersek wrote: Has this been queued by someone? Both Gerd and Marc-André are "odd fixers", so I'm not sure who should be sending a PR with these patches (and I don't see a pending PULL at

Re: [PATCH] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX

2023-09-29 Thread Markus Armbruster
Cédric Le Goater writes: > On 9/23/23 10:25, Michael Tokarev wrote: >> 23.09.2023 10:12, Cédric Le Goater: >> >>> --- a/target/ppc/int_helper.c >>> +++ b/target/ppc/int_helper.c >>> @@ -2022,11 +2022,11 @@ void helper_vsum4ubs(CPUPPCState *env, ppc_avr_t >>> *r, ppc_avr_t *a, ppc_avr_t *b) >>>

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-29 Thread Markus Armbruster
Ani Sinha writes: >> On 29-Sep-2023, at 11:43 AM, Markus Armbruster wrote: >> >> Ani Sinha writes: >> On 29-Sep-2023, at 11:17 AM, Markus Armbruster wrote: Ani Sinha writes: > Code changes in acpi that addresses all compiler complaints coming from > enabling >

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-29 Thread Ani Sinha
> On 29-Sep-2023, at 1:32 PM, Markus Armbruster wrote: > > Ani Sinha writes: > >>> On 29-Sep-2023, at 11:43 AM, Markus Armbruster wrote: >>> >>> Ani Sinha writes: >>> > On 29-Sep-2023, at 11:17 AM, Markus Armbruster wrote: > > Ani Sinha writes: > >> Code changes i

Re: [PATCH] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX

2023-09-29 Thread Cédric Le Goater
On 9/29/23 10:00, Markus Armbruster wrote: Cédric Le Goater writes: On 9/23/23 10:25, Michael Tokarev wrote: 23.09.2023 10:12, Cédric Le Goater: --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2022,11 +2022,11 @@ void helper_vsum4ubs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_

[PATCH v2] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX

2023-09-29 Thread Cédric Le Goater
and fix such warnings : ../target/ppc/int_helper.c: In function ‘helper_vupklpx’: ../target/ppc/int_helper.c:2025:21: warning: declaration of ‘r’ shadows a parameter [-Wshadow=local] 2025 | uint8_t r = (e >> 10) & 0x1f; \ |

Re: [PATCH] hw/acpi: changes towards enabling -Wshadow=local

2023-09-29 Thread Markus Armbruster
Ani Sinha writes: > Your shadow-next has no changes. Have you not pushed to that branch? I did, but only after I was done updating patches. Intend to post my pull request shortly.

[PULL 03/56] ui: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell M

[PULL 49/56] seccomp: avoid shadowing of 'action' variable

2023-09-29 Thread Markus Armbruster
From: Daniel P. Berrangé This is confusing as one 'action' variable is used for storing a SCMP_ enum value, while the other 'action' variable is used for storing a SECCOMP_ enum value. Signed-off-by: Daniel P. Berrangé Message-ID: <20230922160644.438631-3-berra...@redhat.com> Reviewed-by: Marku

[PULL 34/56] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Remove extra 'drc_index' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘rtas_ibm_configure_connector’: ../hw/ppc/spapr_drc.c:1240:26: warning: declaration of ‘drc_index’ shadows a previous local [-Wshadow=compatible-local] 1240 |

[PULL 32/56] spapr: Clean up local variable shadowing in spapr_init_cpus()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Remove extra 'i' variable to fix this warning : ../hw/ppc/spapr.c: In function ‘spapr_init_cpus’: ../hw/ppc/spapr.c:2668:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 2668 | int i; | ^ ../hw/ppc/s

[PULL 28/56] hw/intc/openpic: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/intc/openpic.c: In function ‘openpic_gbl_write’: hw/intc/openpic.c:614:17: warning: declaration of ‘idx’ shadows a previous local [-Wshadow=compatible-local] 614 | int idx; | ^~~ hw/intc/openpic.c:568:9: note: sh

[PATCH v3 05/14] audio: commonize voice initialization

2023-09-29 Thread Paolo Bonzini
Move some mostly irrelevant code out of audio_init. Signed-off-by: Paolo Bonzini --- audio/audio.c | 19 ++- audio/audio_template.h | 9 - 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index d4263976a5b..2014a2904

[PATCH v3 03/14] audio: allow returning an error from the driver init

2023-09-29 Thread Paolo Bonzini
An error is already printed by audio_driver_init, but we can make it more precise if the driver can return an Error *. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- audio/alsaaudio.c | 2 +- audio/audio.c | 13 ++--- audio/audio_int.h | 2 +- audio/coreaud

[PULL 08/56] tcg: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: tcg/tcg.c:2551:27: error: declaration shadows a local variable [-Werror,-Wshadow] MemOp op = get_memop(oi); ^ tcg/tcg.c:2437:12: note: previous declaration is here TCGOp *op; ^ accel/tcg/tb-main

[PULL 43/56] aspeed/i2c: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Remove superfluous local 'data' variable and use the one define at the top of the routine. This fixes : ../hw/i2c/aspeed_i2c.c: In function ‘aspeed_i2c_bus_recv’: ../hw/i2c/aspeed_i2c.c:315:17: warning: declaration of ‘data’ shadows a previous local [-Wshadow=compatib

[PATCH v3 04/14] audio: return Error ** from audio_state_by_name

2023-09-29 Thread Paolo Bonzini
Remove duplicate error formatting code. Signed-off-by: Paolo Bonzini --- audio/audio-hmp-cmds.c | 6 -- audio/audio.c| 3 ++- audio/audio.h| 2 +- hw/core/qdev-properties-system.c | 16 ui/dbus.c|

[PULL 31/56] spapr: Clean up local variable shadowing in spapr_dt_cpus()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Introduce a helper routine defining one CPU device node to fix this warning : ../hw/ppc/spapr.c: In function ‘spapr_dt_cpus’: ../hw/ppc/spapr.c:812:19: warning: declaration of ‘cs’ shadows a previous local [-Wshadow=compatible-local] 812 | CPUState *cs = r

[PATCH v3 13/14] audio: forbid default audiodev backend with -nodefaults

2023-09-29 Thread Paolo Bonzini
Now that all callers support setting an audiodev, forbid using the default audiodev if -nodefaults is provided on the command line. Signed-off-by: Paolo Bonzini --- audio/audio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index f0788

[PULL 15/56] hw/arm/virt: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/arm/virt.c:821:22: error: declaration shadows a local variable [-Werror,-Wshadow] qemu_irq irq = qdev_get_gpio_in(vms->gic, ^ hw/arm/virt.c:803:13: note: previous declaration is here int irq; ^ Signed

[PATCH v3 08/14] Introduce machine property "audiodev"

2023-09-29 Thread Paolo Bonzini
From: Martin Kletzander Many machine types have default audio devices with no way to set the underlying audiodev. Instead of adding an option for each and every one of them, this new property can be used as a default during machine initialisation when creating such devices. Signed-off-by: Marti

[PULL 05/56] block/vdi: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

[PATCH 2/3] virtio-net: added replay blocker for guest_announce

2023-09-29 Thread pavel . dovgalyuk
From: Pavel Dovgalyuk This patch blocks record/replay when guest_announce is enabled, because this flag breaks loading the snapshots in deterministic execution mode. Signed-off-by: Pavel Dovgalyuk --- hw/net/virtio-net.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/net/virtio-net

[PATCH v3 01/14] ui/vnc: Require audiodev= to enable audio

2023-09-29 Thread Paolo Bonzini
If there is no audiodev do not send the audio ack in response to VNC_ENCODING_AUDIO, so that clients aren't told audio exists, and immediately drop the client if they try to send any audio control messages when audio is not advertised. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini

[PULL 17/56] hw/m68k: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/m68k/virt.c:263:13: error: declaration shadows a local variable [-Werror,-Wshadow] BOOTINFOSTR(param_ptr, BI_COMMAND_LINE, ^ hw/m68k/bootinfo.h:47:13: note: expanded from macro 'BOOTINFOSTR' int i; \ ^ hw/m68

[PULL 23/56] linux-user/strace: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: linux-user/strace.c: In function ‘print_sockaddr’: linux-user/strace.c:370:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 370 | int i; | ^ linux-user/strace.c:361:9: note: shado

[PULL 00/56] -Wshadow=local patches patches for 2023-09-29

2023-09-29 Thread Markus Armbruster
The following changes since commit 36e9aab3c569d4c9ad780473596e18479838d1aa: migration: Move return path cleanup to main migration thread (2023-09-27 13:58:02 -0400) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-shadow-2023-09-29 for you to fetch chan

[PULL 18/56] hw/microblaze: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/microblaze/petalogix_ml605_mmu.c: In function ‘petalogix_ml605_init’: hw/microblaze/petalogix_ml605_mmu.c:186:24: warning: declaration of ‘dinfo’ shadows a previous local [-Wshadow=compatible-local] 186 | DriveInfo *dinfo = drive_get(IF_M

[PULL 13/56] target/tricore: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: target/tricore/translate.c:5016:18: warning: declaration of ‘temp’ shadows a previous local [-Wshadow=compatible-local] 5016 | TCGv temp = tcg_constant_i32(const9); | ^~~~ target/tricore/translate.c:4958:10: note: sha

[PULL 12/56] target/m68k: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: target/m68k/translate.c:828:18: error: declaration shadows a local variable [-Werror,-Wshadow] TCGv tmp = tcg_temp_new(); ^ target/m68k/translate.c:801:15: note: previous declaration is here TCGv reg, tmp, result;

[PULL 25/56] softmmu/memory: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: softmmu/memory.c: In function ‘mtree_print_mr’: softmmu/memory.c:3236:27: warning: declaration of ‘ml’ shadows a previous local [-Wshadow=compatible-local] 3236 | MemoryRegionList *ml; | ^~ softmmu/memory.c:321

[PULL 07/56] qobject atomics osdep: Make a few macros more hygienic

2023-09-29 Thread Markus Armbruster
Variables declared in macros can shadow other variables. Much of the time, this is harmless, e.g.: #define _FDT(exp) \ do { \ int ret = (exp);

[PULL 24/56] sysemu/device_tree: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/mips/boston.c:472:5: error: declaration shadows a local variable [-Werror,-Wshadow] qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size); ^ include/sysemu/device_tree.h:129:13: note: expanded from macro 'qemu_fdt_setprop_cells' i

[PATCH v3 02/14] audio: Require AudioState in AUD_add_capture

2023-09-29 Thread Paolo Bonzini
From: Martin Kletzander Since all callers require a valid audiodev this function can now safely abort in case of missing AudioState. Signed-off-by: Martin Kletzander Message-ID: Signed-off-by: Paolo Bonzini --- audio/audio.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PULL 09/56] target/arm/tcg: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: target/arm/tcg/translate-m-nocp.c: In function ‘gen_M_fp_sysreg_read’: target/arm/tcg/translate-m-nocp.c:509:18: warning: declaration of ‘tmp’ shadows a previous local [-Wshadow=compatible-local] 509 | TCGv_i32 tmp = load_cpu_field(v7m.fpdscr[M_

[PATCH v3 00/14] Cleanup deprecated audio features, take 2

2023-09-29 Thread Paolo Bonzini
In this version the QEMU_AUDIO_* options go away, but it is still possible to pick a default audio backend from the list provided to --audio-drv-list. The code is still simplified a lot compared to having all the legacy parsing code and the -audio-help function. I had to keep QEMU_AUDIO_DRV=none b

[PULL 38/56] hw/acpi: changes towards enabling -Wshadow=local

2023-09-29 Thread Markus Armbruster
From: Ani Sinha Code changes in acpi that addresses all compiler complaints coming from enabling -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing other local variables or parameters. These makes the code confusing and/or adds bugs that are difficult to catch. See also

[PATCH v3 06/14] audio: simplify flow in audio_init

2023-09-29 Thread Paolo Bonzini
Merge two ifs into one. Signed-off-by: Paolo Bonzini --- audio/audio.c | 76 +-- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 2014a2904e8..e3ca5fe65ec 100644 --- a/audio/audio.c +++ b/audio/aud

[PULL 06/56] block: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

[PULL 37/56] test-throttle: don't shadow 'index' variable in do_test_accounting()

2023-09-29 Thread Markus Armbruster
From: Alberto Garcia Fixes build with -Wshadow=local Signed-off-by: Alberto Garcia Message-ID: <20230922105742.81317-1-be...@igalia.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- tests/unit/test-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 3/3] replay: fix for loading non-replay snapshots

2023-09-29 Thread pavel . dovgalyuk
From: Pavel Dovgalyuk Snapshots created in regular icount execution mode can't be loaded in recording mode, because icount value advances only by 32-bit value. This patch initializes replay icount initial value after loading the snapshot. Cc: Pizarro Solar Rafael Ulises Luzius Signed-off-by: Pa

[PATCH v3 11/14] vt82c686: Support machine-default audiodev with fallback

2023-09-29 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/mips/fuloong2e.c | 15 --- hw/ppc/pegasos2.c | 12 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index c827f615f3b..c6109633fee 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips

[PATCH v3 14/14] audio: propagate Error out of audio_driver_init

2023-09-29 Thread Paolo Bonzini
Now that all the callers of audio_init can report failure, pass the Error from audio_driver_init to audio_init instead of reporting it directly in audio_driver_init. This eliminates more complex logic that calls error_report_err and error_init, replacing it with just &error_fatal (when creating co

[PATCH 1/3] replay: improve determinism of virtio-net

2023-09-29 Thread pavel . dovgalyuk
From: Pavel Dovgalyuk virtio-net device uses bottom halves for callbacks. These callbacks should be deterministic, because they affect VM state. This patch replaces BH invocations with corresponding replay functions, making them deterministic in record/replay mode. Signed-off-by: Pavel Dovgalyuk

[PULL 41/56] hw/arm/smmuv3.c: Avoid shadowing variable

2023-09-29 Thread Markus Armbruster
From: Peter Maydell Avoid shadowing a variable in smmuv3_notify_iova(): ../../hw/arm/smmuv3.c: In function ‘smmuv3_notify_iova’: ../../hw/arm/smmuv3.c:1043:23: warning: declaration of ‘event’ shadows a previous local [-Wshadow=local] 1043 | SMMUEventInfo event = {.inval_ste_allowed = t

[PULL 22/56] util/vhost-user-server: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: util/vhost-user-server.c: In function ‘set_watch’: util/vhost-user-server.c:274:20: warning: declaration of ‘vu_fd_watch’ shadows a previous local [-Wshadow=compatible-local] 274 | VuFdWatch *vu_fd_watch = g_new0(VuFdWatch, 1); |

[PULL 04/56] block/dirty-bitmap: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: rename both the pair of parameters and the pair of local variables. While there, move the local variables to function scope. Suggested-by: Kevin

[PATCH 0/3] Record/replay patches

2023-09-29 Thread pavel . dovgalyuk
From: Pavel Dovgalyuk The set of patches include the following modifications: - fix for allowing record/replay with virtio-net - fix for loading non-replay snapshots Pavel Dovgalyuk (3): replay: improve determinism of virtio-net virtio-net: added replay blocker for guest_announce replay:

[PATCH v3 09/14] hw/arm: Support machine-default audiodev with fallback

2023-09-29 Thread Paolo Bonzini
From: Martin Kletzander Signed-off-by: Martin Kletzander Signed-off-by: Paolo Bonzini --- hw/arm/integratorcp.c | 11 ++- hw/arm/musicpal.c | 11 +-- hw/arm/nseries.c | 4 hw/arm/omap2.c| 5 + hw/arm/palm.c | 2 ++ hw/arm/realview.c | 12

[PULL 21/56] crypto/cipher-gnutls.c: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: In file included from crypto/cipher.c:140: crypto/cipher-gnutls.c.inc: In function ‘qcrypto_gnutls_cipher_encrypt’: crypto/cipher-gnutls.c.inc:116:17: warning: declaration of ‘err’ shadows a previous local [-Wshadow=compatible-local] 116 |

[PULL 01/56] migration/rdma: Fix save_page method to fail on polling error

2023-09-29 Thread Markus Armbruster
qemu_rdma_save_page() reports polling error with error_report(), then succeeds anyway. This is because the variable holding the polling status *shadows* the variable the function returns. The latter remains zero. Broken since day one, and duplicated more recently. Fixes: 2da776db4846 (rdma: cor

[PULL 36/56] spapr/drc: Clean up local variable shadowing in prop_get_fdt()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘prop_get_fdt’: ../hw/ppc/spapr_drc.c:344:21: warning: declaration of ‘name’ shadows a parameter [-Wshadow=compatible-local] 344 | const char *name = NULL; |

[PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater this fixes numerous warnings of this type : In file included from ../hw/ppc/spapr_pci.c:43: ../hw/ppc/spapr_pci.c: In function ‘spapr_dt_phb’: ../include/hw/ppc/fdt.h:18:13: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=compatible-local] 18 |

[PULL 44/56] aspeed: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Remove superfluous local 'irq' variables and use the one define at the top of the routine. This fixes warnings in aspeed_soc_ast2600_realize() such as : ../hw/arm/aspeed_ast2600.c: In function ‘aspeed_soc_ast2600_realize’: ../hw/arm/aspeed_ast2600.c:420:18: warning: de

[PATCH v3 07/14] audio: remove QEMU_AUDIO_* and -audio-help support

2023-09-29 Thread Paolo Bonzini
These have been deprecated for a long time, and the introduction of -audio in 7.1.0 has cemented the new way of specifying an audio backend's parameters. However, there is still a need for simple configuration of the audio backend in the desktop case; therefore, if no audiodev is passed to audio_i

[PATCH v3 10/14] hw/ppc: Support machine-default audiodev with fallback

2023-09-29 Thread Paolo Bonzini
From: Martin Kletzander Signed-off-by: Martin Kletzander Signed-off-by: Paolo Bonzini --- hw/ppc/prep.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index f6fd35fcb9e..137276bcb92 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -45,6 +45,7 @@ #inc

[PULL 39/56] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd()

2023-09-29 Thread Markus Armbruster
From: Peter Maydell Avoid shadowing a local variable in do_process_its_cmd(): ../../hw/intc/arm_gicv3_its.c:548:17: warning: declaration of ‘ite’ shadows a previous local [-Wshadow=compatible-local] 548 | ITEntry ite = {}; | ^~~ ../../hw/intc/arm_gicv3_its.c:518:

[PULL 19/56] hw/nios2: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/nios2/10m50_devboard.c: In function ‘nios2_10m50_ghrd_init’: hw/nios2/10m50_devboard.c:101:22: warning: declaration of ‘dev’ shadows a previous local [-Wshadow=compatible-local] 101 | DeviceState *dev = qdev_new(TYPE_NIOS2_VIC); |

[PULL 26/56] softmmu/physmem: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: softmmu/physmem.c: In function ‘cpu_physical_memory_snapshot_and_clear_dirty’: softmmu/physmem.c:916:27: warning: declaration of ‘offset’ shadows a parameter [-Wshadow=compatible-local] 916 | unsigned long offset = page % DIRTY_MEMORY_BLOCK_

[PULL 45/56] aspeed/i3c: Rename variable shadowing a local

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater to fix warning : ../hw/i3c/aspeed_i3c.c: In function ‘aspeed_i3c_realize’: ../hw/i3c/aspeed_i3c.c:1959:17: warning: declaration of ‘dev’ shadows a parameter [-Wshadow=local] 1959 | Object *dev = OBJECT(&s->devices[i]); | ^~~ ../hw/

[PULL 02/56] migration: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu Review

[PULL 20/56] net/eth: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: net/eth.c:435:20: error: declaration shadows a local variable [-Werror,-Wshadow] size_t input_size = iov_size(pkt, pkt_frags); ^ net/eth.c:413:16: note: previous declaration is here size_t input_size = iov_size(pkt, pk

[PULL 10/56] target/arm/hvf: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Per Peter Maydell analysis [*]: The hvf_vcpu_exec() function is not documented, but in practice its caller expects it to return either EXCP_DEBUG (for "this was a guest debug exception you need to deal with") or something else (presumably the intention being

[PATCH v3 12/14] audio: forbid mixing default audiodev backend and -audiodev

2023-09-29 Thread Paolo Bonzini
Now that all callers support setting an audiodev, forbid using the default audiodev if any audiodev is defined on the command line. To make the detection easier make AUD_register_card() return false on error. Signed-off-by: Martin Kletzander Signed-off-by: Paolo Bonzini --- audio/audio.c

[PULL 16/56] hw/arm/allwinner: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/arm/allwinner-r40.c:412:14: error: declaration shadows a local variable [-Werror,-Wshadow] for (int i = 0; i < AW_R40_NUM_MMCS; i++) { ^ hw/arm/allwinner-r40.c:299:14: note: previous declaration is here unsigned i; ^ Si

[PULL 14/56] hw/arm/armv7m: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/arm/armv7m.c: In function ‘armv7m_realize’: hw/arm/armv7m.c:520:27: warning: declaration of ‘sbd’ shadows a previous local [-Wshadow=compatible-local] 520 | SysBusDevice *sbd = SYS_BUS_DEVICE(&s->bitband[i]); |

[PULL 27/56] hw/core/machine: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: hw/core/machine.c: In function ‘machine_initfn’: hw/core/machine.c:1081:17: warning: declaration of ‘obj’ shadows a parameter [-Wshadow=compatible-local] 1081 | Object *obj = OBJECT(ms); | ^~~ hw/core/machine.c:1065:36:

[PULL 30/56] pnv/psi: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater to fix : ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’: ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ shadows a parameter [-Wshadow=compatible-local] 741 | hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_CI_64K);

[PULL 35/56] spapr/pci: Clean up local variable shadowing in spapr_phb_realize()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Rename SysBusDevice variable to avoid this warning : ../hw/ppc/spapr_pci.c: In function ‘spapr_phb_realize’: ../hw/ppc/spapr_pci.c:1872:24: warning: declaration of ‘s’ shadows a previous local [-Wshadow=local] 1872 | SpaprPhbState *s; |

[PULL 33/56] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path()

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater Rename PCIDevice variable to avoid this warning : ../hw/ppc/spapr.c: In function ‘spapr_get_fw_dev_path’: ../hw/ppc/spapr.c:3217:20: warning: declaration of ‘pcidev’ shadows a previous local [-Wshadow=compatible-local] 3217 | PCIDevice *pcidev = CAST(PCIDev

[PULL 47/56] intel_iommu: Fix shadow local variables on "size"

2023-09-29 Thread Markus Armbruster
From: Peter Xu This patch fixes the warning of shadowed local variable: ../hw/i386/intel_iommu.c: In function ‘vtd_address_space_unmap’: ../hw/i386/intel_iommu.c:3773:18: warning: declaration of ‘size’ shadows a previous local [-Wshadow=compatible-local] 3773 | uint64_t size = mask + 1

[PULL 11/56] target/mips: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Fix: target/mips/tcg/nanomips_translate.c.inc:4410:33: error: declaration shadows a local variable [-Werror,-Wshadow] int32_t imm = extract32(ctx->opcode, 1, 13) | ^ target/mips/tcg/nanomips_translate.c.inc

[PULL 46/56] aspeed/timer: Clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Cédric Le Goater commit 8137355e850f ("aspeed/timer: Fix behaviour running Linux") introduced a MAX() expression to calculate the next timer deadline : return calculate_time(t, MAX(MAX(t->match[0], t->match[1]), 0)); The second MAX() is not necessary since the compared values are an u

[PULL 55/56] hw/nvme: Clean up local variable shadowing in nvme_ns_init()

2023-09-29 Thread Markus Armbruster
From: Klaus Jensen Fix local variable shadowing in nvme_ns_init(). Reported-by: Markus Armbruster Signed-off-by: Klaus Jensen Message-ID: <20230925-fix-local-shadowing-v1-1-3a1172132...@samsung.com> Reviewed-by: Jesper Wendel Devantier Signed-off-by: Markus Armbruster --- hw/nvme/ns.c | 4 +

[PULL 54/56] softmmu/device_tree: Fixup local variables shadowing

2023-09-29 Thread Markus Armbruster
From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shado

[PULL 50/56] qemu-nbd: changes towards enabling -Wshadow=local

2023-09-29 Thread Markus Armbruster
From: Eric Blake Address all compiler complaints from -Wshadow in qemu-nbd. Several instances of 'int ret' became shadows when commit 4fbec260 added 'ret' at a higher scope in main. More interesting was the 'void *ret' capturing the result of a pthread; where we were conceptually doing '(void*)

[PULL 40/56] hw/misc/arm_sysctl.c: Avoid shadowing local variable

2023-09-29 Thread Markus Armbruster
From: Peter Maydell Avoid shadowing a local variable in arm_sysctl_write(): ../../hw/misc/arm_sysctl.c: In function ‘arm_sysctl_write’: ../../hw/misc/arm_sysctl.c:537:26: warning: declaration of ‘val’ shadows a parameter [-Wshadow=local] 537 | uint32_t val; |

[PULL 42/56] hw/arm/smmuv3-internal.h: Don't use locals in statement macros

2023-09-29 Thread Markus Armbruster
From: Peter Maydell The STE_CTXPTR() and STE_S2TTB() macros both extract two halves of an address from fields in the STE and combine them into a single value to return. The current code for this uses a GCC statement expression. There are two problems with this: (1) The type chosen for the variab

[PULL 56/56] disas/m68k: clean up local variable shadowing

2023-09-29 Thread Markus Armbruster
From: Laurent Vivier Fix following warnings .../disas/m68k.c: In function ‘print_insn_arg’: .../disas/m68k.c:1635:13: warning: declaration of ‘val’ shadows a previous local [-Wshadow=compatible-local] 1635 | int val = fetch_arg (buffer, place, 5, info); | ^~~ .../disa

[PULL 52/56] target/riscv: cpu: Fixup local variables shadowing

2023-09-29 Thread Markus Armbruster
From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shado

[PULL 48/56] crypto: remove shadowed 'ret' variable

2023-09-29 Thread Markus Armbruster
From: Daniel P. Berrangé Both instances of 'ret' are used to store a gnutls API return code. Signed-off-by: Daniel P. Berrangé Message-ID: <20230922160644.438631-2-berra...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster --- crypto/tls-cipher-suites.c | 1 -

[PULL 51/56] hw/riscv: opentitan: Fixup local variables shadowing

2023-09-29 Thread Markus Armbruster
From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shado

[PULL 53/56] target/riscv: vector_helper: Fixup local variables shadowing

2023-09-29 Thread Markus Armbruster
From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shado

Re: [PATCH v7 07/12] nbd/client: Initial support for extended headers

2023-09-29 Thread Vladimir Sementsov-Ogievskiy
On 25.09.23 22:22, Eric Blake wrote: nbd_receive_simple_reply(int32_t error, const char *errname, uint64_t cookie) "Got simple reply: { .error = %" PRId32 " (%s), cookie = %" PRIu64" }" -nbd_receive_structured_reply_chunk(uint16_t flags, uint16_t type, const char *name, uint64_t cookie, uint32

Re: [PATCH 0/6] riscv: RVA22U64 profile support

2023-09-29 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 04:49:44PM -0300, Daniel Henrique Barboza wrote: > Based-on: 20230926183109.165878-1-dbarb...@ventanamicro.com > ("[PATCH 0/2] riscv: add extension properties for all cpus") > > Hi, > > These patches implements the base profile support for qemu-riscv and the > first profile,

Re: [PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus

2023-09-29 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 03:31:09PM -0300, Daniel Henrique Barboza wrote: > At this moment we do not expose extension properties for vendor CPUs > because that would allow users to change them via command line. The > drawback is that if we were to add an API that shows all CPU properties, > e.g. qmp

Re: [PATCH 0/6] riscv: RVA22U64 profile support

2023-09-29 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 04:49:44PM -0300, Daniel Henrique Barboza wrote: > Based-on: 20230926183109.165878-1-dbarb...@ventanamicro.com > ("[PATCH 0/2] riscv: add extension properties for all cpus") > > Hi, > > These patches implements the base profile support for qemu-riscv and the > first profil

Re: [PATCH] hw/display/ramfb: plug slight guest-triggerable leak on mode setting

2023-09-29 Thread Marc-André Lureau
Hi On Wed, Sep 27, 2023 at 7:46 PM Laszlo Ersek wrote: > > On 9/19/23 15:19, Laszlo Ersek wrote: > > The fw_cfg DMA write callback in ramfb prepares a new display surface in > > QEMU; this new surface is put to use ("swapped in") upon the next display > > update. At that time, the old surface (if

Re: [PATCH 0/6] riscv: RVA22U64 profile support

2023-09-29 Thread Daniel Henrique Barboza
On 9/29/23 07:46, Daniel P. Berrangé wrote: On Tue, Sep 26, 2023 at 04:49:44PM -0300, Daniel Henrique Barboza wrote: Based-on: 20230926183109.165878-1-dbarb...@ventanamicro.com ("[PATCH 0/2] riscv: add extension properties for all cpus") Hi, These patches implements the base profile support

[PULL 0/2] Firmware/seabios 20230929 patches

2023-09-29 Thread Gerd Hoffmann
The following changes since commit 36e9aab3c569d4c9ad780473596e18479838d1aa: migration: Move return path cleanup to main migration thread (2023-09-27 13:58:02 -0400) are available in the Git repository at: https://gitlab.com/kraxel/qemu.git tags/firmware/seabios-20230929-pull-request for

[PULL 1/2] seabios: update submodule to git snapshot

2023-09-29 Thread Gerd Hoffmann
git shortlog Gerd Hoffmann (7): disable array bounds warning better kvm detection detect physical address space size move 64bit pci window to end of address space be less conservative with the 64bit pci io window qemu: log reservations in fw_cfg e82

Re: [PATCH v3 02/14] audio: Require AudioState in AUD_add_capture

2023-09-29 Thread BALATON Zoltan
On Fri, 29 Sep 2023, Paolo Bonzini wrote: From: Martin Kletzander Since all callers require a valid audiodev this function can now safely abort in case of missing AudioState. Signed-off-by: Martin Kletzander Message-ID: Signed-off-by: Paolo Bonzini --- audio/audio.c | 7 +++ 1 file chan

Re: [PATCH] ramfb: implement migration support

2023-09-29 Thread Gerd Hoffmann
On Wed, Sep 20, 2023 at 12:26:51PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Implementing RAMFB migration seems quite straightforward. Unfortunately, > current QEMU didn't block migration when RAMFB was used. > > Having an extra "ramfb" VMState doesn't seem to "brea

Re: [PATCH] hw/display/ramfb: plug slight guest-triggerable leak on mode setting

2023-09-29 Thread Gerd Hoffmann
On Wed, Sep 27, 2023 at 05:45:25PM +0200, Laszlo Ersek wrote: > On 9/19/23 15:19, Laszlo Ersek wrote: > > The fw_cfg DMA write callback in ramfb prepares a new display surface in > > QEMU; this new surface is put to use ("swapped in") upon the next display > > update. At that time, the old surface

MAINTAINERS still leaves more files uncovered than I'd like

2023-09-29 Thread Markus Armbruster
Back in 2014 (time flies), I posted Subject: MAINTAINERS leaves too many files uncovered Message-ID: <87mw8rumhb@blackfin.pond.sub.org> https://lore.kernel.org/qemu-devel/87mw8rumhb@blackfin.pond.sub.org/ I updated my findings in 2015, 2016 (at commit e00da552a0d), and 2018 (a

Re: [PATCH v3 11/14] vt82c686: Support machine-default audiodev with fallback

2023-09-29 Thread BALATON Zoltan
On Fri, 29 Sep 2023, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini This does not touch vt82c686 any more so maybe subject line could be changed to via-ac97: to be more specific. I like to keep all via stuff together with empty lines only between different components so I think empty lin

Re: [PATCH v7 11/12] nbd/server: Prepare for per-request filtering of BLOCK_STATUS

2023-09-29 Thread Vladimir Sementsov-Ogievskiy
On 25.09.23 22:22, Eric Blake wrote: The next commit will add support for the optional extension NBD_CMD_FLAG_PAYLOAD during NBD_CMD_BLOCK_STATUS, where the client can request that the server only return a subset of negotiated contexts, rather than all contexts. To make that task easier, this pa

Re: [PATCH v3 12/14] audio: forbid mixing default audiodev backend and -audiodev

2023-09-29 Thread BALATON Zoltan
On Fri, 29 Sep 2023, Paolo Bonzini wrote: Now that all callers support setting an audiodev, forbid using the default audiodev if any audiodev is defined on the command line. To make the detection easier make AUD_register_card() return false on error. So this means that now qemu-system-ppc -M p

  1   2   3   >