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

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:10 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

[PATCH 2/2] target/riscv/kvm: support KVM_GET_REG_LIST

2023-10-03 Thread Daniel Henrique Barboza
KVM for RISC-V started supporting KVM_GET_REG_LIST in Linux 6.6. It consists of a KVM ioctl() that retrieves a list of all available regs for get_one_reg/set_one_reg. Regs that aren't present in the list aren't supported in the host. This simplifies our lives when initing the KVM regs since we don

[PATCH 1/2] target/riscv/kvm: improve 'init_multiext_cfg' error msg

2023-10-03 Thread Daniel Henrique Barboza
Our error message is returning the value of 'ret', which will be always -1 in case of error, and will not be that useful: qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1 Improve the error message by outputting 'errno' instead of 'ret'. Use strerrorname_np() to output the

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

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 1:09 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.co

[PATCH 0/2] riscv, kvm: support KVM_GET_REG_LIST

2023-10-03 Thread Daniel Henrique Barboza
Hi, Starting on Linux 6.6 the QEMU RISC-V KVM driver now supports KMV_GET_REG_LIST. This API will make it simpler for the QEMU KVM driver to determine whether a KVM reg is present or not. We'll use this API to fetch ISA_EXT regs during init(). The current logic will be put in a legacy() helper an

RE: [PATCH V2 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:14 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 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 1:11 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.co

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

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:16 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 07/10] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 1:12 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.co

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

2023-10-03 Thread Salil Mehta via
Hi Jonathan, > From: Jonathan Cameron > Sent: Monday, October 2, 2023 5:20 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 Jonathan Cameron via
On Tue, 3 Oct 2023 12:05:11 +0100 Salil Mehta wrote: > 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..

Re: [PATCH 1/2] target/riscv/kvm: improve 'init_multiext_cfg' error msg

2023-10-03 Thread Philippe Mathieu-Daudé
Hi Daniel, On 3/10/23 13:32, Daniel Henrique Barboza wrote: Our error message is returning the value of 'ret', which will be always -1 in case of error, and will not be that useful: qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1 Improve the error message by outputting

