[PATCH v2 1/4] sysemu/kvm: Restrict kvmppc_get_radix_page_info() to ppc targets

2023-10-03 Thread Philippe Mathieu-Daudé
kvm_get_radix_page_info() is only defined for ppc targets (in target/ppc/kvm.c). The declaration is not useful in other targets, reduce its scope. Rename using the 'kvmppc_' prefix following other declarations from target/ppc/kvm_ppc.h. Suggested-by: Michael Tokarev Signed-off-by: Philippe Mathie

[PATCH v2 2/4] hw/ppc/e500: Restrict ppce500_init_mpic_kvm() to KVM

2023-10-03 Thread Philippe Mathieu-Daudé
Inline and guard the single call to kvm_openpic_connect_vcpu() allows to remove kvm-stub.c. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/e500.c | 4 target/ppc/kvm-stub.c | 19 --- target/ppc/meson.build | 2 +- 3 files changed,

[PATCH v2 4/4] target/ppc: Prohibit target specific KVM prototypes on user emulation

2023-10-03 Thread Philippe Mathieu-Daudé
None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal). Suggested-by: Kevin Wolf Signed-off-by: Philippe Math

[PATCH v2 3/4] target/ppc: Restrict KVM objects to system emulation

2023-10-03 Thread Philippe Mathieu-Daudé
CONFIG_KVM is always FALSE on user emulation, so 'kvm.c' won't be added to ppc_ss[] source set; direcly use the system specific ppc_system_ss[] source set. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH v2 0/4] target/ppc: Prohibit target specific KVM prototypes on user emulation

2023-10-03 Thread Philippe Mathieu-Daudé
Since v1: - Addressed Michael review comments, - Added Daniel R-b tag. Implement Kevin's suggestion to remove KVM declarations for user emulation builds, so if KVM prototype are used we directly get a compile failure. Philippe Mathieu-Daudé (4): sysemu/kvm: Restrict kvmppc_get_radix_page_info()

Re: [PATCH 0/2] hw/intc/apic: QOM cleanup

2023-10-03 Thread Philippe Mathieu-Daudé
On 3/10/23 08:45, Philippe Mathieu-Daudé wrote: On 15/9/23 18:20, Philippe Mathieu-Daudé wrote: Minor cleanup extracted from a bigger series touching x86_cpu_realizefn(). Philippe Mathieu-Daudé (2):    target/i386: Only realize existing APIC device    hw/intc/apic: Pass CPU using QOM link prope

[PATCH v4 1/5] softmmu: add means to pass an exit code when requesting a shutdown

2023-10-03 Thread Clément Chigot
As of now, the exit code was either EXIT_FAILURE when a panic shutdown was requested or EXIT_SUCCESS otherwise. However, some hardware could want to pass more complex exit codes. Thus, introduce a new shutdown request function allowing that. Signed-off-by: Clément Chigot Reviewed-by: Alistair Fra

[PATCH v4 4/5] hw/char: riscv_htif: replace exit calls with proper shutdown

2023-10-03 Thread Clément Chigot
This replaces the exit calls by shutdown requests, ensuring a proper cleanup of Qemu. Otherwise, some connections like gdb could be broken before its final packet ("Wxx") is being sent. This part, being done inside qemu_cleanup function, can be reached only when the main loop exits after a shutdown

[PATCH v4 3/5] hw/misc/sifive_test.c: replace exit calls with proper shutdown

2023-10-03 Thread Clément Chigot
This replaces the exit calls by shutdown requests, ensuring a proper cleanup of Qemu. Otherwise, some connections like gdb could be broken before its final packet ("Wxx") is being sent. This part, being done inside qemu_cleanup function, can be reached only when the main loop exits after a shutdown

[PATCH v4 5/5] gdbstub: replace exit calls with proper shutdown for softmmu

2023-10-03 Thread Clément Chigot
This replaces the exit calls by shutdown requests, ensuring a proper cleanup of Qemu. Features like net/vhost-vdpa.c are expecting qemu_cleanup to be called to remove their last residuals. Signed-off-by: Clément Chigot Reviewed-by: Alistair Francis --- gdbstub/gdbstub.c | 5 +++-- gdbs

