Re: [PATCH 2/6] hw/loader: Clean up global variable shadowing in rom_add_file()

2023-10-09 Thread Ani Sinha
> On 09-Oct-2023, at 3:17 PM, Philippe Mathieu-Daudé wrote: > > Fix: > > hw/core/loader.c:1073:27: error: declaration shadows a variable in the > global scope [-Werror,-Wshadow] > bool option_rom, MemoryRegion *mr, >^ >

Re: [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters

2023-10-09 Thread Markus Armbruster
I apologize for the late reply. Peter Xu writes: > On Tue, Sep 26, 2023 at 10:40:27PM +0200, Markus Armbruster wrote: >> Peter Xu writes: >> >> > Quotting from Markus in his replies: >> >> Quoting >> >> Suggest something like "Markus recently wrote:" > > Will do. > >> >> >

Re: [PATCH V3 03/10] hw/acpi: Add ACPI CPU hotplug init stub

2023-10-09 Thread David Hildenbrand
On 09.10.23 13:28, Salil Mehta wrote: ACPI CPU hotplug related initialization should only happen if ACPI_CPU_HOTPLUG support has been enabled for particular architecture. Add cpu_hotplug_hw_init() stub to avoid compilation break. Signed-off-by: Salil Mehta Reviewed-by: Jonathan Cameron

Re: [PATCH V3 02/10] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2023-10-09 Thread David Hildenbrand
On 09.10.23 13:28, Salil Mehta wrote: CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan

Re: [PATCH V3 01/10] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-10-09 Thread David Hildenbrand
On 09.10.23 13:28, Salil Mehta wrote: KVM vCPU creation is done once during the initialization of the VM when Qemu thread is spawned. This is common to all the architectures. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host

Re: [PATCH 1/3] via-ide: Fix legacy mode emulation

2023-10-09 Thread Bernhard Beschow
Am 8. Oktober 2023 11:08:58 UTC schrieb BALATON Zoltan : >On Sun, 8 Oct 2023, Mark Cave-Ayland wrote: >> On 05/10/2023 23:13, BALATON Zoltan wrote: >> >>> The initial value for BARs were set in reset method for emulating >>> legacy mode at start but this does not work because PCI code resets

Re: [PATCH] memory: initialize 'fv' in MemoryRegionCache to make Coverity happy

2023-10-09 Thread David Hildenbrand
On 09.10.23 12:43, Ilya Maximets wrote: Coverity scan reports multiple false-positive "defects" for the following series of actions in virtio.c: MemoryRegionCache indirect_desc_cache; address_space_cache_init_empty(_desc_cache); address_space_cache_destroy(_desc_cache); For some

Re: [PATCH v2] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-09 Thread Thomas Huth
On 09/10/2023 13.45, Michael S. Tsirkin wrote: On Mon, Oct 09, 2023 at 10:37:25AM +0200, Thomas Huth wrote: Rename some variables to avoid compiler warnings when compiling with -Wshadow=local. Signed-off-by: Thomas Huth --- v2: Renamed the variable to something more unique

Re: [PATCH 4/6] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init()

2023-10-09 Thread Ani Sinha
> On 09-Oct-2023, at 3:17 PM, Philippe Mathieu-Daudé wrote: > > Fix: > > hw/acpi/pcihp.c:499:36: error: declaration shadows a variable in the global > scope [-Werror,-Wshadow] > MemoryRegion *address_space_io, > ^ >

Re: vIOMMU - PCI pass through to Layer 2 VMs (Nested Virtualization)

2023-10-09 Thread Eric Auger
Hi, On 10/9/23 12:25, Markus Frank wrote: > Hi Eric, > > thanks for the quick answer. > > On 10/9/23 11:29, Eric Auger wrote: >> Hi Markus, >> >> On 10/9/23 09:06, Markus Frank wrote: >>> Hello, >>> >>> I have already sent this email to qemu-discuss but I did not get a >>> reply. >>>

Re: [PATCH 3/3] hw/ppc: Add emulation of AmigaOne XE board

2023-10-09 Thread BALATON Zoltan
On Mon, 9 Oct 2023, Philippe Mathieu-Daudé wrote: Hi Zoltan, On 6/10/23 00:13, BALATON Zoltan wrote: The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware with patches to support AmigaOS and is very similar to pegasos2 so can be easily emulated sharing most code with pegasos2.

Re: [PATCH] system/vl: Use global _queue in configure_blockdev()

2023-10-09 Thread Philippe Mathieu-Daudé
On 9/10/23 12:26, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: Commit d11bf9bf0f ("vl: Factor configure_blockdev() out of main()") passed _queue as argument, but this isn't really necessary since there is only one call, so we still use the global variable. Dropping the _queue

Re: [PATCH] qapi: Belatedly update CompatPolicy documentation for unstable

2023-10-09 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 9/10/23 13:04, Markus Armbruster wrote: >> Commit 57df0dff1a1 (qapi: Extend -compat to set policy for unstable >> interfaces) neglected to update the "Limitation" paragraph to mention > > With retrospective, 'experimental' seems more meaningful. Anyway, > too

Re: [PATCH 1/6] target/ppc: Use env_archcpu() in helper_book3s_msgsndp()

2023-10-09 Thread Daniel Henrique Barboza
On 10/9/23 08:02, Philippe Mathieu-Daudé wrote: When CPUArchState* is available (here CPUPPCState*), we can use the fast env_archcpu() macro to get ArchCPU* (here PowerPCCPU*). The QOM cast POWERPC_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe

Re: [PATCH v2] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-09 Thread Michael S. Tsirkin
On Mon, Oct 09, 2023 at 10:37:25AM +0200, Thomas Huth wrote: > Rename some variables to avoid compiler warnings when compiling > with -Wshadow=local. > > Signed-off-by: Thomas Huth > --- > v2: Renamed the variable to something more unique > > contrib/vhost-user-gpu/vugpu.h | 8

Re: [PATCH 2/6] target/riscv: Use env_archcpu() in [check_]nanbox()

2023-10-09 Thread Daniel Henrique Barboza
On 10/9/23 08:02, Philippe Mathieu-Daudé wrote: When CPUArchState* is available (here CPURISCVState*), we can use the fast env_archcpu() macro to get ArchCPU* (here RISCVCPU*). The QOM cast RISCV_CPU() macro will be slower when building with --enable-qom-cast-debug. Inspired-by: Richard W.M.

Re: [PATCH 1/3] via-ide: Fix legacy mode emulation

2023-10-09 Thread BALATON Zoltan
On Mon, 9 Oct 2023, Bernhard Beschow wrote: Am 8. Oktober 2023 11:08:58 UTC schrieb BALATON Zoltan : On Sun, 8 Oct 2023, Mark Cave-Ayland wrote: On 05/10/2023 23:13, BALATON Zoltan wrote: The initial value for BARs were set in reset method for emulating legacy mode at start but this does not

Re: [PATCH v11 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-10-09 Thread Markus Armbruster
Thomas Huth writes: > On 29/09/2023 17.06, Bernhard Beschow wrote: >> Am 21. September 2023 23:44:42 UTC schrieb Gurchetan Singh >> : >>> On Tue, Sep 19, 2023 at 3:07 PM Akihiko Odaki >>> wrote: >>> On 2023/09/20 3:36, Bernhard Beschow wrote: > > > Am 15. September 2023

[PATCH V3 10/10] target/arm/kvm: Write CPU state back to KVM on reset

2023-10-09 Thread Salil Mehta via
From: Jean-Philippe Brucker When a KVM vCPU is reset following a PSCI CPU_ON call, its power state is not synchronized with KVM at the moment. Because the vCPU is not marked dirty, we miss the call to kvm_arch_put_registers() that writes to KVM's MP_STATE. Force mp_state synchronization.

[PATCH V3 07/10] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2023-10-09 Thread Salil Mehta via
ACPI GED shall be used to convey to the guest kernel about any CPU hot-(un)plug events. Therefore, existing ACPI GED framework inside QEMU needs to be enhanced to support CPU hotplug state and events. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta Reviewed-by:

[PATCH V3 09/10] gdbstub: Add helper function to unregister GDB register space

2023-10-09 Thread Salil Mehta via
Add common function to help unregister the GDB Register Space. This shall be done in context to the CPU unrealization. Signed-off-by: Salil Mehta --- gdbstub/gdbstub.c | 15 +++ include/exec/gdbstub.h | 5 + 2 files changed, 20 insertions(+) diff --git a/gdbstub/gdbstub.c

Re: [PATCH] qapi: Belatedly update CompatPolicy documentation for unstable

2023-10-09 Thread Philippe Mathieu-Daudé
On 9/10/23 13:04, Markus Armbruster wrote: Commit 57df0dff1a1 (qapi: Extend -compat to set policy for unstable interfaces) neglected to update the "Limitation" paragraph to mention With retrospective, 'experimental' seems more meaningful. Anyway, too late. feature 'unstable' in addition to

[PATCH V3 04/10] hw/acpi: Init GED framework with cpu hotplug events

2023-10-09 Thread Salil Mehta via
ACPI GED(as described in the ACPI 6.2 spec) can be used to generate ACPI events when OSPM/guest receives an interrupt listed in the _CRS object of GED. OSPM then maps or demultiplexes the event by evaluating _EVT method. This change adds the support of cpu hotplug event initialization in the

[PATCH V3 08/10] physmem: Add helper function to destroy CPU AddressSpace

2023-10-09 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta --- include/exec/cpu-common.h | 8 include/hw/core/cpu.h | 1 +

Re: [PATCH] target/riscv: deprecate capital 'Z' CPU properties

2023-10-09 Thread Daniel Henrique Barboza
On 10/8/23 22:39, Alistair Francis wrote: On Sun, Oct 8, 2023 at 3:15 AM Daniel Henrique Barboza wrote: At this moment there are eleven CPU extension properties that starts with capital 'Z': Zifencei, Zicsr, Zihintntl, Zihintpause, Zawrs, Zfa, Zfh, Zfhmin, Zve32f, Zve64f and Zve64d. All

[PATCH V3 02/10] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2023-10-09 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan ---

[PATCH V3 06/10] hw/acpi: Update GED _EVT method AML with CPU scan

2023-10-09 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually results in start of the CPU scan. Scan figures out the CPU and the kind of event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT method with the call to \\_SB.CPUS.CSCN Also, macro

[PATCH V3 05/10] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2023-10-09 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is based on PCI and is IO port based and hence existing CPUs AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is

[PATCH V3 03/10] hw/acpi: Add ACPI CPU hotplug init stub

2023-10-09 Thread Salil Mehta via
ACPI CPU hotplug related initialization should only happen if ACPI_CPU_HOTPLUG support has been enabled for particular architecture. Add cpu_hotplug_hw_init() stub to avoid compilation break. Signed-off-by: Salil Mehta Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan ---

[PATCH V3 01/10] accel/kvm: Extract common KVM vCPU {creation, parking} code

2023-10-09 Thread Salil Mehta via
KVM vCPU creation is done once during the initialization of the VM when Qemu thread is spawned. This is common to all the architectures. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host KVM is not destroyed and its

[PATCH V3 00/10] Add architecture agnostic code to support vCPU Hotplug

2023-10-09 Thread Salil Mehta via
Virtual CPU hotplug support is being added across various architectures[1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framework to support vCPU Hotplug [Patch 4,6,7] 3. ACPI CPUs AML code change

[PATCH v2 0/1] riscv: deprecate capital 'Z' CPU properties

2023-10-09 Thread Daniel Henrique Barboza
Hi, This second version of the patch fixes a 'with with' typo in the deprecated.rst document. No other changes made. Patch already acked. Changes from v1: - remove 'with with' from docs/about/deprecated.rst - v1 link:

[PATCH v2 1/1] target/riscv: deprecate capital 'Z' CPU properties

2023-10-09 Thread Daniel Henrique Barboza
At this moment there are eleven CPU extension properties that starts with capital 'Z': Zifencei, Zicsr, Zihintntl, Zihintpause, Zawrs, Zfa, Zfh, Zfhmin, Zve32f, Zve64f and Zve64d. All other extensions are named with lower-case letters. We want all properties to be named with lower-case letters

Re: [PATCH 2/2] meson: mitigate against use of uninitialize stack for exploits

2023-10-09 Thread Daniel P . Berrangé
On Mon, Oct 09, 2023 at 12:15:17PM +0200, Thomas Huth wrote: > On 09/10/2023 09.44, Thomas Huth wrote: > > On 05/10/2023 19.38, Daniel P. Berrangé wrote: > > > When variables are used without being initialized, there is potential > > > to take advantage of data that was pre-existing on the stack

[PATCH] qapi: Belatedly update CompatPolicy documentation for unstable

2023-10-09 Thread Markus Armbruster
Commit 57df0dff1a1 (qapi: Extend -compat to set policy for unstable interfaces) neglected to update the "Limitation" paragraph to mention feature 'unstable' in addition to feature 'deprecated'. Do that now. Signed-off-by: Markus Armbruster --- qapi/compat.json | 4 ++-- 1 file changed, 2

[PATCH 1/6] target/ppc: Use env_archcpu() in helper_book3s_msgsndp()

2023-10-09 Thread Philippe Mathieu-Daudé
When CPUArchState* is available (here CPUPPCState*), we can use the fast env_archcpu() macro to get ArchCPU* (here PowerPCCPU*). The QOM cast POWERPC_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 2 +-

[PATCH 5/6] target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr]()

2023-10-09 Thread Philippe Mathieu-Daudé
We already have 'x86_cpu = X86_CPU(cpu)'. Use the variable instead of doing another QOM cast with X86_CPU(). Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/x86_emu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/hvf/x86_emu.c

[PATCH 2/6] target/riscv: Use env_archcpu() in [check_]nanbox()

2023-10-09 Thread Philippe Mathieu-Daudé
When CPUArchState* is available (here CPURISCVState*), we can use the fast env_archcpu() macro to get ArchCPU* (here RISCVCPU*). The QOM cast RISCV_CPU() macro will be slower when building with --enable-qom-cast-debug. Inspired-by: Richard W.M. Jones Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH 6/6] target/i386: Use env_archcpu() in simulate_[rdmsr/wrmsr]()

2023-10-09 Thread Philippe Mathieu-Daudé
When CPUArchState* is available (here CPUX86State*), we can use the fast env_archcpu() macro to get ArchCPU* (here X86CPU*). The QOM cast X86_CPU() macro will be slower when building with --enable-qom-cast-debug. Pass CPUX86State* as argument to simulate_rdmsr / simulate_wrmsr instead of a

[PATCH 0/6] target: Use env_archcpu() instead of ARCH_CPU(env_cpu(env))

2023-10-09 Thread Philippe Mathieu-Daudé
When we have a CPUArchState* pointer we can directly get the corresponding ArchCPU* pointer with env_archcpu(). No need to use QOM cast which is slower due when building with --enable-qom-cast-debug. This series replace ARCH_CPU(env_cpu(env)) by env_archcpu(env) when possible. Philippe

[PATCH 3/6] target/s390x: Use env_archcpu() in handle_diag_308()

2023-10-09 Thread Philippe Mathieu-Daudé
When CPUArchState* is available (here CPUS390XState*), we can use the fast env_archcpu() macro to get ArchCPU* (here S390CPU*). The QOM cast S390_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/diag.c | 2 +- 1 file

[PATCH 4/6] target/xtensa: Use env_archcpu() in update_c[compare|count]()

2023-10-09 Thread Philippe Mathieu-Daudé
When CPUArchState* is available (here CPUXtensaState*), we can use the fast env_archcpu() macro to get ArchCPU* (here XtensaCPU*). The QOM cast XTENSA_CPU() macro will be slower when building with --enable-qom-cast-debug. Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/op_helper.c | 4

Re: [PATCH v4 4/6] hw/virtio: derive vhost-user-i2c from vhost-user-base

2023-10-09 Thread Viresh Kumar
On 09-10-23, 10:59, Alex Bennée wrote: > Now we can take advantage of the new base class and make > vhost-user-i2c a much simpler boilerplate wrapper. Also as this > doesn't require any target specific hacks we only need to build the > stubs once. > > Message-Id:

Re: [PATCH v4 3/6] hw/virtio: derive vhost-user-gpio from vhost-user-base

2023-10-09 Thread Viresh Kumar
On 09-10-23, 10:59, Alex Bennée wrote: > Now the new base class supports config handling we can take advantage > and make vhost-user-gpio a much simpler boilerplate wrapper. Also as > this doesn't require any target specific hacks we only need to build > the stubs once. > > Message-Id:

Re: [PATCH 0/7] audio: redo default audio backend creation

2023-10-09 Thread Marc-André Lureau
On Thu, Oct 5, 2023 at 5:01 PM Paolo Bonzini wrote: > > Currently, AUD_register_card picks the audio backend from either: > > - the first audiodev that was created > > - the audio_prio_list[] array, which can be customized at > configure time > > This series instead extends -audio to define a

[PATCH] memory: initialize 'fv' in MemoryRegionCache to make Coverity happy

2023-10-09 Thread Ilya Maximets
Coverity scan reports multiple false-positive "defects" for the following series of actions in virtio.c: MemoryRegionCache indirect_desc_cache; address_space_cache_init_empty(_desc_cache); address_space_cache_destroy(_desc_cache); For some reason it's unable to recognize the dependency

Re: [Virtio-fs] (no subject)

2023-10-09 Thread German Maglione
On Sat, Oct 7, 2023 at 4:23 AM Yajun Wu wrote: > > > On 10/6/2023 6:34 PM, Michael S. Tsirkin wrote: > > External email: Use caution opening links or attachments > > > > > > On Fri, Oct 06, 2023 at 11:47:55AM +0200, Hanna Czenczek wrote: > >> On 06.10.23 11:26, Michael S. Tsirkin wrote: > >>> On

Re: [PATCH] system/vl: Use global _queue in configure_blockdev()

2023-10-09 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Commit d11bf9bf0f ("vl: Factor configure_blockdev() out of main()") > passed _queue as argument, but this isn't really necessary since > there is only one call, so we still use the global variable. > > Dropping the _queue argument allows to silence this global

Re: vIOMMU - PCI pass through to Layer 2 VMs (Nested Virtualization)

2023-10-09 Thread Markus Frank
Hi Eric, thanks for the quick answer. On 10/9/23 11:29, Eric Auger wrote: Hi Markus, On 10/9/23 09:06, Markus Frank wrote: Hello, I have already sent this email to qemu-discuss but I did not get a reply. https://lists.nongnu.org/archive/html/qemu-discuss/2023-09/msg00034.html Maybe someone

Re: [PATCH v2] target/riscv: Use a direct cast for better performance

2023-10-09 Thread Philippe Mathieu-Daudé
Hi Richard, On 8/10/23 23:50, Richard W.M. Jones wrote: RISCV_CPU(cs) uses a checked cast. When QOM cast debugging is enabled this adds about 5% total overhead when emulating RV64 on x86-64 host. Using a RISC-V guest with 16 vCPUs, 16 GB of guest RAM, virtio-blk disk. The guest has a copy of

Re: [PATCH v5 3/3] hw/vfio: add ramfb migration support

2023-10-09 Thread Laszlo Ersek
On 10/9/23 08:32, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Add a "VFIODisplay" subsection whenever "x-ramfb-migrate" is turned on. > > Turn it off by default on machines <= 8.1 for compatibility reasons. > > Signed-off-by: Marc-André Lureau > Reviewed-by: Laszlo Ersek

Re: [PATCH 2/2] meson: mitigate against use of uninitialize stack for exploits

2023-10-09 Thread Thomas Huth
On 09/10/2023 09.44, Thomas Huth wrote: On 05/10/2023 19.38, Daniel P. Berrangé wrote: When variables are used without being initialized, there is potential to take advantage of data that was pre-existing on the stack from an earlier call, to drive an exploit. It is good practice to always

Re: [PATCH 02/10] tests/throttle: Clean up global variable shadowing

2023-10-09 Thread Alberto Garcia
On Mon 09 Oct 2023 12:02:43 PM +02, Philippe Mathieu-Daudé wrote: > Follow all other tests pattern from this file, use the > global 'cfg' variable to fix: > > tests/unit/test-throttle.c:621:20: error: declaration shadows a variable in > the global scope [-Werror,-Wshadow] > ThrottleConfig

[PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the (unused) 'allow' argument, following the pattern used by the other tests in this file. This fixes: tests/qtest/virtio-scsi-test.c:159:61: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void hotplug(void *obj, void *data, QGuestAllocator *alloc)

[PATCH 04/10] tests/cdrom-test: Clean up global variable shadowing in prepare_image()

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the variable to fix: tests/qtest/cdrom-test.c:40:50: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static int prepare_image(const char *arch, char *isoimage) ^ tests/qtest/cdrom-test.c:18:13: note:

[PATCH 07/10] tests/npcm7xx_adc: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the global 'adc' variable in order to avoid: tests/qtest/npcm7xx_adc-test.c:98:58: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static uint32_t adc_read_con(QTestState *qts, const ADC *adc) ^

Re: [PATCH 05/10] tests/hd-geo-test: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
On 9/10/23 12:02, Philippe Mathieu-Daudé wrote: Rename the variable to fix: tests/qtest/hd-geo-test.c:610:11: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] char *img_file_name; ^ tests/qtest/hd-geo-test.c:80:14: note: previous

[PATCH 00/10] tests: Clean up global variables shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Clean up global variables shadowing in tests/ in order to be able to use -Wshadow with Clang. Philippe Mathieu-Daudé (10): system/qtest: Clean up global variable shadowing in qtest_server_init() tests/throttle: Clean up global variable shadowing tests/virtio-scsi: Clean up global

[PATCH 05/10] tests/hd-geo-test: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the variable to fix: tests/qtest/hd-geo-test.c:610:11: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] char *img_file_name; ^ tests/qtest/hd-geo-test.c:80:14: note: previous declaration is here static char *img_file_name[backend_last];