Re: [PATCH V2 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-10-03 Thread Jonathan Cameron via
> > aml_notify(aml_name(ACPI_POWER_BUTTON_DEVICE), > > > diff --git a/include/hw/acpi/cpu_hotplug.h > > b/include/hw/acpi/cpu_hotplug.h > > > index 48b291e45e..ef631750b4 100644 > > > --- a/include/hw/acpi/cpu_hotplug.h > > > +++ b/include/hw/acpi/cpu_hotplug.h > > > @@ -20,6 +20,8 @@ > > >

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

2023-10-03 Thread Salil Mehta via
Hi Gavin, > From: Gavin Shan > Sent: Tuesday, October 3, 2023 2:37 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 09/10] gdbstub: Add helper function to unregister GDB register space

2023-10-03 Thread Salil Mehta via
> From: Gavin Shan > Sent: Tuesday, October 3, 2023 4:17 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.co

Re: [PATCH v3 5/5] hw/vfio: add ramfb 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 "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

RE: [PATCH V2 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Tuesday, October 3, 2023 12:54 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...@l

[PATCH] target/riscv/tcg: remove RVG warning

2023-10-03 Thread Daniel Henrique Barboza
Vendor CPUs that set RVG are displaying user warnings about other extensions that RVG must enable, one warning per CPU. E.g.: $ ./build/qemu-system-riscv64 -smp 8 -M virt -cpu veyron-v1 -nographic qemu-system-riscv64: warning: Setting G will also set IMAFD_Zicsr_Zifencei qemu-system-riscv64: warni

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Michael S. Tsirkin
On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: > One more question: > > Why is the disabled state not needed by regular (non-vhost) virtio-net > devices? Tap does the same - it purges queued packets: int tap_disable(NetClientState *nc) { TAPState *s = DO_UPCAST(TAPState

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

2023-10-03 Thread Salil Mehta via
> From: Jonathan Cameron > Sent: Tuesday, October 3, 2023 12:51 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...@l

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

2023-10-03 Thread Michael S. Tsirkin
On Tue, Oct 03, 2023 at 11:13:06AM +0530, 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 >

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

2023-10-03 Thread Michael S. Tsirkin
On Tue, Oct 03, 2023 at 03:58:02PM +0530, 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 >

[PATCH v2 0/7] accel: Restrict tcg_exec_[un]realizefn() to TCG

2023-10-03 Thread Philippe Mathieu-Daudé
Since v1: - Use 'target'/'common' in function names (Claudio) - Added Claudio R-b tags >From v1: - Add missing accel_cpu_common_unrealize() - Add AccelClass::cpu_common_[un]realize handlers - Use tcg_exec_[un]realizefn as AccelClass handlers Philippe Mathieu-Daudé (7): accel: Rename accel_cpu_r

[PATCH v2 2/7] accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize()

2023-10-03 Thread Philippe Mathieu-Daudé
The AccelCPUClass::cpu_realizefn handler is meant for target specific code, rename it using '_target_' to emphasis it. Suggested-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/accel-cpu.h | 2 +- accel/accel-common.c| 4 ++-- target/i386/hvf/hvf-cpu.c |

[PATCH v2 4/7] accel: Introduce accel_cpu_common_unrealize() stub

2023-10-03 Thread Philippe Mathieu-Daudé
Prepare the stub for parity with accel_cpu_common_realize(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/accel.h | 6 ++ accel/accel-common.c | 4 cpu.c| 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/qemu/accel.h b/include/qemu

[PATCH v2 6/7] accel/tcg: Have tcg_exec_realizefn() return a boolean

2023-10-03 Thread Philippe Mathieu-Daudé
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: Claudio Fontana --- include/exec/cpu-all.h | 2 +- accel/t

[PATCH v2 3/7] accel: Rename accel_cpu_realize() -> accel_cpu_common_realize()

2023-10-03 Thread Philippe Mathieu-Daudé
accel_cpu_realize() is a generic function working with CPUs from any target. Rename it using '_common_' to emphasis it is not target specific. Suggested-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/accel.h | 4 ++-- accel/accel-common.c | 2 +- cpu.c

[PATCH v2 1/7] accel: Rename accel_cpu_realizefn() -> accel_cpu_realize()

2023-10-03 Thread Philippe Mathieu-Daudé
We use the '*fn' suffix for handlers, this is a public method. Drop the suffix. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Claudio Fontana --- include/qemu/accel.h | 4 ++-- accel/accel-common.c | 2 +- cpu.c | 2 +- target/i386/kvm/kvm-cpu.c | 2 +- 4 file

[PATCH v2 7/7] accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG

2023-10-03 Thread Philippe Mathieu-Daudé
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: Claudio Fontana --- accel/tcg/internal.h | 3 +++ include/exe

[PATCH v2 5/7] accel: Declare AccelClass::cpu_common_[un]realize() handlers

2023-10-03 Thread Philippe Mathieu-Daudé
Currently accel_cpu_realize() only performs target-specific realization. Introduce the cpu_common_[un]realize fields in the base AccelClass to be able to perform target-agnostic [un]realization of vCPUs. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/accel.h | 2 ++ accel/accel-common.c

[PULL 02/13] ui/console: make qemu_console_is_multihead() static

2023-10-03 Thread marcandre . lureau
From: Laszlo Ersek qemu_console_is_multihead() is only called from within "ui/console.c"; make it static. Cc: "Marc-André Lureau" (odd fixer:Graphics) Cc: Gerd Hoffmann (odd fixer:Graphics) Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Messag

[PULL 00/13] Misc patches

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit 50d0bfd0ed78209f003e8f7b9ac25edaa0399157: Merge tag 'migration-20231002-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-10-02 14:42:44 -0400) are available in the Git repository at: https://gitlab.com/mar

[PULL 01/13] input: Allow to choose console with qemu_input_is_absolute

2023-10-03 Thread marcandre . lureau
From: Akihiko Odaki Although an input is routed depending on the console, qemu_input_is_absolute() had no mechanism to specify the console. Accept QemuConsole as an argument for qemu_input_is_absolute, and let the display know the absolute/relative state for a particular console. Signed-off-by:

[PULL 07/13] win32: avoid discarding the exception handler

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau In all likelihood, the compiler with lto doesn't see the function being used, from assembly macro __try1. Help it by marking the function has being used. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1904 Fixes: commit d89f30b4df ("win32: wrap socket close() wi

[PULL 05/13] ui/console: sanitize search in qemu_graphic_console_is_multihead()

2023-10-03 Thread marcandre . lureau
From: Laszlo Ersek qemu_graphic_console_is_multihead() declares the graphical console "c" a "multihead" console if there are two different graphical consoles in the system that (a) both reference "c->device", and (b) have different "c->head" numbers. In effect, if at least two graphical consoles

[PULL 10/13] 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

[PULL 04/13] ui/console: eliminate QOM properties from qemu_console_is_multihead()

2023-10-03 Thread marcandre . lureau
From: Laszlo Ersek According to Marc-André's and Gerd's descriptions, the "device" and "head" members of QemuGraphicConsole are exposed as QOM properties for two purposes: (1) Introspection (e.g., "qom-get" monitor command). (2) A VNC server can display a specific device + head. This lets us ru

[PULL 08/13] ui/gtk: fix UI info precondition

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau dpy_get_ui_info() shouldn't be called if the underlying GPU doesn't support it. Before the assert() was added and the regression introduced, GTK code used to get "zero" UI info, for ex with a simple VGA device. The assert was added to prevent from calling when there are n

[PULL 06/13] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map

2023-10-03 Thread marcandre . lureau
From: Ken Xue Android uses XBGR and ABGR as default scanout buffer, But qemu does not support them for qemu_pixman_to_drm_format conversion within virtio_gpu_create_dmabuf for virtio gpu. so, add those 2 formats into drm_format_pixman_map. Signed-off-by: Ken Xue Reviewed-by: Marc-André

[PULL 09/13] analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH

2023-10-03 Thread marcandre . lureau
From: Marc-André Lureau Traceback (most recent call last): File "scripts/analyze-migration.py", line 605, in dump.read(dump_memory = args.memory) File "scripts/analyze-migration.py", line 542, in read section.read() File "scripts/analyze-migration.py", line 214, in read raise E

[PULL 11/13] 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 | 39 --- 1 file changed, 39 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5d399b6247..ec01d74482

[PULL 13/13] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected

2023-10-03 Thread marcandre . lureau
From: Thomas Huth When starting a guest via libvirt with "virsh start --console ...", the first second of the console output is missing. This is especially annoying on s390x that only has a text console by default and no graphical output - if the bios fails to boot here, the information about wha

[PULL 12/13] hw/display/ramfb: plug slight guest-triggerable leak on mode setting

2023-10-03 Thread marcandre . lureau
From: Laszlo Ersek 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 any) is released. If the guest triggers the fw_cfg DMA write callback at least twice bet

[PULL 03/13] ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead()

2023-10-03 Thread marcandre . lureau
From: Laszlo Ersek qemu_console_is_multihead() declares the console "c" a "multihead" console if there are two different consoles in the system that (a) both reference "c->device", and (b) have different "c->head" numbers. In effect, if at least two consoles exist that are different heads of the

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

2023-10-03 Thread Laszlo Ersek
On 10/3/23 12:47, Marc-André Lureau wrote: > 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

Re: [PATCH v5 1/2] migration/vmstate: Introduce vmstate_save_state_with_err

2023-10-03 Thread Juan Quintela
Tejus GK wrote: > Currently, a few code paths exist in the function vmstate_save_state_v, > which ultimately leads to a migration failure. However, an update in the > current MigrationState for the error description is never done. > > vmstate.c somehow doesn't seem to allow the use of migrat

Re: [PATCH] vhost: Add a defensive check in vhost_commit against wrong deallocation

2023-10-03 Thread Michael S. Tsirkin
On Wed, Sep 13, 2023 at 09:46:57AM +0200, Eric Auger wrote: > In vhost_commit(), it may happen that dev->mem_sections and > dev->tmp_sections are equal, Could you please explain a bit more how this can happen? I don't see how. > in which case, unconditionally > freeing old_sections at the end of

Re: [PATCH v5 2/2] migration: Update error description outside migration.c

2023-10-03 Thread Juan Quintela
Tejus GK wrote: > A few code paths exist in the source code,where a migration is > marked as failed via MIGRATION_STATUS_FAILED, but the failure happens > outside of migration.c > > In such cases, an error_report() call is made, however the current > MigrationState is never updat

Re: [PATCH 1/1] hw/ide/core: terminate in-flight DMA on IDE bus reset

2023-10-03 Thread Simon Rowe
On Monday, 2 October 2023 John Snow wrote: > Which reset pathway are you testing that causes the problem? The test centres on a VM-initiated bus reset because a DMA write has stalled (I deliberately discard the iSCSI response). > I'm not fully clear on why checking for DRQ is legitimate here.

Re: [PATCH v6 07/19] linux-user: Load vdso image if available

2023-10-03 Thread Philippe Mathieu-Daudé
On 30/9/23 04:15, Richard Henderson wrote: The vdso image will be pre-processed into a C data array, with a simple list of relocations to perform, and identifying the location of signal trampolines. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 90 +++

[PATCH 0/3] Support discontinuous PMU counters

2023-10-03 Thread Rob Bradford
Currently the available PMU counters start at HPM3 and run through to the number specified by the "pmu-num" property. There is no requirement in the specification that the available counters be continously numbered. This series add suppport for specifying a discountinuous range of counters though a

[PATCH 2/3] target/riscv: Support discontinuous PMU counters

2023-10-03 Thread Rob Bradford
There is no requirement that the enabled counters in the platform are continuously numbered. Add a "pmu-mask" property that, if specified, can be used to specify the enabled PMUs. In order to avoid ambiguity if "pmu-mask" is specified then "pmu-num" must also match the number of bits set in the mas

[PATCH 1/3] target/riscv: Propagate error from PMU setup

2023-10-03 Thread Rob Bradford
More closely follow the QEMU style by returning an Error and propagating it there is an error relating to the PMU setup. Further simplify the function by removing the num_counters parameter as this is available from the passed in cpu pointer. Signed-off-by: Rob Bradford --- target/riscv/cpu.c |

[PATCH 3/3] target/riscv: Don't assume PMU counters are continuous

2023-10-03 Thread Rob Bradford
Check the PMU available bitmask when checking if a counter is valid rather than comparing the index against the number of PMUs. Signed-off-by: Rob Bradford --- target/riscv/csr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c inde

[PATCH v3] qcow2: keep reference on zeroize with discard-no-unref enabled

2023-10-03 Thread Jean-Louis Dupond
When the discard-no-unref flag is enabled, we keep the reference for normal discard requests. But when a discard is executed on a snapshot/qcow2 image with backing, the discards are saved as zero clusters in the snapshot image. When committing the snapshot to the backing file, not discard_in_l2_sl

Re: [PATCH v2] qcow2: keep reference on zeroize with discard-no-unref enabled

2023-10-03 Thread Jean-Louis Dupond
On 25/09/2023 16:17, Hanna Czenczek wrote: On 25.09.23 13:40, Jean-Louis Dupond wrote: On 15/09/2023 13:21, Hanna Czenczek wrote: On 05.09.23 15:08, Jean-Louis Dupond wrote: When the discard-no-unref flag is enabled, we keep the reference for normal discard requests. But when a discard is ex

Re: [PATCH v4 21/21] i386: Add new property to control L2 cache topo in CPUID.04H

2023-10-03 Thread Michael S. Tsirkin
On Fri, Sep 15, 2023 at 03:53:25PM +0800, Zhao Liu wrote: > Hi Philippe, > > On Thu, Sep 14, 2023 at 09:41:30AM +0200, Philippe Mathieu-Daudé wrote: > > Date: Thu, 14 Sep 2023 09:41:30 +0200 > > From: Philippe Mathieu-Daudé > > Subject: Re: [PATCH v4 21/21] i386: Add new property to control L2 ca

Re: [PATCH] MAINTAINERS: Add entry for rdma migration

2023-10-03 Thread Juan Quintela
Peter Xu wrote: > On Mon, Sep 25, 2023 at 03:55:08PM +0200, Markus Armbruster wrote: >> Peter Xu writes: >> >> > It's not obvious to many that RDMA migration is in Odd Fixes stage for a >> > long time. Add an explicit sub entry for it (besides migration, which >> > already covers the rdma files

Re: [PATCH v6 08/19] linux-user: Add gen-vdso tool

2023-10-03 Thread Philippe Mathieu-Daudé
On 30/9/23 04:15, Richard Henderson wrote: This tool will be used for post-processing the linked vdso image, turning it into something that is easy to include into elfload.c. Signed-off-by: Richard Henderson --- linux-user/gen-vdso.c | 223 linux-user/gen-vd

Re: [PATCH v6 19/19] build: Add update-linux-vdso makefile rule

2023-10-03 Thread Philippe Mathieu-Daudé
On 30/9/23 04:15, Richard Henderson wrote: This is not ideal, since it requires all cross-compilers to be present rather than a simple subset. But since it is only run manually, should be good enough for now. Signed-off-by: Richard Henderson --- Makefile | 10 ++ 1 file changed, 10

Re: [PATCH v6 18/19] linux-user/s390x: Add vdso

2023-10-03 Thread Philippe Mathieu-Daudé
Hi Richard, On 30/9/23 04:15, Richard Henderson wrote: Signed-off-by: Richard Henderson --- linux-user/s390x/vdso-asmoffset.h | 2 + linux-user/elfload.c | 2 + linux-user/s390x/signal.c | 4 +- linux-user/s390x/Makefile.vdso| 11 + linux-user/s390x/mes

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Stefan Hajnoczi
On Tue, 3 Oct 2023 at 08:27, Michael S. Tsirkin wrote: > > On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: > > One more question: > > > > Why is the disabled state not needed by regular (non-vhost) virtio-net > > devices? > > Tap does the same - it purges queued packets: > > int

Re: [PATCH v2 0/2] virtio-blk: add iothread-vq-mapping parameter

2023-10-03 Thread Michael S. Tsirkin
On Mon, Sep 18, 2023 at 12:16:02PM -0400, Stefan Hajnoczi wrote: > virtio-blk and virtio-scsi devices need a way to specify the mapping between > IOThreads and virtqueues. At the moment all virtqueues are assigned to a > single > IOThread or the main loop. This single thread can be a CPU bottlenec

Re: [PATCH] vhost: Add a defensive check in vhost_commit against wrong deallocation

2023-10-03 Thread Eric Auger
Hi Michael, On 10/3/23 14:43, Michael S. Tsirkin wrote: > On Wed, Sep 13, 2023 at 09:46:57AM +0200, Eric Auger wrote: >> In vhost_commit(), it may happen that dev->mem_sections and >> dev->tmp_sections are equal, > Could you please explain a bit more how this can happen? > I don't see how. > >> in

Re: [LINUX KERNEL PATCH v5 1/2] virtio_pci: Add freeze_mode for virtio_pci_common_cfg

2023-10-03 Thread Michael S. Tsirkin
On Tue, Sep 19, 2023 at 06:46:06PM +0800, Jiqian Chen wrote: > When guest vm does S3, Qemu will reset and clear some things of virtio > devices, but guest can't aware that, so that may cause some problems. > For excample, Qemu calls virtio_reset->virtio_gpu_gl_reset, that will > destroy render reso

[PATCH v2 0/2] riscv, kvm: support KVM_GET_REG_LIST

2023-10-03 Thread Daniel Henrique Barboza
Hi, In this new version all instances of "error_setg(&error_fatal, ..." were replaced with error_report() and exit(1), as suggested by Phil in v1. No other changes made. Changes from v1: - patches 1 and 2: - replace 'error_setg(&error_fatal" with error_report() and exit(1) - v1 link: https://

[PATCH v2 2/2] target/riscv/kvm: support KVM_GET_REG_LIST

2023-10-03 Thread Daniel Henrique Barboza
KVM for RISC-V started supporting KVM_GET_REG_LIST in Linux 6.6. It consists of a KVM ioctl() that retrieves a list of all available regs for get_one_reg/set_one_reg. Regs that aren't present in the list aren't supported in the host. This simplifies our lives when initing the KVM regs since we don

[PATCH v2 1/2] target/riscv/kvm: improve 'init_multiext_cfg' error msg

2023-10-03 Thread Daniel Henrique Barboza
Our error message is returning the value of 'ret', which will be always -1 in case of error, and will not be that useful: qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1 Improve the error message by outputting 'errno' instead of 'ret'. Use strerrorname_np() to output the

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Laszlo Ersek
On 10/3/23 15:08, Stefan Hajnoczi wrote: > On Tue, 3 Oct 2023 at 08:27, Michael S. Tsirkin wrote: >> >> On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: >>> One more question: >>> >>> Why is the disabled state not needed by regular (non-vhost) virtio-net >>> devices? >> >> Tap doe

Re: [PATCH v2 1/2] target/riscv/kvm: improve 'init_multiext_cfg' error msg

2023-10-03 Thread Philippe Mathieu-Daudé
On 3/10/23 15:21, Daniel Henrique Barboza wrote: Our error message is returning the value of 'ret', which will be always -1 in case of error, and will not be that useful: qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1 Improve the error message by outputting 'errno' ins

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

2023-10-03 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote: > Rename the version not burried in the macro to cap_h. > > Signed-off-by: Jonathan Cameron > --- Reviewed-by: Michael S. Tsirkin pls merge with the rest of local shadowing things. > I had another instance of this in a serie

Re: [PATCH v4 00/18] virtio-mem: Expose device memory through multiple memslots

2023-10-03 Thread Michael S. Tsirkin
On Tue, Sep 26, 2023 at 08:57:20PM +0200, David Hildenbrand wrote: > Quoting from patch #16: > > Having large virtio-mem devices that only expose little memory to a VM > is currently a problem: we map the whole sparse memory region into the > guest using a single memslot, resulting in

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

2023-10-03 Thread Cédric Le Goater
On 10/3/23 12:13, Eric Auger wrote: Update the script to import iommufd.h Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [PATCH 0/2] tests: Drop mentions of SoftMMU

2023-10-03 Thread Richard Henderson
On 10/2/23 07:51, Philippe Mathieu-Daudé wrote: We want to clarify when code depends on a software MMU, or when it depends on TCG system emulation. This series replaces 'softmmu' by TCG when relevant, or simply remove it. Philippe Mathieu-Daudé (2): tests/vm/ubuntu.aarch64: Correct comment a

Re: [PATCH] vhost: Perform memory section dirty scans once per iteration

2023-10-03 Thread Michael S. Tsirkin
On Wed, Sep 27, 2023 at 12:14:28PM +0100, Joao Martins wrote: > On setups with one or more virtio-net devices with vhost on, > dirty tracking iteration increases cost the bigger the number > amount of queues are set up e.g. on idle guests migration the > following is observed with virtio-net with v

[PATCH qemu 1/1] Switch memory management calls to new coding conventions

2023-10-03 Thread ~h0lyalg0rithm
From: Suraj Shirvankar Signed-off-by: Suraj Shirvankar --- contrib/elf2dmp/addrspace.c | 4 ++-- contrib/elf2dmp/main.c | 4 ++-- contrib/elf2dmp/pdb.c | 4 ++-- contrib/elf2dmp/qemu_elf.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/elf2dmp/addrs

[PATCH qemu 0/1] Elf2dmp: Conversion of conversions of malloc/calloc/free to g_malloc/g_new/g_free

2023-10-03 Thread ~h0lyalg0rithm
Based on this issue https://gitlab.com/qemu-project/qemu/-/issues/1798 g_new is used where I think it is applicable and a struct is well defined. Suraj Shirvankar (1): Switch memory management calls to new coding conventions contrib/elf2dmp/addrspace.c | 4 ++-- contrib/elf2dmp/main.c | 4

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

2023-10-03 Thread Richard Henderson
On 10/3/23 02:15, Daniel P. Berrangé wrote: 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" o

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

2023-10-03 Thread Richard Henderson
On 10/2/23 23:44, Philippe Mathieu-Daudé wrote: On 15/9/23 21:00, Philippe Mathieu-Daudé wrote: - Add missing accel_cpu_unrealize() - Add AccelClass::[un]realize_cpu handlers - Use tcg_exec_[un]realizefn as AccelClass handlers Philippe Mathieu-Daudé (5):    accel: Rename accel_cpu_realizefn() -

Re: [PATCH 1/1] hw/ide/core: terminate in-flight DMA on IDE bus reset

2023-10-03 Thread Niklas Cassel
On Mon, Sep 25, 2023 at 03:53:23PM -0400, John Snow wrote: > Niklas, I'm sorry to lean on you here a little bit - You've been > working on the SATA side of this a bit more often, can you let me know > if you think this patch is safe? FWIW, I prefer Fiona's patch series which calls blk_aio_cancel()

Re: [PATCH v2 0/7] accel: Restrict tcg_exec_[un]realizefn() to TCG

2023-10-03 Thread Claudio Fontana
Nice. I build-tested and make checked this as well, Reviewed-by: Claudio Fontana Tested-by: Claudio Fontana On 10/3/23 14:30, Philippe Mathieu-Daudé wrote: > Since v1: > - Use 'target'/'common' in function names (Claudio) > - Added Claudio R-b tags > > From v1: > - Add missing accel_cpu_common

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

2023-10-03 Thread Richard Henderson
On 10/2/23 23:38, Philippe Mathieu-Daudé wrote: 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é --- tests/avocado/boot

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

2023-10-03 Thread Eric Auger
Hi Cédric, On 10/3/23 15:50, Cédric Le Goater wrote: > On 10/3/23 12:13, Eric Auger wrote: >> Update the script to import iommufd.h >> >> Signed-off-by: Eric Auger >> Signed-off-by: Yi Liu >> Signed-off-by: Zhenzhong Duan > > > Reviewed-by: Cédric Le Goater Sorry I forgot to grab it :-( Eric

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

2023-10-03 Thread Claudio Fontana
On 10/3/23 16:04, Richard Henderson wrote: > On 10/2/23 23:44, Philippe Mathieu-Daudé wrote: >> On 15/9/23 21:00, Philippe Mathieu-Daudé wrote: >>> - Add missing accel_cpu_unrealize() >>> - Add AccelClass::[un]realize_cpu handlers >>> - Use tcg_exec_[un]realizefn as AccelClass handlers >>> >>> Phil

Re: [PATCH v10 00/11] Add VIRTIO sound card

2023-10-03 Thread Michael S. Tsirkin
On Fri, Sep 29, 2023 at 05:08:20PM +0300, Emmanouil Pitsidianakis wrote: > This patch series adds an audio device implementing the recent virtio > sound spec (1.2) and a corresponding PCI wrapper device. > > v10 can be found online at: > > https://gitlab.com/epilys/qemu/-/tree/virtio-snd-v10 >

Re: [PATCH v10 01/11] Add virtio-sound device stub

2023-10-03 Thread Michael S. Tsirkin
On Fri, Sep 29, 2023 at 05:08:21PM +0300, Emmanouil Pitsidianakis wrote: > Add a new VIRTIO device for the virtio sound device id. Functionality > will be added in the following commits. > > Based-on: > https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 > Reviewed

[RFC PATCH 1/1] qtest/migration: Support more than one QEMU binary

2023-10-03 Thread Fabiano Rosas
We have strict rules around migration compatibility between different QEMU versions but not a single test that validates the migration state between different binaries. Add some infrastructure to allow running the migration tests with two different QEMU binaries as migration source and destination

[RFC PATCH 0/1] tests/migration-test: Allow testing older machine types

2023-10-03 Thread Fabiano Rosas
Hi, I had this WIP patch laying around that seems to fit Juan's vision about testing older machine types. It is a very rough draft for now, but it may be useful for kickstarting the discussion. With this we can give the tests two different QEMU versions. The test picks the older machine type betwe

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Michael S. Tsirkin
On Tue, Oct 03, 2023 at 03:23:24PM +0200, Laszlo Ersek wrote: > On 10/3/23 15:08, Stefan Hajnoczi wrote: > > On Tue, 3 Oct 2023 at 08:27, Michael S. Tsirkin wrote: > >> > >> On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: > >>> One more question: > >>> > >>> Why is the disabled st

Re: [PATCH v10 09/11] virtio-sound: implement audio output (TX)

2023-10-03 Thread Philippe Mathieu-Daudé
Hi Manos, On 29/9/23 20:59, Manos Pitsidianakis wrote: On Fri, 29 Sep 2023 17:08, Emmanouil Pitsidianakis wrote: Handle output IO messages in the transmit (TX) virtqueue. [..] +    if (!stream->active) { +    /* Stream has stopped, so do not perform AUD_write. */ +   

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Laszlo Ersek
On 10/3/23 16:25, Michael S. Tsirkin wrote: > On Tue, Oct 03, 2023 at 03:23:24PM +0200, Laszlo Ersek wrote: >> On 10/3/23 15:08, Stefan Hajnoczi wrote: >>> On Tue, 3 Oct 2023 at 08:27, Michael S. Tsirkin wrote: On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: > One mo

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Michael S. Tsirkin
On Mon, Oct 02, 2023 at 08:17:07PM -0400, Stefan Hajnoczi wrote: > On Mon, 2 Oct 2023 at 18:36, Michael S. Tsirkin wrote: > > > > On Mon, Oct 02, 2023 at 05:12:27PM -0400, Stefan Hajnoczi wrote: > > > On Mon, 2 Oct 2023 at 02:49, Michael S. Tsirkin wrote: > > > > > > > > On Wed, Aug 30, 2023 at 1

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

2023-10-03 Thread Philippe Mathieu-Daudé
On 3/10/23 16:04, Richard Henderson wrote: On 10/2/23 23:44, Philippe Mathieu-Daudé wrote: On 15/9/23 21:00, Philippe Mathieu-Daudé wrote: - Add missing accel_cpu_unrealize() - Add AccelClass::[un]realize_cpu handlers - Use tcg_exec_[un]realizefn as AccelClass handlers Philippe Mathieu-Daudé (

Re: [PATCH v10 01/11] Add virtio-sound device stub

2023-10-03 Thread Alex Bennée
"Michael S. Tsirkin" writes: > On Fri, Sep 29, 2023 at 05:08:21PM +0300, Emmanouil Pitsidianakis wrote: >> Add a new VIRTIO device for the virtio sound device id. Functionality >> will be added in the following commits. >> >> Based-on: >> https://github.com/OpenSynergy/qemu/commit/5a2f350eec5

[PATCH] migration: Add co-maintainers for migration

2023-10-03 Thread Peter Xu
Per the qemu upstream call a few hours ago, proposing Fabiano and myself as the co-maintainer for migration subsystem to help Juan. Cc: Fabiano Rosas Cc: Juan Quintela Signed-off-by: Peter Xu --- Fabiano, would you please ack here publically to acknowledge that you're fine with it? Thank you!

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Michael S. Tsirkin
On Tue, Oct 03, 2023 at 09:08:15AM -0400, Stefan Hajnoczi wrote: > On Tue, 3 Oct 2023 at 08:27, Michael S. Tsirkin wrote: > > > > On Mon, Oct 02, 2023 at 05:13:26PM -0400, Stefan Hajnoczi wrote: > > > One more question: > > > > > > Why is the disabled state not needed by regular (non-vhost) virtio

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-10-03 Thread Michael S. Tsirkin
On Sun, Aug 27, 2023 at 08:29:37PM +0200, Laszlo Ersek wrote: > (1) The virtio-1.0 specification > writes: > > > 3 General Initialization And Device Operation > > 3.1 Device Initialization > > 3.1.1 Driver Requirements: Device

Re: [PATCH] migration: Add co-maintainers for migration

2023-10-03 Thread Fabiano Rosas
Peter Xu writes: > Per the qemu upstream call a few hours ago, proposing Fabiano and myself as > the co-maintainer for migration subsystem to help Juan. > > Cc: Fabiano Rosas > Cc: Juan Quintela > Signed-off-by: Peter Xu Acked-by: Fabiano Rosas

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

2023-10-03 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH v10 01/11] Add virtio-sound device stub

2023-10-03 Thread Michael S. Tsirkin
On Tue, Oct 03, 2023 at 03:34:44PM +0100, Alex Bennée wrote: > > "Michael S. Tsirkin" writes: > > > On Fri, Sep 29, 2023 at 05:08:21PM +0300, Emmanouil Pitsidianakis wrote: > >> Add a new VIRTIO device for the virtio sound device id. Functionality > >> will be added in the following commits. > >

<    1   2   3   4   5   >