[PATCH v4 0/5] Risc-V/gdb: replace exit calls with proper shutdown

2023-10-03 Thread Clément Chigot
This series replaces some of the call to exit in hardware used by Risc-V boards. Otherwise, the gdb connection can be abruptly disconnected resulting in the last gdb packet "Wxx" being not sent. For the gdbstub modification, gdb_exit calls ensure that the "Wxx" packet is sent before exiting. Howev

[PATCH v4 2/5] softmmu: pass the main loop status to gdb "Wxx" packet

2023-10-03 Thread Clément Chigot
gdb_exit function aims to close gdb sessions and sends the exit code of the current execution. It's being called by qemu_cleanup once the main loop is over. Until now, the exit code sent was always 0. Now that hardware can shutdown this main loop with custom exit codes, these codes must be transfer

Re: [PATCH 1/2] blockdev: qmp_transaction: harden transaction properties for bitmaps

2023-10-03 Thread Vladimir Sementsov-Ogievskiy
On 19.09.23 13:02, Andrey Zhadchenko wrote: Hi! Thanks for the review On 9/12/23 21:29, Vladimir Sementsov-Ogievskiy wrote: On 04.09.23 11:31, Andrey Zhadchenko wrote: Unlike other transaction commands, bitmap operations do not drain target bds. If we have an IOThread, this may result in some

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-03 Thread Cédric Le Goater
On 10/2/23 22:38, Alex Williamson wrote: On Mon, 2 Oct 2023 21:41:55 +0200 Laszlo Ersek wrote: On 10/2/23 21:26, Alex Williamson wrote: On Mon, 2 Oct 2023 20:24:11 +0200 Laszlo Ersek wrote: On 10/2/23 16:41, Alex Williamson wrote: On Mon, 2 Oct 2023 15:38:10 +0200 Cédric Le Goater wro

[PATCH v3] virtio: add VIRTQUEUE_ERROR QAPI event

2023-10-03 Thread Vladimir Sementsov-Ogievskiy
For now we only log the vhost device error, when virtqueue is actually stopped. Let's add a QAPI event, which makes possible: - collect statistics of such errors - make immediate actions: take core dumps or do some other debugging - inform the user through a management API or UI, so that (s)he

Re: [PATCH RESEND 08/15] ppc: spapr: Implement nested PAPR hcall - H_GUEST_CREATE

2023-10-03 Thread Harsh Prateek Bora
On 9/7/23 07:58, Nicholas Piggin wrote: On Wed Sep 6, 2023 at 2:33 PM AEST, Harsh Prateek Bora wrote: This hcall is used by L1 to indicate to L0 that a new nested guest needs to be created and therefore necessary resource allocation shall be made. The L0 uses a hash table for nested guest spe

Re: [PATCH RESEND 14/15] ppc: spapr: Implement nested PAPR hcall - H_GUEST_DELETE

2023-10-03 Thread Harsh Prateek Bora
On 9/7/23 08:01, Nicholas Piggin wrote: On Wed Sep 6, 2023 at 2:33 PM AEST, Harsh Prateek Bora wrote: This hcall is used by L1 to delete a guest entry in L0 or can also be used to delete all guests if needed (usually in shutdown scenarios). I'd squash with at least the create hcall. Done.

Re: [PATCH RESEND 06/15] ppc: spapr: Implement nested PAPR hcall - H_GUEST_GET_CAPABILITIES

2023-10-03 Thread Cédric Le Goater
On 9/7/23 04:02, Nicholas Piggin wrote: On Wed Sep 6, 2023 at 2:33 PM AEST, Harsh Prateek Bora wrote: This patch implements nested PAPR hcall H_GUEST_GET_CAPABILITIES and also enables registration of nested PAPR hcalls whenever an L0 is launched with cap-nested-papr=true. The common registration

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-03 Thread Marc-André Lureau
Hi On Tue, Oct 3, 2023 at 11:43 AM Cédric Le Goater wrote: > > On 10/2/23 22:38, Alex Williamson wrote: > > On Mon, 2 Oct 2023 21:41:55 +0200 > > Laszlo Ersek wrote: > > > >> On 10/2/23 21:26, Alex Williamson wrote: > >>> On Mon, 2 Oct 2023 20:24:11 +0200 > >>> Laszlo Ersek wrote: > >>> >