[PATCH 06/10] tests/rtl8139: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the variable to fix: tests/qtest/rtl8139-test.c:28:33: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void save_fn(QPCIDevice *dev, int devfn, void *data) ^ tests/qtest/rtl8139-test.c:37:17: error: declaration

[PATCH 10/10] tests/coroutine: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the global variable to avoid: tests/unit/test-coroutine.c:430:11: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool *done = opaque; ^ tests/unit/test-coroutine.c:438:10: error: declaration shadows a variable in the global scope

[PATCH 08/10] tests/aio: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the argument to fix: tests/unit/test-aio.c:130:44: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void set_event_notifier(AioContext *ctx, EventNotifier *notifier, ^ tests/unit/test-aio.c:22:20: note:

[PATCH 02/10] tests/throttle: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Follow all other tests pattern from this file, use the global 'cfg' variable to fix: tests/unit/test-throttle.c:621:20: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] ThrottleConfig cfg; ^ tests/unit/test-throttle.c:28:23: note:

[PATCH 09/10] tests/aio-multithread: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the argument to avoid: tests/unit/test-aio-multithread.c:226:37: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void test_multi_co_mutex(int threads, int seconds) ^ tests/unit/test-aio-multithread.c:401:34:

[PATCH 01/10] system/qtest: Clean up global variable shadowing in qtest_server_init()

