Re: [PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path()

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: Rename PCIDevice variable to avoid this warning : ../hw/ppc/spapr.c: In function ‘spapr_get_fw_dev_path’: ../hw/ppc/spapr.c:3217:20: warning: declaration of ‘pcidev’ shadows a previous local [-Wshadow=compatible-local] 3217 |

Re: [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector()

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: Remove extra 'drc_index' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘rtas_ibm_configure_connector’: ../hw/ppc/spapr_drc.c:1240:26: warning: declaration of ‘drc_index’ shadows a previous local

Re: [PATCH v4 00/10] linux-user: Detect and report host crashes

2023-09-19 Thread Richard Henderson
On 9/18/23 16:05, Helge Deller wrote: On 9/12/23 12:34, Michael Tokarev wrote: 12.09.2023 12:45, Helge Deller: /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/libc.a(abort.o): in function `abort': (.text.unlikely+0x0): multiple definition of `abort';

Re: [PATCH v2 4/8] qemu-img: add chunk size parameter to compare_buffers()

2023-09-19 Thread Hanna Czenczek
On 15.09.23 18:20, Andrey Drobyshev wrote: Add @chsize param to the function which, if non-zero, would represent the chunk size to be used for comparison. If it's zero, then BDRV_SECTOR_SIZE is used as default chunk size, which is the previous behaviour. In particular, we're going to use this

Re: [PULL 00/17] Net patches

2023-09-19 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 09:36:10PM +0200, Ilya Maximets wrote: > On 9/14/23 10:13, Daniel P. Berrangé wrote: > > On Wed, Sep 13, 2023 at 08:46:42PM +0200, Ilya Maximets wrote: > >> On 9/8/23 16:15, Daniel P. Berrangé wrote: > >>> On Fri, Sep 08, 2023 at 04:06:35PM +0200, Ilya Maximets wrote: >

Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt()

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘prop_get_fdt’: ../hw/ppc/spapr_drc.c:344:21: warning: declaration of ‘name’ shadows a parameter [-Wshadow=compatible-local] 344 | const char *name

Re: [PATCH 2/3] hw/mem/cxl_type3: Add missing copyright and license notice

2023-09-19 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 02:14:40PM -0700, Ira Weiny wrote: > Jonathan Cameron wrote: > > On Mon, 18 Sep 2023 17:31:38 +0100 > > Peter Maydell wrote: > > > > > On Mon, 18 Sept 2023 at 16:04, Jonathan Cameron > > > wrote: > > > > > > > > This has been missing from the start. Assume it should

Re: [RFC PATCH 3/4] accel/tcg: Guard tb_flush() with tcg_enabled() and remove the stub

2023-09-19 Thread Harsh Prateek Bora
On 9/15/23 21:12, Philippe Mathieu-Daudé wrote: On 15/9/23 17:25, Harsh Prateek Bora wrote: On 9/15/23 01:22, Philippe Mathieu-Daudé wrote: The check on tcg_enabled() make it clearer we want this call under TCG. tb_flush already has a check for tcg_enabled() in its definition. Do we

Re: [PATCH 1/8] hw/ppc: Clean up local variable shadowing in _FDT helper routine

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: this fixes numerous warnings of this type : In file included from ../hw/ppc/spapr_pci.c:43: ../hw/ppc/spapr_pci.c: In function ‘spapr_dt_phb’: ../include/hw/ppc/fdt.h:18:13: warning: declaration of ‘ret’ shadows a previous local

Re: [PATCH 15/16] tests: bios-tables-test: Add test for smbios type4 thread count2

2023-09-19 Thread Zhao Liu
Hi Igor, On Fri, Sep 15, 2023 at 03:29:07PM +0200, Igor Mammedov wrote: > Date: Fri, 15 Sep 2023 15:29:07 +0200 > From: Igor Mammedov > Subject: Re: [PATCH 15/16] tests: bios-tables-test: Add test for smbios > type4 thread count2 > X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38;

Re: [PATCH 04/16] tests: bios-tables-test: Add ACPI table binaries for type4 count test

2023-09-19 Thread Zhao Liu
Hi Igor, On Fri, Sep 15, 2023 at 03:05:10PM +0200, Igor Mammedov wrote: > Date: Fri, 15 Sep 2023 15:05:10 +0200 > From: Igor Mammedov > Subject: Re: [PATCH 04/16] tests: bios-tables-test: Add ACPI table binaries > for type4 count test > X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38;

Re: [Stable-8.1.1 11/34] softmmu: Assert data in bounds in iotlb_to_section

2023-09-19 Thread Michael Tokarev
18.09.2023 12:19, Michael Tokarev wrote: 09.09.2023 13:27, Michael Tokarev wrote: From: Richard Henderson Acked-by: Alex Bennée Suggested-by: Alex Bennée Signed-off-by: Richard Henderson (cherry picked from commit 86e4f93d827d3c1efd00cd8a906e38a2c0f2b5bc) Signed-off-by: Michael Tokarev

Re: [PATCH v4 00/10] linux-user: Detect and report host crashes

2023-09-19 Thread Michael Tokarev
18.09.2023 17:05, Helge Deller wrote: On 9/12/23 12:34, Michael Tokarev wrote: 12.09.2023 12:45, Helge Deller: /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/libc.a(abort.o): in function `abort': (.text.unlikely+0x0): multiple definition of `abort';

Re: [PATCH v4 00/10] linux-user: Detect and report host crashes

2023-09-19 Thread Helge Deller
On 9/19/23 09:40, Michael Tokarev wrote: 18.09.2023 17:05, Helge Deller wrote: On 9/12/23 12:34, Michael Tokarev wrote: 12.09.2023 12:45, Helge Deller: /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/libc.a(abort.o): in function `abort': (.text.unlikely+0x0): multiple

Re: [PATCH] hw/i386/pc: fix max_used_gpa for 32-bit systems

2023-09-19 Thread Ani Sinha
On Tue, Sep 19, 2023 at 1:38 PM Gerd Hoffmann wrote: > > Hi, > > > Anything above 4 GiB is beyond 32 bits. > > It's not that simple. Physical address space is 64G on processors with > PAE support. yeah I sent a patch previously to fix that as well.

Re: [PATCH v2 3/8] qemu-img: rebase: use backing files' BlockBackend for buffer alignment

2023-09-19 Thread Hanna Czenczek
On 15.09.23 18:20, Andrey Drobyshev wrote: Since commit bb1c05973cf ("qemu-img: Use qemu_blockalign"), buffers for the data read from the old and new backing files are aligned using BlockDriverState (or BlockBackend later on) referring to the target image. However, this isn't quite right,

Re: [PATCH v4 00/10] linux-user: Detect and report host crashes

2023-09-19 Thread Michael Tokarev
19.09.2023 11:00, Helge Deller wrote: .. Probably the right solution is to use qemu_abort() (and qemu_assert() etc), and maybe #define abort(x) qemu_abort(x).  Even if some way to redefine abort like the above will work on glibc, it does not mean it will work on *bsd and in other contexts.

Re: [PATCH 02/11] hw/i386/pc: Use qdev_prop_set_array()

2023-09-19 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 11 Sept 2023 at 17:42, Kevin Wolf wrote: >> >> Am 11.09.2023 um 17:42 hat Peter Maydell geschrieben: >> > On Fri, 8 Sept 2023 at 15:37, Kevin Wolf wrote: >> > > >> > > Instead of manually setting "foo-len" and "foo[i]" properties, build a >> > > QList and use

Re: [PATCH 7/8] spapr/pci: Clean up local variable shadowing in spapr_phb_realize()

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: Rename SysBusDevice variable to avoid this warning : ../hw/ppc/spapr_pci.c: In function ‘spapr_phb_realize’: ../hw/ppc/spapr_pci.c:1872:24: warning: declaration of ‘s’ shadows a previous local [-Wshadow=local] 1872 | SpaprPhbState

Re: [PATCH] hw/misc/mips_itu: Make MIPSITUState target agnostic

2023-09-19 Thread Richard Henderson
On 9/18/23 09:30, Philippe Mathieu-Daudé wrote: @@ -530,9 +530,12 @@ static void mips_itu_realize(DeviceState *dev, Error **errp) if (!s->cpu0) { error_setg(errp, "Missing 'cpu[0]' property"); return; +} else if (!object_dynamic_cast(OBJECT(s->cpu0),

Re: [PATCH v9 11/12] virtio-sound: implement audio capture (RX)

2023-09-19 Thread Volker Rümelin
Am 13.09.23 um 09:33 schrieb Emmanouil Pitsidianakis: > To perform audio capture we duplicate the TX logic of the previous > commit with the following difference: we receive data from the QEMU > audio backend and write it in the virt queue IO buffers the guest sends > to QEMU. When they are full

[PULL v2 0/9] testing updates (back to green!)

2023-09-19 Thread Alex Bennée
The following changes since commit 13d6b1608160de40ec65ae4c32419e56714bbadf: Merge tag 'pull-crypto-20230915' of https://gitlab.com/rth7680/qemu into staging (2023-09-18 11:04:21 -0400) are available in the Git repository at: https://gitlab.com/stsquad/qemu.git

Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: to fix : ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’: ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ shadows a parameter [-Wshadow=compatible-local] 741 | hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID

Re: [PATCH 15/16] tests: bios-tables-test: Add test for smbios type4 thread count2

2023-09-19 Thread Igor Mammedov
On Tue, 19 Sep 2023 15:12:13 +0800 Zhao Liu wrote: > Hi Igor, > > On Fri, Sep 15, 2023 at 03:29:07PM +0200, Igor Mammedov wrote: > > Date: Fri, 15 Sep 2023 15:29:07 +0200 > > From: Igor Mammedov > > Subject: Re: [PATCH 15/16] tests: bios-tables-test: Add test for smbios > > type4 thread

Re: [PATCH 4/8] spapr: Clean up local variable shadowing in spapr_init_cpus()

2023-09-19 Thread Harsh Prateek Bora
On 9/18/23 20:28, Cédric Le Goater wrote: Remove extra 'i' variable to fix this warning : ../hw/ppc/spapr.c: In function ‘spapr_init_cpus’: ../hw/ppc/spapr.c:2668:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 2668 | int i; |

Re: [PATCH v3 14/16] virtio-mem: Expose device memory via multiple memslots if enabled

2023-09-19 Thread David Hildenbrand
On 17.09.23 13:47, Maciej S. Szmigiero wrote: On 8.09.2023 16:21, David Hildenbrand wrote: 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 one gigantic

Re: [PATCH] hw/i386/pc: fix max_used_gpa for 32-bit systems

2023-09-19 Thread Gerd Hoffmann
Hi, > Anything above 4 GiB is beyond 32 bits. It's not that simple. Physical address space is 64G on processors with PAE support. take care, Gerd

Re: [QEMU PATCH v5 05/13] virtio-gpu: Configure context init for virglrenderer

2023-09-19 Thread Marc-André Lureau
Hi On Fri, Sep 15, 2023 at 6:16 PM Huang Rui wrote: > > Configure context init feature flag for virglrenderer. > > Originally-by: Antonio Caggiano > Signed-off-by: Huang Rui > --- > > V4 -> V5: > - Inverted patch 5 and 6 because we should configure > HAVE_VIRGL_CONTEXT_INIT firstly.

Re: [PATCH v4 00/10] linux-user: Detect and report host crashes

2023-09-19 Thread Richard Henderson
On 9/19/23 10:26, Michael Tokarev wrote: 19.09.2023 11:00, Helge Deller wrote: .. Probably the right solution is to use qemu_abort() (and qemu_assert() etc), and maybe #define abort(x) qemu_abort(x).  Even if some way to redefine abort like the above will work on glibc, it does not mean it will

Re: [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands

2023-09-19 Thread Marc-André Lureau
Hi On Fri, Sep 15, 2023 at 3:14 PM Huang Rui wrote: > > From: Antonio Caggiano > > Support BLOB resources creation, mapping and unmapping by calling the > new stable virglrenderer 0.10 interface. Only enabled when available and > via the blob config. E.g. -device virtio-vga-gl,blob=true > >

Re: [PATCH v3 qemu 0/3] Allow dump-guest-memory to output standard kdump format

2023-09-19 Thread Daniel P . Berrangé
On Tue, Sep 19, 2023 at 11:53:49AM +0400, Marc-André Lureau wrote: > Hi > > On Tue, Sep 19, 2023 at 3:32 AM Stephen Brennan > wrote: > > > > Hello all, > > > > This is the third version of the kdump patch series, the first and > > second revisions being visible at [1] and [2] respectively. You

Re: [PATCH v2 03/19] target/riscv: move riscv_cpu_validate_set_extensions() to tcg-cpu.c

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: This function is the core of the RISC-V validations for TCG CPUs, and it has a lot going on. Functions in cpu.c were made public to allow them to be used by the KVM accelerator class later on. 'cpu_cfg_ext_get_min_version()' is notably hard to

[QEMU PATCH v5 0/1] add freeze_mode for virtio-pci and support S3 for virtgpu

2023-09-19 Thread Jiqian Chen
Hi all, This is the v5 of Qemu patches and v5 makes below changes: * Since this series patches add a new mechanism that let virtgpu and Qemu can negotiate their reset behavior, and other guys hope me can improve this mechanism to virtio pci level, so that other virtio devices can also

[QEMU PATCH v5 2/2] virtgpu: do not destroy resources when guest does S3

2023-09-19 Thread Jiqian Chen
After guest VM resumed, you will get a black screen, and the display can't come back. It is because when guest did resuming, it called into qemu to call virtio_gpu_gl_reset. In that function, it destroyed resources created by command VIRTIO_GPU_CMD_RESOURCE_CREATE_*, which were used for display.

[QEMU PATCH v5 1/2] virtio-pci: Add freeze_mode case for virtio pci

2023-09-19 Thread Jiqian Chen
When guest vm do 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 resources of virtio-gpu. As a result, after guest resume, the display

Re: [PATCH 3/8] spapr: Clean up local variable shadowing in spapr_dt_cpus()

2023-09-19 Thread Cédric Le Goater
On 9/19/23 09:28, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: Introduce a helper routine defining one CPU device node to fix this warning :    ../hw/ppc/spapr.c: In function ‘spapr_dt_cpus’:    ../hw/ppc/spapr.c:812:19: warning: declaration of ‘cs’ shadows a previous

Re: Deadlock with SATA CD I/O and eject

2023-09-19 Thread Hanna Czenczek
On 19.09.23 12:54, Kevin Wolf wrote: Am 18.09.2023 um 19:28 hat John Levon geschrieben: Observed with base of qemu 6.2.0, but from code inspection it looks to me like it's still current in upstream master. Apologies if I have missed a fix in this area. Symptom: run a UEFI-booted SATA CD

Re: [PATCH v2 07/19] target/riscv/cpu.c: mark extensions arrays as 'const'

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: We'll need to export these arrays to the accelerator classes in the next patches. Mark them as 'const' now because they should not be modified at runtime. Note that 'riscv_cpu_options' will also be exported, but can't be marked as 'const',

Re: [PATCH v2 06/19] target/riscv: move 'host' CPU declaration to kvm.c

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: This CPU only exists if we're compiling with KVM so move it to the kvm specific file. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones --- target/riscv/cpu.c | 16

Re: [PATCH v2 09/19] target/riscv: make riscv_add_satp_mode_properties() public

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: This function is used for both accelerators. Make it public, and call it from kvm_riscv_cpu_add_kvm_properties(). This will make it easier to split KVM specific code for the KVM accelerator class in the next patch. Signed-off-by: Daniel

Re: [PATCH v2 08/19] target/riscv: move riscv_cpu_add_kvm_properties() to kvm.c

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: We'll introduce the KVM accelerator class with a 'cpu_instance_init' implementation that is going to be invoked during the common riscv_cpu_post_init() (via accel_cpu_instance_init()). This instance_init will execute KVM exclusive code that TCG

Re: [PATCH v2 11/19] target/riscv: introduce KVM AccelCPUClass

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: Add a KVM accelerator class like we did with TCG. The difference is that, at least for now, we won't be using a realize() implementation for this accelerator. We'll start by assiging kvm_riscv_cpu_add_kvm_properties(), renamed to

Re: [PATCH v2 12/19] target/riscv: move KVM only files to kvm subdir

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: Move the files to a 'kvm' dir to promote more code separation between accelerators and making our lives easier supporting build options such as --disable-tcg. Rename kvm.c to kvm-cpu.c to keep it in line with its TCG counterpart.

Re: [PATCH] riscv: Call set_satp_mode_max_supported in riscv_host_cpu_init

2023-09-19 Thread Andrew Jones
On Tue, Sep 19, 2023 at 09:57:32AM +0200, Andreas Schwab wrote: > When running in KVM mode with -cpu host, cfg.satp_mode.supported is not > initialized, causing an infinite loop in riscv_cpu_satp_mode_finalize. > > Fixes: 6df3747a27 ("riscv: Introduce satp mode hw capabilities") > Signed-off-by:

[PATCH v5 3/5] vhost-user-scsi: support reconnect to backend

2023-09-19 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +-

[PATCH v5 1/5] vhost-user-common: send get_inflight_fd once

2023-09-19 Thread Li Feng
Currently the get_inflight_fd will be sent every time the device is started, and the backend will allocate shared memory to save the inflight state. If the backend finds that it receives the second get_inflight_fd, it will release the previous shared memory, which breaks inflight working logic.

[VIRTIO PCI PATCH v5 0/1] Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Jiqian Chen
Hi all, This is the v5 patches and makes below changes: * Since this series patches add a new mechanism that let virtgpu and Qemu can negotiate their reset behavior, and other guys hope me can improve this mechanism to virtio pci level, so that other virtio devices can also benefit from it.

[PATCH v5 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-19 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git

[VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Jiqian Chen
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 when guest resume, that function will destroy render resources of virtio-gpu. As a result, after

[PATCH v5 5/5] vhost-user: fix lost reconnect

2023-09-19 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v5 0/5] Implement reconnect for vhost-user-scsi

2023-09-19 Thread Li Feng
Ping ... Could anyone review this series and merge them? Changes for v5: - No logic has been changed, just move part of the code from patch 4 to patch 5. Changes for v4: - Merge https://lore.kernel.org/all/20230830045722.611224-1-fen...@smartx.com/ to this series. - Add ERRP_GUARD in

[PATCH v5 2/5] vhost: move and rename the conn retry times

2023-09-19 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v2 04/19] target/riscv: move riscv_tcg_ops to tcg-cpu.c

2023-09-19 Thread LIU Zhiwei
On 2023/9/6 17:16, Daniel Henrique Barboza wrote: Move the remaining of riscv_tcg_ops now that we have a working realize() implementation. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: LIU Zhiwei Zhiwei ---

Re: [PATCH v2 6/8] iotests/{024, 271}: add testcases for qemu-img rebase

2023-09-19 Thread Hanna Czenczek
On 15.09.23 18:20, Andrey Drobyshev wrote: As the previous commit changes the logic of "qemu-img rebase" (it's using write alignment now), let's add a couple more test cases which would ensure it works correctly. In particular, the following scenarios: 024: add test case for rebase within one

Re: [PATCH v2] hw/i386/pc: improve physical address space bound check for 32-bit systems

2023-09-19 Thread Ani Sinha
On Tue, Sep 19, 2023 at 4:08 PM Ani Sinha wrote: > > 32-bit systems do not have a reserved memory for hole64 and memory hotplug is > not supported on those systems. Therefore, the maximum limit of the guest > physical address coincides with the end of "above 4G memory space" region. > Make sure

Re: [PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path()

2023-09-19 Thread Cédric Le Goater
On 9/19/23 10:23, Harsh Prateek Bora wrote: On 9/18/23 20:28, Cédric Le Goater wrote: Rename PCIDevice variable to avoid this warning :    ../hw/ppc/spapr.c: In function ‘spapr_get_fw_dev_path’:    ../hw/ppc/spapr.c:3217:20: warning: declaration of ‘pcidev’ shadows a previous local

Re: [PATCH 1/1] block: improve alignment detection and fix 271 test

2023-09-19 Thread Denis V. Lunev
On 9/7/23 23:53, Denis V. Lunev wrote: Unfortunately 271 IO test is broken if started in non-cached mode. Commits commit a6b257a08e3d72219f03e461a52152672fec0612 Author: Nir Soffer Date: Tue Aug 13 21:21:03 2019 +0300 file-posix: Handle undetectable alignment and

Re: [PATCH v2 3/4] vfio/pci: use an invalid fd to enable MSI-X

2023-09-19 Thread Cédric Le Goater
On 9/18/23 11:45, Jing Liu wrote: Guests typically enable MSI-X with all of the vectors masked in the MSI-X vector table. To match the guest state of device, QEMU enables MSI-X by enabling vector 0 with userspace triggering and immediately release. However the release function actually does not

Re: [PULL v2 0/9] testing updates (back to green!)

2023-09-19 Thread Alex Bennée
Stefan Hajnoczi writes: > There is some funny business with tests/lcitool/libvirt-ci. Please > rebase on master and send a v3. Sorry for the trouble, I am afraid I > would mess something up with the submodule if I attempted to resolve > it myself. > > (If you don't see a conflict when

Re: [PATCH] block: mark aio_poll as non-coroutine

2023-09-19 Thread Kevin Wolf
Am 08.09.2023 um 09:54 hat Paolo Bonzini geschrieben: > It is forbidden to block on the event loop during a coroutine, as that > can cause deadlocks due to recursive locking. > > Signed-off-by: Paolo Bonzini Thanks, applied to the block branch. Kevin

[PATCH v4 1/5] softmmu: Per-AddressSpace bounce buffering

2023-09-19 Thread Mattias Nissler
Instead of using a single global bounce buffer, give each AddressSpace its own bounce buffer. The MapClient callback mechanism moves to AddressSpace accordingly. This is in preparation for generalizing bounce buffer handling further to allow multiple bounce buffers, with a total allocation limit

[PATCH v4 0/5] Support message-based DMA in vfio-user server

2023-09-19 Thread Mattias Nissler
This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models as PCIe endpoints to a hardware design.

[PATCH v4 4/5] vfio-user: Message-based DMA support

2023-09-19 Thread Mattias Nissler
Wire up support for DMA for the case where the vfio-user client does not provide mmap()-able file descriptors, but DMA requests must be performed via the VFIO-user protocol. This installs an indirect memory region, which already works for pci_dma_{read,write}, and pci_dma_map works thanks to the

Re: [PATCH v2 06/12] range: Introduce range_inverse_array()

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:41 +0200 Eric Auger wrote: > This helper reverses an array of regions, turning original > regions into holes and original holes into actual regions, > covering the whole UINT64_MAX span. > > Signed-off-by: Eric Auger > > --- > > v1 -> v2: > - Move

Re: [PATCH v2 4/4] vfio/pci: enable MSI-X in interrupt restoring on dynamic allocation

2023-09-19 Thread Cédric Le Goater
On 9/18/23 11:45, Jing Liu wrote: During migration restoring, vfio_enable_vectors() is called to restore enabling MSI-X interrupts for assigned devices. It sets the range from 0 to nr_vectors to kernel to enable MSI-X and the vectors unmasked in guest. During the MSI-X enabling, all the vectors

Re: [PULL v2 0/9] testing updates (back to green!)

2023-09-19 Thread Stefan Hajnoczi
There is some funny business with tests/lcitool/libvirt-ci. Please rebase on master and send a v3. Sorry for the trouble, I am afraid I would mess something up with the submodule if I attempted to resolve it myself. (If you don't see a conflict when rebasing, please wait until the end of the day

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:38 +0200 Eric Auger wrote: > Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE > capability is supported. > > This allows to propagate the information though the IOMMU MR > set_iova_ranges() callback so that virtual IOMMUs > get aware of those

Re: [PATCH v3 1/5] softmmu: Per-AddressSpace bounce buffering

2023-09-19 Thread Mattias Nissler
On Fri, Sep 15, 2023 at 10:37 AM Mattias Nissler wrote: > > On Wed, Sep 13, 2023 at 8:30 PM Peter Xu wrote: > > > > On Thu, Sep 07, 2023 at 06:04:06AM -0700, Mattias Nissler wrote: > > > @@ -3105,6 +3105,9 @@ void address_space_init(AddressSpace *as, > > > MemoryRegion *root, const char *name)

Re: [PATCH 20/52] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port

2023-09-19 Thread Peter Xu
On Mon, Sep 18, 2023 at 04:41:34PM +0200, Markus Armbruster wrote: > qemu_rdma_data_init() neglects to set an Error when it fails because > @host_port is null. Fortunately, no caller passes null, so this is Indeed they all seem to be non-null. Before this patch, qemu_rdma_data_init() can still

Re: [PATCH v1 14/22] vfio/common: Simplify vfio_viommu_preset()

2023-09-19 Thread Cédric Le Goater
On 8/30/23 12:37, Zhenzhong Duan wrote: Commit "vfio/container-base: Introduce [attach/detach]_device container callbacks" add support to link to address space, we can utilize it to simplify vfio_viommu_preset(). Signed-off-by: Zhenzhong Duan This looks like a revert of patch 07. Can it be

Re: [PATCH 19/52] migration/rdma: Fix qemu_get_cm_event_timeout() to always set error

2023-09-19 Thread Peter Xu
On Mon, Sep 18, 2023 at 04:41:33PM +0200, Markus Armbruster wrote: > qemu_get_cm_event_timeout() neglects to set an error when it fails > because rdma_get_cm_event() fails. Harmless, as its caller > qemu_rdma_connect() substitutes a generic error then. Fix it anyway. > > qemu_rdma_connect()

Re: [PATCH v2 05/19] target/riscv/cpu.c: add .instance_post_init()

2023-09-19 Thread Daniel Henrique Barboza
On 9/19/23 06:16, LIU Zhiwei wrote: On 2023/9/6 17:16, Daniel Henrique Barboza wrote: All generic CPUs call riscv_cpu_add_user_properties(). The 'max' CPU calls riscv_init_max_cpu_extensions(). Both can be moved to a common instance_post_init() callback, implemented in

[PATCH v4 5/5] vfio-user: Fix config space access byte order

2023-09-19 Thread Mattias Nissler
PCI config space is little-endian, so on a big-endian host we need to perform byte swaps for values as they are passed to and received from the generic PCI config space access machinery. Signed-off-by: Mattias Nissler --- hw/remote/vfio-user-obj.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4 3/5] Update subprojects/libvfio-user

2023-09-19 Thread Mattias Nissler
Brings in assorted bug fixes. The following are of particular interest with respect to message-based DMA support: * bb308a2 "Fix address calculation for message-based DMA" Corrects a bug in DMA address calculation. * 1569a37 "Pass server->client command over a separate socket pair" Adds

[PATCH v4 2/5] softmmu: Support concurrent bounce buffers

2023-09-19 Thread Mattias Nissler
When DMA memory can't be directly accessed, as is the case when running the device model in a separate process without shareable DMA file descriptors, bounce buffering is used. It is not uncommon for device models to request mapping of several DMA regions at the same time. Examples include: *

Re: [PULL v2 0/9] testing updates (back to green!)

2023-09-19 Thread Stefan Hajnoczi
On Tue, 19 Sept 2023 at 12:00, Alex Bennée wrote: > > > Stefan Hajnoczi writes: > > > There is some funny business with tests/lcitool/libvirt-ci. Please > > rebase on master and send a v3. Sorry for the trouble, I am afraid I > > would mess something up with the submodule if I attempted to

Re: [PATCH v2 5/8] qemu-img: rebase: avoid unnecessary COW operations

2023-09-19 Thread Andrey Drobyshev
On 9/19/23 13:46, Hanna Czenczek wrote: > On 15.09.23 18:20, Andrey Drobyshev wrote: >> When rebasing an image from one backing file to another, we need to >> compare data from old and new backings.  If the diff between that data >> happens to be unaligned to the target cluster size, we might end

Re: [PATCH 00/52] migration/rdma: Error handling fixes

2023-09-19 Thread Peter Xu
On Mon, Sep 18, 2023 at 04:41:14PM +0200, Markus Armbruster wrote: > Oh dear, where to start. There's so much wrong, and in pretty obvious > ways. This code should never have passed review. I'm refraining from > saying more; see the commit messages instead. > > Issues remaining after this

[PATCH v3 7/8] qemu-img: add compression option to rebase subcommand

2023-09-19 Thread Andrey Drobyshev via
If we rebase an image whose backing file has compressed clusters, we might end up wasting disk space since the copied clusters are now uncompressed. In order to have better control over this, let's add "--compress" option to the "qemu-img rebase" command. Note that this option affects only the

[PATCH v3 6/8] iotests/{024, 271}: add testcases for qemu-img rebase

2023-09-19 Thread Andrey Drobyshev via
As the previous commit changes the logic of "qemu-img rebase" (it's using write alignment now), let's add a couple more test cases which would ensure it works correctly. In particular, the following scenarios: 024: add test case for rebase within one backing chain when the overlay cluster

[PATCH v3 2/8] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size

2023-09-19 Thread Andrey Drobyshev via
Before previous commit, rebase was getting infitely stuck in case of rebasing within the same backing chain and when overlay_size > backing_size. Let's add this case to the rebasing test 024 to make sure it doesn't break again. Signed-off-by: Andrey Drobyshev Reviewed-by: Denis V. Lunev

[PATCH v3 0/8] qemu-img: rebase: add compression support

2023-09-19 Thread Andrey Drobyshev via
v2 --> v3: * Patch 3/8: fixed logic in the if statement, so that we align on blk when blk_old_backing == NULL; * Patch 4/8: comment fix; * Patch 5/8: comment fix; dropped redundant "if (blk_new_backing)" statements. v2:

[PATCH v3 3/8] qemu-img: rebase: use backing files' BlockBackend for buffer alignment

2023-09-19 Thread Andrey Drobyshev via
Since commit bb1c05973cf ("qemu-img: Use qemu_blockalign"), buffers for the data read from the old and new backing files are aligned using BlockDriverState (or BlockBackend later on) referring to the target image. However, this isn't quite right, because buf_new is only being used for reading from

[PATCH v3 5/8] qemu-img: rebase: avoid unnecessary COW operations

2023-09-19 Thread Andrey Drobyshev via
When rebasing an image from one backing file to another, we need to compare data from old and new backings. If the diff between that data happens to be unaligned to the target cluster size, we might end up doing partial writes, which would lead to copy-on-write and additional IO. Consider the

[PATCH v3 1/8] qemu-img: rebase: stop when reaching EOF of old backing file

2023-09-19 Thread Andrey Drobyshev via
In case when we're rebasing within one backing chain, and when target image is larger than old backing file, bdrv_is_allocated_above() ends up setting *pnum = 0. As a result, target offset isn't getting incremented, and we get stuck in an infinite for loop. Let's detect this case and proceed

[PATCH v3 8/8] iotests: add tests for "qemu-img rebase" with compression

2023-09-19 Thread Andrey Drobyshev via
The test cases considered so far: 314 (new test suite): 1. Check that compression mode isn't compatible with "-f raw" (raw format doesn't support compression). 2. Check that rebasing an image onto no backing file preserves the data and writes the copied clusters actually compressed. 3.

[PATCH v3 4/8] qemu-img: add chunk size parameter to compare_buffers()

2023-09-19 Thread Andrey Drobyshev via
Add @chsize param to the function which, if non-zero, would represent the chunk size to be used for comparison. If it's zero, then BDRV_SECTOR_SIZE is used as default chunk size, which is the previous behaviour. In particular, we're going to use this param in img_rebase() to make the write

Re: [PATCH v1 15/22] Add iommufd configure option

2023-09-19 Thread Cédric Le Goater
On 8/30/23 12:37, Zhenzhong Duan wrote: This adds "--enable-iommufd/--disable-iommufd" to enable or disable iommufd support, enabled by default. Why would someone want to disable support at compile time ? It might have been useful for dev but now QEMU should self-adjust at runtime depending

Re: [PATCH v4 2/5] softmmu: Support concurrent bounce buffers

2023-09-19 Thread Peter Xu
On Tue, Sep 19, 2023 at 09:08:10AM -0700, Mattias Nissler wrote: > @@ -3119,31 +3143,35 @@ void *address_space_map(AddressSpace *as, > void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len, > bool is_write, hwaddr access_len) > { > -if (buffer !=

Re: [PATCH v4 1/5] softmmu: Per-AddressSpace bounce buffering

2023-09-19 Thread Peter Xu
On Tue, Sep 19, 2023 at 09:08:09AM -0700, Mattias Nissler wrote: > Instead of using a single global bounce buffer, give each AddressSpace > its own bounce buffer. The MapClient callback mechanism moves to > AddressSpace accordingly. > > This is in preparation for generalizing bounce buffer

Re: [PULL 0/8] Hppa btlb patches

2023-09-19 Thread Stefan Hajnoczi
Please take a look at the following CI failure and resend when you have fixed the error: mipsel-linux-gnu-gcc -Ilibqemu-hppa-softmmu.fa.p -I. -I.. -Itarget/hppa -I../target/hppa -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/capstone -I/usr/include/spice-server

Re: [PATCH v1 13/22] vfio: Add base container

2023-09-19 Thread Cédric Le Goater
On 8/30/23 12:37, Zhenzhong Duan wrote: From: Yi Liu Abstract the VFIOContainer to be a base object. It is supposed to be embedded by legacy VFIO container and later on, into the new iommufd based container. The base container implements generic code such as code related to memory_listener

Re: [PATCH v2 12/12] vfio: Remove 64-bit IOVA address space assumption

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:47 +0200 Eric Auger wrote: > Now we retrieve the usable IOVA ranges from the host, > we now the physical IOMMU aperture and we can remove > the assumption of 64b IOVA space when calling > vfio_host_win_add(). > > This works fine in general but in case of an IOMMU

Re: [PULL 00/28] Block layer patches

2023-09-19 Thread Stefan Hajnoczi
On Tue, 19 Sept 2023 at 06:26, Kevin Wolf wrote: > > Am 18.09.2023 um 20:56 hat Stefan Hajnoczi geschrieben: > > Hi Kevin, > > I believe that my own commit "block-coroutine-wrapper: use > > qemu_get_current_aio_context()" breaks this test. The failure is > > non-deterministic (happens about 1 out

Concerns regarding e17bebd049 ("dump: Set correct vaddr for ELF dump")

2023-09-19 Thread Stephen Brennan
Hello all, I've started working on better support and documentation around hypervisor vmcores in the Drgn debugger[1]. Of course there's quite a lot of different implementations out there, but recently I'm looking at Qemu kdump and ELF vmcores generated via dump-guest-memory, and one thing caught

npcm7xx_timer-test.c is unreliable

2023-09-19 Thread Stefan Hajnoczi
Hi, Sometimes npcm7xx_timer-test fails intermittently: https://gitlab.com/qemu-project/qemu/-/jobs/5121787250 38/96 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test ERROR 0.95s exit status 1 >>> QTEST_QEMU_BINARY=./qemu-system-arm >>>

Re: [PATCH v23 01/20] CPU topology: extend with s390 specifics

2023-09-19 Thread Nina Schoetterl-Glausch
On Tue, 2023-09-19 at 14:47 +0200, Markus Armbruster wrote: > Nina Schoetterl-Glausch writes: > > > From: Pierre Morel > > > > S390 adds two new SMP levels, drawers and books to the CPU > > topology. > > S390 CPUs have specific topology features like dedication and > > entitlement. These

Re: npcm7xx_timer-test.c is unreliable

2023-09-19 Thread Hao Wu
> > Let me take a look at that. I suspect the timer is off by 1 tick due to > some rounding errors.

<    1   2   3