[PATCH v2 0/5] hw/intc/apic: QOM cleanup

2023-10-03 Thread Philippe Mathieu-Daudé
Since v1: - Dropped change in x86_cpu_realizefn (rth) - Simplify kvm_apic_realize() error propagation Minor cleanup extracted from a bigger series touching x86_cpu_realizefn(). Philippe Mathieu-Daudé (5): hw/intc/apic: Use ERRP_GUARD() in apic_common_realize() hw/i386/apic: Defer error check

[PATCH v2 4/5] hw/intc/apic: Rename x86_cpu_apic_create() -> x86_cpu_apic_new()

2023-10-03 Thread Philippe Mathieu-Daudé
x86_cpu_apic_create()'s Error** parameter is unused, drop it. While there is no convention, QDev methods are usually named with _new() / _realize() suffixes. Rename as appropriate. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu-internal.h | 2 +- hw/intc/apic_common.c | 2 +- ta

[PATCH v2 1/5] hw/intc/apic: Use ERRP_GUARD() in apic_common_realize()

2023-10-03 Thread Philippe Mathieu-Daudé
APICCommonClass::realize() is a DeviceRealize() handler which take an Error** parameter and can fail. Do not proceed further on failure. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/apic_common.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/intc/apic_common.c b/hw/intc/apic_co

[PATCH v2 2/5] hw/i386/apic: Defer error check from apic_get_class to kvm_apic_realize

2023-10-03 Thread Philippe Mathieu-Daudé
apic_get_class() isn't supposed to fail. kvm_apic_realize() is DeviceRealize() handler, which can fail. Defer the error check to the latter. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/kvm/apic.c | 5 + target/i386/cpu-sysemu.c | 8 2 files changed, 5 insertions(+), 8 de

[PATCH v2 3/5] hw/i386/apic: Simplify apic_get_class()

2023-10-03 Thread Philippe Mathieu-Daudé
Now than apic_get_class() can not fail, remove its Error** parameter. It can't return NULL neither, so simplify x86_cpu_apic_create(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/apic_internal.h | 2 +- hw/i386/amd_iommu.c | 2 +- hw/i386/intel_iommu.c | 4 ++-

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-03 Thread Cédric Le Goater
On 10/3/23 10:23, Marc-André Lureau wrote: Hi On Tue, Oct 3, 2023 at 11:43 AM Cédric Le Goater wrote: On 10/2/23 22:38, Alex Williamson wrote: On Mon, 2 Oct 2023 21:41:55 +0200 Laszlo Ersek wrote: On 10/2/23 21:26, Alex Williamson wrote: On Mon, 2 Oct 2023 20:24:11 +0200 Laszlo Ersek wr

[PATCH v2 5/5] hw/intc/apic: Pass CPU using QOM link property

2023-10-03 Thread Philippe Mathieu-Daudé
QOM objects shouldn't access each other internals fields except using the QOM API. Declare the 'cpu' and 'base-addr' properties, set them using object_property_set_link() and qdev_prop_set_uint32() respectively. Since the _set_link() call can't fail, use &error_abort in case there is a programming

[PULL 01/24] optionrom: Remove build-id section

2023-10-03 Thread Paolo Bonzini
From: Fabiano Rosas Our linker script for optionroms specifies only the placement of the .text section, leaving the linker free to place the remaining sections at arbitrary places in the file. Since at least binutils 2.39, the .note.gnu.build-id section is now being placed at the start of the fi

[PULL 06/24] meson: clean up static_library keyword arguments