2023-10-09 Thread Philippe Mathieu-Daudé
Rename the variable to fix: softmmu/qtest.c:869:13: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] Object *qtest; ^ softmmu/qtest.c:53:15: note: previous declaration is here static QTest *qtest; ^ Signed-off-by: Philippe

[PATCH v4 6/6] docs/system: add a basic enumeration of vhost-user devices

2023-10-09 Thread Alex Bennée
Make it clear the vhost-user-device is intended for expert use only. Signed-off-by: Alex Bennée --- v2 - make clear vhost-user-device for expert use --- docs/system/devices/vhost-user-rng.rst | 2 ++ docs/system/devices/vhost-user.rst | 41 ++ 2 files changed, 43

[PATCH v4 1/6] virtio: split into vhost-user-base and vhost-user-device

2023-10-09 Thread Alex Bennée
Lets keep a cleaner split between the base class and the derived vhost-user-device which we can use for generic vhost-user stubs. This includes an update to introduce the vq_size property so the number of entries in a virtq can be defined. Signed-off-by: Alex Bennée --- v1 - merge and

[PATCH v4 4/6] hw/virtio: derive vhost-user-i2c from vhost-user-base

2023-10-09 Thread Alex Bennée
Now we can take advantage of the new base class and make vhost-user-i2c a much simpler boilerplate wrapper. Also as this doesn't require any target specific hacks we only need to build the stubs once. Message-Id: <20230418162140.373219-13-alex.ben...@linaro.org> Acked-by: Mark Cave-Ayland

[PATCH v4 2/6] hw/virtio: derive vhost-user-rng from vhost-user-base

2023-10-09 Thread Alex Bennée
Now we can take advantage of our new base class and make vhost-user-rng a much simpler boilerplate wrapper. Also as this doesn't require any target specific hacks we only need to build the stubs once. Message-Id: <20230418162140.373219-10-alex.ben...@linaro.org> Acked-by: Mark Cave-Ayland

[PATCH v4 3/6] hw/virtio: derive vhost-user-gpio from vhost-user-base

2023-10-09 Thread Alex Bennée
Now the new base class supports config handling we can take advantage and make vhost-user-gpio a much simpler boilerplate wrapper. Also as this doesn't require any target specific hacks we only need to build the stubs once. Message-Id: <20230418162140.373219-12-alex.ben...@linaro.org>

[PATCH v4 5/6] hw/virtio: add vhost-user-snd and virtio-snd-pci devices

2023-10-09 Thread Alex Bennée
From: Manos Pitsidianakis Tested with rust-vmm vhost-user-sound daemon: RUST_LOG=trace cargo run --bin vhost-user-sound -- --socket /tmp/snd.sock --backend null Invocation: qemu-system-x86_64 \ -qmp unix:./qmp-sock,server,wait=off \ -m 4096 \