2023-10-03 Thread Paolo Bonzini
These are either built because they are dependencies of other targets, or not needed at all because they are used via extract_objects(). Mark them as "build_by_default: false"; if applicable, mark them as "fa" so that -Wl,--whole-archive does not interact with the linker script used for fuzzing. (

[PULL 02/24] accel/kvm/kvm-all: Handle register access errors

2023-10-03 Thread Paolo Bonzini
From: Akihiko Odaki A register access error typically means something seriously wrong happened so that anything bad can happen after that and recovery is impossible. Even failing one register access is catastorophic as architecture-specific code are not written so that it torelates such failures.

[PULL 11/24] crypto: only include tls-cipher-suites in emulators

2023-10-03 Thread Paolo Bonzini
tls-cipher-suites is an object that is used to inject TLS configuration into the guest (via fw_cfg). It is never used for host-side TLS operation, and therefore it need not be available in the tools. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- crypto/meson.build | 3 ++-

[PULL 14/24] audio: allow returning an error from the driver init

2023-10-03 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 03/24] e1000: remove old compatibility code

2023-10-03 Thread Paolo Bonzini
This code is not needed anymore in the supported machine types. Signed-off-by: Paolo Bonzini --- hw/net/e1000.c | 79 +- 1 file changed, 27 insertions(+), 52 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 093c2d45315..548bcabcbba

[PULL 17/24] audio: simplify flow in audio_init

2023-10-03 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 bb1734a95d3..2e22664daf9 100644 --- a/audio/audio.c +++ b/audio/aud

[PULL 18/24] audio: remove QEMU_AUDIO_* and -audio-help support

2023-10-03 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

[PULL 07/24] Makefile: build plugins before running TCG tests

2023-10-03 Thread Paolo Bonzini
Add back test-plugins and, after making sure it is always defined, do so unconditionally. Reported-by: Alex Bennée Fixes: 2c13c574418 ("configure, meson: move --enable-plugins to meson", 2023-09-07) Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Paolo Bonzini --- tests/Makefi

[PULL 12/24] ui/vnc: Require audiodev= to enable audio

2023-10-03 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 13/24] audio: Require AudioState in AUD_add_capture

2023-10-03 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 | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PULL 00/24] Audio, build system, misc fixes for 2023-10-03

2023-10-03 Thread Paolo Bonzini
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/bonzini/qemu.git tags/for-upstream for you to fetch changes up to

[PULL 21/24] hw/ppc: Support machine-default audiodev with fallback

2023-10-03 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 09/24] esp: restrict non-DMA transfer length to that of available data

2023-10-03 Thread Paolo Bonzini
From: Mark Cave-Ayland In the case where a SCSI layer transfer is incorrectly terminated, it is possible for a TI command to cause a SCSI buffer overflow due to the expected transfer data length being less than the available data in the FIFO. When this occurs the unsigned async_len variable under

[PULL 10/24] scsi-disk: ensure that FORMAT UNIT commands are terminated

2023-10-03 Thread Paolo Bonzini
From: Mark Cave-Ayland Otherwise when a FORMAT UNIT command is issued, the SCSI layer can become confused because it can find itself in the situation where it thinks there is still data to be transferred which can cause the next emulated SCSI command to fail. Signed-off-by: Mark Cave-Ayland Fix

[PULL 22/24] vt82c686 machines: Support machine-default audiodev with fallback

2023-10-03 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

[PULL 05/24] make-release: do not ship dtc sources

2023-10-03 Thread Paolo Bonzini
A new enough libfdt is included in all of Debian 11, Ubuntu 20.04 and MSYS2. It has also been included for several minor releases in Fedora and openSUSE Leap, as well as in CentOS. Therefore there is no need anymore to ship the sources together with the QEMU tarballs. Keep the wrap file so that

[PULL 19/24] Introduce machine property "audiodev"

2023-10-03 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 08/24] esp: use correct type for esp_dma_enable() in sysbus_esp_gpio_demux()

2023-10-03 Thread Paolo Bonzini
From: Mark Cave-Ayland The call to esp_dma_enable() was being made with the SYSBUS_ESP type instead of the ESP type. This meant that when GPIO 1 was being used to trigger a DMA request from an external DMA controller, the setting of ESPState's dma_enabled field would clobber unknown memory whilst