[PATCH v4 0/6] virtio: cleanup vhost-user-generic and reduce c

2023-10-09 Thread Alex Bennée
A lot of our vhost-user stubs are large chunks of boilerplate that do (mostly) the same thing. This series continues the cleanups by splitting the vhost-user-base and vhost-user-generic implementations. After adding a new vq_size property the rng, gpio and i2c vhost-user devices become simple

Re: [PATCH v7 05/15] python/qemu: rename command() to cmd()

2023-10-09 Thread Juan Quintela
Vladimir Sementsov-Ogievskiy wrote: > Use a shorter name. We are going to move in iotests from qmp() to > command() where possible. But command() is longer than qmp() and don't > look better. Let's rename. I feel your pain O:-) > You can simply grep for '\.command(' and for 'def command(' to

Re: [PATCH 6/6] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req()

2023-10-09 Thread David Hildenbrand
On 09.10.23 11:47, Philippe Mathieu-Daudé wrote: Fix: hw/s390x/sclpquiesce.c:90:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QuiesceNotifier *qn = container_of(n, QuiesceNotifier, notifier); ^ hw/s390x/sclpquiesce.c:86:3:

Re: [PATCH 6/6] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req()

2023-10-09 Thread Thomas Huth
On 09/10/2023 11.47, Philippe Mathieu-Daudé wrote: Fix: hw/s390x/sclpquiesce.c:90:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QuiesceNotifier *qn = container_of(n, QuiesceNotifier, notifier); ^