[PULL 24/24] audio: forbid default audiodev backend with -nodefaults

2023-10-03 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 | 16 1 file changed, 16 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 4289b7bf028

[PULL 23/24] audio: propagate Error * out of audio_init

2023-10-03 Thread Paolo Bonzini
From: Martin Kletzander Starting from audio_driver_init, propagate errors via Error ** so that audio_init_audiodevs can simply pass &error_fatal, and AUD_register_card can signal faiure. Signed-off-by: Martin Kletzander [Reworked the audio/audio.c parts, while keeping Martin's hw/ changes. - Pa

[PULL 20/24] hw/arm: Support machine-default audiodev with fallback

2023-10-03 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 15/24] audio: return Error ** from audio_state_by_name

2023-10-03 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 04/24] pc: remove short_root_bus property

2023-10-03 Thread Paolo Bonzini
The property was only used on QEMU 1.6 machine types. Signed-off-by: Paolo Bonzini --- hw/pci-host/i440fx.c | 8 hw/pci-host/q35.c | 7 --- include/hw/pci-host/q35.h | 1 - 3 files changed, 16 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index

[PULL 16/24] audio: commonize voice initialization

2023-10-03 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 874a4c3c412..bb1734a95

Re: [PATCH 1/5] accel: Rename accel_cpu_realizefn() -> accel_cpu_realize()

2023-10-03 Thread Claudio Fontana
Reviewed-by: Claudio Fontana On 9/15/23 21:00, Philippe Mathieu-Daudé wrote: > We use the '*fn' suffix for handlers, this is a public method. > Drop the suffix. > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/qemu/accel.h | 4 ++-- > accel/accel-common.c | 2 +- > cpu.c

Re: [PATCH 3/5] accel: Declare AccelClass::[un]realize_cpu() handlers

2023-10-03 Thread Claudio Fontana
On 9/15/23 21:00, Philippe Mathieu-Daudé wrote: > Currently accel_cpu_realize() only performs target-specific > realization. Introduce the [un]realize_cpu fields in the > base AccelClass to be able to perform target-agnostic > [un]realization of vCPUs. > > Signed-off-by: Philippe Mathieu-Daudé J

Re: [PATCH 4/5] accel/tcg: Have tcg_exec_realizefn() return a boolean

2023-10-03 Thread Claudio Fontana
On 9/15/23 21:00, Philippe Mathieu-Daudé wrote: > Following the example documented since commit e3fe3988d7 ("error: > Document Error API usage rules"), have tcg_exec_realizefn() return > a boolean indicating whether an error is set or not. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: C

[PATCH v3 2/5] hw/pc: remove needless includes

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau The include list is gigantic, make it smaller. Signed-off-by: Marc-André Lureau Acked-by: Laszlo Ersek --- hw/i386/pc.c | 41 - 1 file changed, 41 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5d399b6247..c376c5032

[PATCH v3 0/5] WIP: ramfb: migration support

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau Hi, Implement RAMFB migration, and add properties to enable it only on >= 8.2 machines, + a few related cleanups. v3: - add a "x-" prefix to properties, as they are not meant for users. - RAMFB now exports a ramfb_vmstate for actual devices to include - VFIOPCIDevice now

[PATCH v3 5/5] hw/vfio: add ramfb migration support

2023-10-03 Thread marcandre . lureau
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 --- hw/vfio/pci.h | 3 +++ hw/core/machine.c | 1 + hw/vfio/display.c | 23 ++

[PATCH v3 4/5] ramfb-standalone: add migration support

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau Add a "ramfb-dev" section whenever "x-migrate" is turned on. Turn it off by default on machines <= 8.1 for compatibility reasons. Signed-off-by: Marc-André Lureau --- hw/core/machine.c | 4 +++- hw/display/ramfb-standalone.c | 27 +++

[PATCH v3 3/5] ramfb: add migration support

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau Implementing RAMFB migration is quite straightforward. One caveat is to treat the whole RAMFBCfg as a blob, since that's what is exposed to the guest directly. This avoid having to fiddle with endianness issues if we were to migrate fields individually as integers. The de