[PATCH v2 02/10] block/mirror: set actively_synced even after the job is ready

2023-10-09 Thread Fiona Ebner
In preparation to allow switching from background to active mode. This ensures that setting actively_synced will not be missed when the switch happens after the job is ready. Signed-off-by: Fiona Ebner Reviewed-by: Vladimir Sementsov-Ogievskiy --- No changes in v2. block/mirror.c | 6 +++---

[PATCH 4/6] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init()

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/acpi/pcihp.c:499:36: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ include/exec/address-spaces.h:35:21: note: previous declaration is here extern

[PATCH v2 05/10] mirror: implement mirror_change method

2023-10-09 Thread Fiona Ebner
which allows switching the @copy-mode from 'background' to 'write-blocking'. This is useful for management applications, so they can start out in background mode to avoid limiting guest write speed and switch to active mode when certain criteria are fulfilled. Signed-off-by: Fiona Ebner ---

[PATCH 2/6] hw/loader: Clean up global variable shadowing in rom_add_file()

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/core/loader.c:1073:27: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool option_rom, MemoryRegion *mr, ^ include/sysemu/sysemu.h:57:22: note: previous declaration is here extern QEMUOptionRom

[PATCH 0/6] hw: Clean up global variables shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Clean up global variables shadowing in hw/ in order to be able to use -Wshadow with Clang. Philippe Mathieu-Daudé (6): hw/core/cpu: Clean up global variable shadowing hw/loader: Clean up global variable shadowing in rom_add_file() hw/display/vga: Clean up global variable shadowing

[PATCH v2 09/10] mirror: return mirror-specific information upon query

2023-10-09 Thread Fiona Ebner
To start out, only actively-synced is returned. For example, this is useful for jobs that started out in background mode and switched to active mode. Once actively-synced is true, it's clear that the mode switch has been completed. Note that completion of the switch might happen much earlier,

[PATCH 5/6] hw/pci: Clean up global variable shadowing of address_space_io variable

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/pci/pci.c:504:54: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ hw/pci/pci.c:533:38: error: declaration shadows a variable

[PATCH v2 10/10] iotests: adapt test output for new mirror query property

2023-10-09 Thread Fiona Ebner
Signed-off-by: Fiona Ebner --- New in v2. tests/qemu-iotests/109.out | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out index 2611d6a40f..965c9a6a0a 100644 --- a/tests/qemu-iotests/109.out +++

[PATCH 3/6] hw/display/vga: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/display/vga.c:2307:29: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, bool init_vga_ports) ^ include/exec/address-spaces.h:35:21: note: previous declaration is here extern

[PATCH v2 03/10] block/mirror: move dirty bitmap to filter

2023-10-09 Thread Fiona Ebner
In preparation to allow switching to active mode without draining. Initialization of the bitmap in mirror_dirty_init() still happens with the original/backing BlockDriverState, which should be fine, because the mirror top has the same length. Suggested-by: Vladimir Sementsov-Ogievskiy

[PATCH 6/6] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req()

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/s390x/sclpquiesce.c:90:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QuiesceNotifier *qn = container_of(n, QuiesceNotifier, notifier); ^ hw/s390x/sclpquiesce.c:86:3: note: previous declaration is here } qn; ^

[PATCH v2 01/10] blockjob: introduce block-job-change QMP command

2023-10-09 Thread Fiona Ebner
which will allow changing job-type-specific options after job creation. In the JobVerbTable, the same allow bits as for set-speed are used, because set-speed can be considered an existing change command. Signed-off-by: Fiona Ebner --- Changes in v2: * update QEMU version in QAPI * fix

[PATCH v2 00/10] mirror: allow switching from background to active mode