[PATCH v3 1/5] hw/core: remove needless includes

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau The include list is large, make it smaller. Signed-off-by: Marc-André Lureau Acked-by: Laszlo Ersek --- hw/core/machine.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index a232ae0bcd..df40f10dfa 100644 --- a/hw/c

Re: [PATCH 5/5] accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG

2023-10-03 Thread Claudio Fontana
On 9/15/23 21:00, Philippe Mathieu-Daudé wrote: > We don't need to expose these TCG-specific methods to the > whole code base. Register them as AccelClass handlers, they > will be called by the generic accel_cpu_[un]realize() methods. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Claudi

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

2023-10-03 Thread Ani Sinha
> On 03-Oct-2023, at 11:13 AM, Ani Sinha wrote: > > Code changes 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 > bug

Re: [PATCH v2 5/5] hw: turn off ramfb migration for machines <= 8.1

2023-10-03 Thread Marc-André Lureau
Hi On Mon, Oct 2, 2023 at 6:42 PM Laszlo Ersek wrote: > > On 10/2/23 13:11, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > For compatibility reasons. > > > > Signed-off-by: Marc-André Lureau > > --- > > hw/core/machine.c | 5 - > > 1 file changed, 4 insertions(+), 1

[PATCH RESEND] osdep: set _FORTIFY_SOURCE=2 when optimization is enabled

2023-10-03 Thread Daniel P . Berrangé
Currently we set _FORTIFY_SOURCE=2 as a compiler argument when the meson 'optimization' setting is non-zero, the compiler is GCC and the target is Linux. While the default QEMU optimization level is 2, user could override this by setting CFLAGS="-O0" or --extra-cflags="-O0" when running configure

Re: [PATCH 3/5] accel: Declare AccelClass::[un]realize_cpu() handlers

2023-10-03 Thread Philippe Mathieu-Daudé
On 3/10/23 10:55, Claudio Fontana wrote: On 9/15/23 21:00, Philippe Mathieu-Daudé wrote: Currently accel_cpu_realize() only performs target-specific realization. Introduce the [un]realize_cpu fields in the base AccelClass to be able to perform target-agnostic [un]realization of vCPUs. Signed-of

Re: [PATCH v3 4/5] ramfb-standalone: add migration support

2023-10-03 Thread Laszlo Ersek
On 10/3/23 10:56, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Add a "ramfb-dev" section whenever "x-migrate" is turned on. Turn it off > by default on machines <= 8.1 for compatibility reasons. > > Signed-off-by: Marc-André Lureau > --- > hw/core/machine.c | 4

Re: [PATCH v4] block-jobs: flush target at the end of .run()

2023-10-03 Thread Vladimir Sementsov-Ogievskiy
On 03.08.23 05:43, Evanzhang wrote: [...] diff --git a/block/mirror.c b/block/mirror.c index d3cacd1708..cd19b49f7f 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1143,6 +1143,10 @@ immediate_exit: g_free(s->in_flight_bitmap); bdrv_dirty_iter_free(s->dbi); +if (ret >= 0) {

Re: [PULL 01/24] optionrom: Remove build-id section

2023-10-03 Thread Michael Tokarev
03.10.2023 11:30, Paolo Bonzini wrote: From: Fabiano Rosas Our linker script for optionroms specifies only the placement of the .text section, leaving the linker free to place the remaining sections at arbitrary places in the file. .. Cc: sta...@vger.kernel.org Are you sure you mean *that*

[PATCH v3 00/15] Prerequisite changes for IOMMUFD support

2023-10-03 Thread Eric Auger
Hi All, With the agreement of Zhenzhong, here is a v3 respin of the IOMMUFD prerequisite series. This applies on top of vfio-next: https://github.com/legoater/qemu/, branch vfio-next. Per Cédric's suggestion, the IOMMUFD patchset v1[1] is now split into two series, this prerequisite series and t

[PATCH v3 08/15] vfio/platform: Use vfio_[attach/detach]_device

2023-10-03 Thread Eric Auger
Let the vfio-platform device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Drop the trace event for vfio-platform as we have similar one in vfio_attach_device. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan

Re: [PATCH v3 5/5] hw/vfio: add ramfb migration support

2023-10-03 Thread Cédric Le Goater
On 10/3/23 10:56, 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. This change breaks linking on various platforms with : /usr/bin/ld: libq

[PATCH v3 04/15] vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any

2023-10-03 Thread Eric Auger
In the VFIO_SPAPR_TCE_v2_IOMMU container case, when KVM_SET_DEVICE_ATTR fails, we currently don't propagate the error as we do on the vfio_spapr_create_window() failure case. Let's align the code. Take the opportunity to reword the error message and make it more explicit. Signed-off-by: Eric Auger

[PATCH v3 07/15] vfio/pci: Introduce vfio_[attach/detach]_device

2023-10-03 Thread Eric Auger
We want the VFIO devices to be able to use two different IOMMU backends, the legacy VFIO one and the new iommufd one. Introduce vfio_[attach/detach]_device which aim at hiding the underlying IOMMU backend (IOCTLs, datatypes, ...). Once vfio_attach_device completes, the device is attached to a sec

[PATCH v3 02/15] linux-headers: Add iommufd.h

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan Since commit da3c22c74a3c ("linux-headers: Update to Linux v6.6-rc1"), linux-headers has been updated to v6.6-rc1. As previous patch added iommufd.h to update-linux-headers.sh, run the script again against TAG v6.6-rc1 to have iommufd.h included. Signed-off-by: Zhenzhong Du

[PATCH v3 09/15] vfio/ap: Use vfio_[attach/detach]_device

2023-10-03 Thread Eric Auger
Let the vfio-ap device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. We take the opportunity to use g_path_get_basename() which is prefered, as suggested by 3e015d815b ("use g_path_get_basename instead of basename") Signed-off-by: Eric Auge

[PATCH v3 11/15] vfio/common: Move VFIO reset handler registration to a group agnostic function

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan Move the reset handler registration/unregistration to a place that is not group specific. vfio_[get/put]_address_space are the best places for that purpose. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- hw/vfio/common.c | 15 +++---

[PATCH v3 10/15] vfio/ccw: Use vfio_[attach/detach]_device

2023-10-03 Thread Eric Auger
Let the vfio-ccw device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Note that the migration reduces the following trace "vfio: subchannel %s has already been attached" (featuring cssid.ssid.devid) into "device is already attached" Also no

[PATCH v3 12/15] vfio/common: Introduce a per container device list

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan Several functions need to iterate over the VFIO devices attached to a given container. This is currently achieved by iterating over the groups attached to the container and then over the devices in the group. Let's introduce a per container device list that simplifies this s

[PATCH v3 15/15] vfio/common: Move legacy VFIO backend code into separate container.c

2023-10-03 Thread Eric Auger
From: Yi Liu Move all the code really dependent on the legacy VFIO container/group into a separate file: container.c. What does remain in common.c is the code related to VFIOAddressSpace, MemoryListeners, migration and all other general operations. Signed-off-by: Eric Auger Signed-off-by: Yi Li

[PATCH v3 14/15] vfio/common: Introduce a global VFIODevice list

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan Some functions iterate over all the VFIODevices. This is currently achieved by iterating over all groups/devices. Let's introduce a global list of VFIODevices simplifying that scan. This will also be useful while migrating to IOMMUFD by hiding the group specificity. Signed-

[PATCH v3 06/15] vfio/common: Extract out vfio_kvm_device_[add/del]_fd

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan Introduce two new helpers, vfio_kvm_device_[add/del]_fd which take as input a file descriptor which can be either a group fd or a cdev fd. This uses the new KVM_DEV_VFIO_FILE VFIO KVM device group, which aliases to the legacy KVM_DEV_VFIO_GROUP. vfio_kvm_device_[add/del]_gro

[PATCH v3 05/15] vfio/common: Introduce vfio_container_add|del_section_window()

2023-10-03 Thread Eric Auger
Introduce helper functions that isolate the code used for VFIO_SPAPR_TCE_v2_IOMMU. Those helpers hide implementation details beneath the container object and make the vfio_listener_region_add/del() implementations more readable. No code change intended. Signed-off-by: Eric Auger Signed-off-by: Y

[PATCH v3 03/15] vfio/common: Move IOMMU agnostic helpers to a separate file

2023-10-03 Thread Eric Auger
From: Yi Liu Move low-level iommu agnostic helpers to a separate helpers.c file. They relate to regions, interrupts, device/region capabilities and etc. Signed-off-by: Eric Auger Signed-off-by: Yi Sun Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- inc

[PATCH v3 13/15] vfio/common: Store the parent container in VFIODevice

2023-10-03 Thread Eric Auger
From: Zhenzhong Duan let's store the parent contaienr within the VFIODevice. This simplifies the logic in vfio_viommu_preset() and brings the benefice to hide the group specificity which is useful for IOMMUFD migration. Signed-off-by: Eric Auger Signed-off-by: Zhenzhong Duan --- include/hw/vf

[PATCH v3 01/15] scripts/update-linux-headers: Add iommufd.h

2023-10-03 Thread Eric Auger
Update the script to import iommufd.h Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index

RE: [PATCH RFC V2 31/37] physmem,gdbstub: Common helping funcs/changes to *unrealize* vCPU

2023-10-03 Thread Salil Mehta via
Hi Phil, > From: Philippe Mathieu-Daudé > Sent: Tuesday, October 3, 2023 7:34 AM > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linaro.org; richard.hender...@linaro.org

RE: [PATCH 4/9] hw/acpi: Init GED framework with cpu hotplug events

2023-10-03 Thread Salil Mehta via
Hi Jonathan, Thanks for looking at it. > From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:06 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.or

[PATCH v3] hw/i386: changes towards enabling -Wshadow=local for x86 machines

2023-10-03 Thread Ani Sinha
Code changes 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 Subject: Help wanted

Re: [PATCH] tests/avocado: Re-enable MIPS Malta tests (GitLab issue #1884 fixed)

2023-10-03 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Commit 18a536f1f8 ("accel/tcg: Always require can_do_io") fixed > the GitLab issue #1884: we can now re-enable those tests. > > This reverts commit f959c3d87ccfa585b105de6964a6261e368cc1da. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Alex Bennée --

[PATCH] hw/i386/intel_iommu: changes towards enabling -Wshadow=local

2023-10-03 Thread Ani Sinha
Code changes 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 Subject: Help wanted

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

2023-10-03 Thread Ani Sinha
> On 03-Oct-2023, at 4:06 PM, Ani Sinha wrote: > > Code changes 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

Re: [PATCH v3 5/5] hw/vfio: add ramfb migration support

2023-10-03 Thread Marc-André Lureau
Hi On Tue, Oct 3, 2023 at 2:17 PM Cédric Le Goater wrote: > > On 10/3/23 10:56, 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 reaso

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

2023-10-03 Thread Salil Mehta via
Hi Jonathan, > From: Jonathan Cameron > Sent: Monday, October 2, 2023 4:53 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.com; an

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

2023-10-03 Thread Salil Mehta via
Hi Gavin, > From: Gavin Shan > Sent: Tuesday, October 3, 2023 12:18 AM > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linaro.org; richard.hender...@linaro.org; > imamm.

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

2023-10-03 Thread Salil Mehta via
Hi Jonathan, > From: Jonathan Cameron > Sent: Monday, October 2, 2023 4:55 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.com; an

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

2023-10-03 Thread Salil Mehta via
Hi Gavin, > From: Gavin Shan > Sent: Tuesday, October 3, 2023 12:20 AM > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linaro.org; richard.hender...@linaro.org; > imamm.

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

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:01 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.com; andrew.jo...@lin

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

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 12:25 AM > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linaro.org; richard.hender...@linaro.org; > imamm...@redhat.c

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

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:07 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.com; andrew.jo...@lin

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

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 12:29 AM > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linaro.org; richard.hender...@linaro.org; > imamm...@redhat.c

  1   2   3   4   5   >