2023-10-09 Thread Fiona Ebner
Changes in v2: * move bitmap to filter which allows to avoid draining when changing the copy mode * add patch to determine copy_to_target only once * drop patches returning redundant information upon query * update QEMU version in QAPI * update indentation in QAPI *

[PATCH 1/6] hw/core/cpu: Clean up global variable shadowing

2023-10-09 Thread Philippe Mathieu-Daudé
Fix: hw/core/machine.c:1302:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const CPUArchId *cpus = possible_cpus->cpus; ^ hw/core/numa.c:69:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]

[PATCH v2 04/10] block/mirror: determine copy_to_target only once

2023-10-09 Thread Fiona Ebner
In preparation to allow changing the copy_mode via QMP. When running in an iothread, it could be that copy_mode is changed from the main thread in between reading copy_mode in bdrv_mirror_top_pwritev() and reading copy_mode in bdrv_mirror_top_do_write(), so they might end up disagreeing about

[PATCH v2 07/10] qapi/block-core: turn BlockJobInfo into a union

2023-10-09 Thread Fiona Ebner
In preparation to additionally return job-type-specific information. Signed-off-by: Fiona Ebner Reviewed-by: Vladimir Sementsov-Ogievskiy --- No changes in v2. qapi/block-core.json | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qapi/block-core.json

[PATCH v2 06/10] qapi/block-core: use JobType for BlockJobInfo's type

2023-10-09 Thread Fiona Ebner
In preparation to turn BlockJobInfo into a union with @type as the discriminator. That requires it to be an enum. No functional change is intended. Signed-off-by: Fiona Ebner Reviewed-by: Vladimir Sementsov-Ogievskiy --- No changes in v2. block/monitor/block-hmp-cmds.c | 4 ++-- blockjob.c

[PATCH v2 08/10] blockjob: query driver-specific info via a new 'query' driver method

2023-10-09 Thread Fiona Ebner
Signed-off-by: Fiona Ebner --- No changes in v2. blockjob.c | 4 include/block/blockjob_int.h | 5 + 2 files changed, 9 insertions(+) diff --git a/blockjob.c b/blockjob.c index f8cf6e58e2..7e8cfad0fd 100644 --- a/blockjob.c +++ b/blockjob.c @@ -376,6 +376,7 @@

Re: [PATCH v2] buildsys: Only display Objective-C information when Objective-C is used

2023-10-09 Thread Akihiko Odaki
On 2023/10/09 18:38, Philippe Mathieu-Daudé wrote: When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get: meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown

[PATCH v2] buildsys: Only display Objective-C information when Objective-C is used

2023-10-09 Thread Philippe Mathieu-Daudé
When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get: meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown option 'objc_args'. Instead of unconditionally display

[PATCH] system/vl: Use global _queue in configure_blockdev()

2023-10-09 Thread Philippe Mathieu-Daudé
Commit d11bf9bf0f ("vl: Factor configure_blockdev() out of main()") passed _queue as argument, but this isn't really necessary since there is only one call, so we still use the global variable. Dropping the _queue argument allows to silence this global shadow warning: softmmu/vl.c:678:54:

Re: vIOMMU - PCI pass through to Layer 2 VMs (Nested Virtualization)

2023-10-09 Thread Eric Auger
Hi Markus, On 10/9/23 09:06, Markus Frank wrote: > Hello, > > I have already sent this email to qemu-discuss but I did not get a reply. > https://lists.nongnu.org/archive/html/qemu-discuss/2023-09/msg00034.html > Maybe someone here could help me and reply to this email or the one on >

Re: [PATCH v2 03/21] preallocate: Don't poll during permission updates

2023-10-09 Thread Denis V. Lunev
On 10/6/23 20:10, Vladimir Sementsov-Ogievskiy wrote: On 06.10.23 11:56, Kevin Wolf wrote: Am 05.10.2023 um 21:55 hat Vladimir Sementsov-Ogievskiy geschrieben: On 11.09.23 12:46, Kevin Wolf wrote: When the permission related BlockDriver callbacks are called, we are in the middle of an

Re: [PATCH] memory: follow Error API guidelines

2023-10-09 Thread David Hildenbrand
On 09.10.23 09:53, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Return true/false on success/failure. Signed-off-by: Marc-André Lureau --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] memory: drop needless argument

2023-10-09 Thread David Hildenbrand
On 09.10.23 09:52, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The argument is unused since commit bdc44640c ("cpu: Use QTAILQ for CPU list"). Signed-off-by: Marc-André Lureau --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

<    1   2   3   4   >