[PULL 2/3] docs/specs/riscv-iommu: Fixed broken link to external risv iommu document

2025-03-27 Thread Alistair Francis
From: "hemanshu.khilari.foss" The links to riscv iommu specification document are incorrect. This patch updates all the said link to point to correct location. Cc: qemu-sta...@nongnu.org Cc: qemu-ri...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2808 Signed-off-by: hemansh

[PULL 3/3] Revert "target/riscv/kvm: add missing KVM CSRs"

2025-03-27 Thread Alistair Francis
From: Daniel Henrique Barboza This commit breaks KVM boot on older kernels, like reported in [1], due to senvcfg not being available in them. There's also another problem related to scounteren. Using a recent enough guest buildroot, 'ping' will be build with rdtime support. In this case, doing a

[PULL 1/3] docs: Added docs/specs/riscv-iommu.rst in MAINTAINERS file.

2025-03-27 Thread Alistair Francis
From: "hemanshu.khilari.foss" Added docs/specs/riscv-iommu.rst under `RISC-V TCG CPUs` section in in MAINTAINERS file since `scripts/get_maintainer.pl -f docs/specs/riscv-iommu.rst` doesn't list any maintainers. Signed-off-by: hemanshu.khilari.foss Reviewed-by: Alistair Francis Message-ID: <20

Re: [RFC v5 3/7] vhost: Forward descriptors to device via packed SVQ

2025-03-27 Thread Eugenio Perez Martin
On Fri, Mar 28, 2025 at 6:10 AM Sahil Siddiq wrote: > > Hi, > > On 3/26/25 5:32 PM, Eugenio Perez Martin wrote: > > On Mon, Mar 24, 2025 at 3:00 PM Sahil Siddiq wrote: > >> > >> Implement the insertion of available buffers in the descriptor area of > >> packed shadow virtqueues. It takes into acc

Re: [PATCH v2 08/10] target/i386/kvm: reset AMD PMU registers during VM reset

2025-03-27 Thread ewanhai
Hi Zhao, Thank you for pointing out the potential impact on Zhaoxin CPUs! Hi Dongli, Zhaoxin (including vendor "__shanghai__" and "centaurhauls")'s PMU is compatible with Intel, so I have some advice for this patch. 在 2025/3/3 06:00, Dongli Zhang 写道: [snip] + +static bool is_same_vendor(CPUX8

Re: [RFC v5 3/7] vhost: Forward descriptors to device via packed SVQ

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 5:32 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 3:00 PM Sahil Siddiq wrote: Implement the insertion of available buffers in the descriptor area of packed shadow virtqueues. It takes into account descriptor chains, but does not consider indirect descriptors. Enable

Re: [PATCH for-10.0] Revert "target/riscv/kvm: add missing KVM CSRs"

2025-03-27 Thread Alistair Francis
On Fri, Mar 28, 2025 at 1:22 AM Daniel Henrique Barboza wrote: > > This commit breaks KVM boot on older kernels, like reported in [1], due > to senvcfg not being available in them. > > There's also another problem related to scounteren. Using a recent > enough guest buildroot, 'ping' will be build

Re: [RFC v5 6/7] vhost: Validate transport device features for packed vqs

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 5:36 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 3:00 PM Sahil Siddiq wrote: Validate transport device features required for utilizing packed SVQ that both guests can use with the SVQ and SVQs can use with vdpa. Signed-off-by: Sahil Siddiq --- Changes from v4 -> v

Re: [RFC v5 2/7] vhost: Data structure changes to support packed vqs

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 4:56 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 3:00 PM Sahil Siddiq wrote: Introduce "struct vring_packed". Modify VhostShadowVirtqueue so it can support split and packed virtqueue formats. Signed-off-by: Sahil Siddiq --- Changes from v4 -> v5: - This was commi

Re: [RFC v5 5/7] vhost: Forward descriptors to guest via packed vqs

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 2:04 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 3:34 PM Sahil Siddiq wrote: Hi, I had a few more queries here as well. On 3/24/25 7:29 PM, Sahil Siddiq wrote: Detect when used descriptors are ready for consumption by the guest via packed virtqueues and forward t

Re: [RFC v5 1/7] vhost: Refactor vhost_svq_add_split

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 4:55 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 2:59 PM Sahil Siddiq wrote: This commit refactors vhost_svq_add_split and vhost_svq_add to simplify their implementation and prepare for the addition of packed vqs in the following commits. Signed-off-by: Sahil Siddi

Re: [PATCH for-10.0] Revert "target/riscv/kvm: add missing KVM CSRs"

2025-03-27 Thread Alistair Francis
On Fri, Mar 28, 2025 at 1:22 AM Daniel Henrique Barboza wrote: > > This commit breaks KVM boot on older kernels, like reported in [1], due > to senvcfg not being available in them. > > There's also another problem related to scounteren. Using a recent > enough guest buildroot, 'ping' will be build

[PATCH] target/ppc: Deprecate Power8E and Power8NVL

2025-03-27 Thread Aditya Gupta
Power8E and Power8NVL variants are not of much use in QEMU now, and not being maintained either. Deprecate the 8E and 8NVL variants. After deprecation, QEMU will print a warning like below when the CPU/Chips are used: $ ./build/qemu-system-ppc64 -M powernv8 --cpu power8nvl -nographic qem

[PATCH v2 13/30] accel/tcg: fix missing includes for TARGET_HAS_PRECISE_SMC

2025-03-27 Thread Pierrick Bouvier
We prepare to remove cpu.h from cpu-all.h, which will transitively remove it from accel/tcg/tb-internal.h, and thus from most of tcg compilation units. Note: this was caught by a test regression for s390x-softmmu. Signed-off-by: Pierrick Bouvier --- include/exec/poison.h | 1 + accel/tcg/tb-mai

[PATCH] hw/scsi/lsi53c895a: fix memory leak in lsi_scsi_realize()

2025-03-27 Thread Zheng Huang
Hi, This patch addresses a memory leak bug in the usages of `timer_del()`. The issue arisesfrom the incorrect use of the ambiguous timer API `timer_del()`, which does not free the timer object. The LeakSanitizer report this issue during fuzzing. The correct API `timer_free()` freed the timer objec

Re: Re: [PATCH] hw/net/e1000: fix memory leak in timer_del()

2025-03-27 Thread Zheng Huang
Hello Prasad, 在 2025/3/27 20:40, Prasad Pandit wrote: >> @@ -360,13 +360,13 @@ e1000e_intrmgr_fire_all_timers(E1000ECore *core) >> int i; >> >> if (core->itr.running) { >> -timer_del(core->itr.timer); >> +timer_free(core->itr.timer); >> e1000e_intrmgr_on_throttli

[PATCH 08/17] target/avr: Add offset-io cpu property

2025-03-27 Thread Richard Henderson
Communicate the offset of io within the first page between the board, the cpu, and the translator. So far this is always 0. This will be used to optimize memory layout. Signed-off-by: Richard Henderson --- target/avr/cpu.h | 2 ++ hw/avr/atmega.c| 2 ++ target/avr/cpu.c | 1

[PULL 0/1] bug fix for 10.0

2025-03-27 Thread Song Gao
The following changes since commit b876e721f1c939f3e83ac85bd3c1c2821e12b3fa: Update version for v10.0.0-rc1 release (2025-03-25 13:58:14 -0400) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongarch-20250327 for you to fetch changes up to

[PULL 1/1] target/loongarch: Fix the cpu unplug resource leak

2025-03-27 Thread Song Gao
From: Xianglai Li When the cpu is created, qemu_add_vm_change_state_handler is called in the kvm_arch_init_vcpu function to create the VMChangeStateEntry resource. However, the resource is not released when the cpu is destroyed. This results in a qemu process segment error when the virtual machi

Re: [PATCH] 9pfs: fix 'total_open_fd' decrementation

2025-03-27 Thread Christian Schoenebeck
On Thursday, March 20, 2025 11:59:38 AM CET Greg Kurz wrote: > On Thu, 20 Mar 2025 10:48:11 +0100 > Christian Schoenebeck wrote: > > > On Wednesday, March 19, 2025 7:52:51 PM CET Greg Kurz wrote: > > > On Wed, 19 Mar 2025 13:14:27 +0100 > > > Christian Schoenebeck wrote: > > > > > > > On Wednes

Re: [PATCH-for-10.0 06/12] hw/i2c/pca954x: Categorize and add description

2025-03-27 Thread Thomas Huth
On 25/03/2025 23.43, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/i2c_mux_pca954x.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/i2c/i2c_mux_pca954x.c b/hw/i2c/i2c_mux_pca954x.c index 779cc4e66ed..100b8d86093 100644 --- a/hw/i

RE: [PATCH for-10.1 24/32] vfio: Introduce new files for dirty tracking definitions and declarations

2025-03-27 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH for-10.1 24/32] vfio: Introduce new files for dirty >tracking >definitions and declarations > >On 20/03/2025 09:52, Duan, Zhenzhong wrote: >>> -Original Message- >>> From: Cédric Le Goater >>> Subject: [PATCH for-10.

RE: [PATCH v1 1/1] hw/i2c/aspeed: Fix wrong I2CC_DMA_LEN when I2CM_DMA_TX/RX_ADDR set first

2025-03-27 Thread Jamin Lin
Hi Cedric, > Cc: Troy Lee ; long...@lenovo.com > Subject: Re: [PATCH v1 1/1] hw/i2c/aspeed: Fix wrong I2CC_DMA_LEN when > I2CM_DMA_TX/RX_ADDR set first > > Hello Jamin > > On 3/27/25 08:44, Jamin Lin wrote: > > In the previous design, the I2C model would update I2CC_DMA_LEN (0x54) > > based on

Re: [PATCH] tests/functional/test_ppc64_replay: Mark the e500 test as flaky

2025-03-27 Thread Daniel P . Berrangé
On Thu, Mar 20, 2025 at 07:50:12AM +0100, Thomas Huth wrote: > The test_ppc64_e500 occasionally fails (it just hangs and finally times > out). The same issue could also be reproduced with the former Avocado > test already (especially if the host system is under heavy load), so > it's not a new regr

[PATCH v2 12/30] accel/tcg: fix missing includes for TCG_GUEST_DEFAULT_MO

2025-03-27 Thread Pierrick Bouvier
We prepare to remove cpu.h from cpu-all.h, which will transitively remove it from accel/tcg/tb-internal.h, and thus from most of tcg compilation units. Signed-off-by: Pierrick Bouvier --- accel/tcg/internal-target.h | 1 + include/exec/poison.h | 1 + accel/tcg/translate-all.c | 1 + 3 f

[PULL 3/3] mailmap: Update email address for Akihiko Odaki

2025-03-27 Thread Michael Tokarev
From: Akihiko Odaki It's too late but better than never. Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 5f6df414e1..33fe75400f 100644 --- a/.mailmap +++ b/.mai

Re: [PATCH v1 1/2] util: Add functions for s390x mmio read/write

2025-03-27 Thread Farhan Ali
On 3/27/2025 12:20 PM, Stefan Hajnoczi wrote: On Wed, Mar 26, 2025 at 11:10:06AM -0700, Farhan Ali wrote: Starting with z15 (or newer) we can execute mmio instructions from userspace. On older platforms where we don't have these instructions available we can fallback to using system calls to a

Re: [PATCH] hw/pci-host/gt64120.c: Fix PCI host bridge endianness handling

2025-03-27 Thread BALATON Zoltan
On Thu, 27 Mar 2025, rakeshj wrote: The GT-64120 PCI controller requires special handling where: 1. Host bridge (device 0) must use native endianness 2. Other devices follow MByteSwap bit in GT_PCI0_CMD Previous implementation accidentally swapped all accesses, breaking host bridge detection (ls

Re: [PATCH-for-10.0 10/12] hw/rtc: Categorize and add description

2025-03-27 Thread Bernhard Beschow
Am 25. März 2025 22:43:08 UTC schrieb "Philippe Mathieu-Daudé" : >Signed-off-by: Philippe Mathieu-Daudé >--- > hw/rtc/ds1338.c | 2 ++ > hw/rtc/m41t80.c | 2 ++ > hw/rtc/rs5c372.c | 2 ++ For rs5c372: Acked-by: Bernhard Beschow > 3 files changed, 6 insertions(+) > >diff --git a/hw/rtc/ds1338

[PATCH v7 3/7] ppc/pnv: Add XIVE2 controller to Power11

2025-03-27 Thread Aditya Gupta
Add a XIVE2 controller to Power11 chip and machine. The controller has the same logic as Power10. Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivasan Cc: Nicholas Piggin Reviewed-by: Cédric Le Goater Signed-off-by: Aditya Gupta --- hw/ppc/pnv.c | 133

[PATCH] tests/functional: Remove semicolons at the end of lines

2025-03-27 Thread Thomas Huth
From: Thomas Huth Yes, we are all C coders who try to write Python code for testing... but still, let's better avoid semicolons at the end of the lines to keep "pylint" happy! Signed-off-by: Thomas Huth --- tests/functional/aspeed.py| 2 +- tests/functional/test_aarch64_as

[PATCH] hw/pci-host/gt64120.c: Fix PCI host bridge endianness handling

2025-03-27 Thread rakeshj
The GT-64120 PCI controller requires special handling where: 1. Host bridge (device 0) must use native endianness 2. Other devices follow MByteSwap bit in GT_PCI0_CMD Previous implementation accidentally swapped all accesses, breaking host bridge detection (lspci -d 11ab:4620). This fix: - Adds d

[PATCH v7 4/7] ppc/pnv: Add PHB5 PCIe Host bridge to Power11

2025-03-27 Thread Aditya Gupta
Power11 also uses PHB5, same as Power10. Add Power11 PHBs with similar code as the corresponding Power10 implementation. Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivasan Cc: Nicholas Piggin Reviewed-by: Cédric Le Goater Signed-off-by: Aditya Gupta --- hw/ppc/pnv.c | 57 +

[PATCH v7 6/7] tests/powernv: Switch to buildroot images instead of op-build

2025-03-27 Thread Aditya Gupta
As op-build images haven't been updated from long time (and may not get updated in future), use buildroot images provided by cedric [1]. Use existing nvme device being used in the test to mount the initrd. Also replace the check for "zImage loaded message" to skiboot's message when it starts the

[PATCH v7 5/7] ppc/pnv: Add ChipTOD model for Power11

2025-03-27 Thread Aditya Gupta
Introduce Power11 ChipTod. The code has been copied from Power10 ChipTod code as the Power11 core is same as Power10 core. Cc: Cédric Le Goater Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivasan Cc: Nicholas Piggin Signed-off-by: Aditya Gupta --- hw/ppc/pnv.c

[PATCH v7 2/7] ppc/pnv: Introduce Power11 PowerNV machine

2025-03-27 Thread Aditya Gupta
The Powernv11 machine doesn't have XIVE & PHBs as of now XIVE2 interface and PHB5 added in later patches to Powernv11 machine Also add mention of Power11 to powernv documentation Note: A difference from P10's and P11's machine_class_init is, in P11 different number of PHBs cannot be used on the

[PATCH v7 1/7] ppc/pnv: Introduce Pnv11Chip

2025-03-27 Thread Aditya Gupta
Implement Pnv11Chip, currently without chiptod, xive and phb. Chiptod, XIVE, PHB are implemented in later patches. Since Power11 core is same as Power10, the implementation of Pnv11Chip is a duplicate of corresponding Pnv10Chip. Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivas

[PATCH v7 0/7] Power11 support for QEMU [PowerNV]

2025-03-27 Thread Aditya Gupta
Overview Add support for Power11 powernv machine type. As Power11 core is same as Power10, hence much of the code has been reused from Power10. Split Powernv11 chip/machine code into commits introducing: chip,machine,xive,phb This is to try to keep the code smaller in each commit,

[PATCH v7 7/7] tests/powernv: Add PowerNV test for Power11

2025-03-27 Thread Aditya Gupta
With all Power11 support in place, add Power11 PowerNV test. Cc: Cédric Le Goater Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivasan Cc: Nicholas Piggin Signed-off-by: Aditya Gupta --- tests/functional/test_ppc64_powernv.py | 4 1 file changed, 4 insertions(+) diff --

Re: [PATCH v1 00/22] Fix incorrect hash results on AST2700

2025-03-27 Thread Cédric Le Goater
Hello Jamin On 3/21/25 10:25, Jamin Lin wrote: v1: 1. Added support for 64-bit DMA in the HACE model 2. Refactored the do_hash operation in the HACE model 3. Fixed a crash caused by out-of-bound memory access in HACE 4. Added more trace events and implemented dumping of source hash data

Re: [PATCH v1 2/2] block/nvme: Enable NVMe userspace driver for s390x

2025-03-27 Thread Farhan Ali
On 3/27/2025 12:26 PM, Stefan Hajnoczi wrote: On Wed, Mar 26, 2025 at 11:10:07AM -0700, Farhan Ali wrote: +static inline uint32_t nvme_mmio_read_32(const void *addr) +{ +uint32_t ret; + +#ifdef __s390x__ +ret = s390x_pci_mmio_read_32(addr); +#else +/* Prevent the compiler from opti

Re: [PATCH v1 1/2] util: Add functions for s390x mmio read/write

2025-03-27 Thread Stefan Hajnoczi
On Wed, Mar 26, 2025 at 11:10:06AM -0700, Farhan Ali wrote: > Starting with z15 (or newer) we can execute mmio > instructions from userspace. On older platforms > where we don't have these instructions available > we can fallback to using system calls to access > the PCI mapped resources. > > This

Re: [PATCH v1 2/2] block/nvme: Enable NVMe userspace driver for s390x

2025-03-27 Thread Stefan Hajnoczi
On Wed, Mar 26, 2025 at 11:10:07AM -0700, Farhan Ali wrote: > +static inline uint32_t nvme_mmio_read_32(const void *addr) > +{ > +uint32_t ret; > + > +#ifdef __s390x__ > +ret = s390x_pci_mmio_read_32(addr); > +#else > +/* Prevent the compiler from optimizing away the load */ > +ret

[RFC 3/3] vdagent: Drop blocker to support migration

2025-03-27 Thread yong . huang
From: Hyman Huang Signed-off-by: Hyman Huang --- ui/vdagent.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index 4635e8fa56..36b0568135 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -6,7 +6,6 @@ #include "qemu/option.h" #include "qemu/units.h"

RE: [PATCH for-10.1 v2 14/37] vfio: Move VFIOAddressSpace helpers into container-base.c

2025-03-27 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH for-10.1 v2 14/37] vfio: Move VFIOAddressSpace helpers into >container-base.c > >VFIOAddressSpace is a common object used by VFIOContainerBase which is >declared in "hw/vfio/vfio-container-base.h". Move the VFIOAddressSpace >r

[PULL 1/1] migration: Avoid SNP guest crash due to duplicate cpr blocker

2025-03-27 Thread Fabiano Rosas
From: Steve Sistare With aux-ram-share=off, booting an SNP guest fails with: ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. This is because a CPR blocker for the guest_memfd ramblock is added twice, once in ram_block_add_cpr_blocker because aux-ram-share=off so rb->fd < 0,

[PULL 0/1] Migration patches for 2025-03-27

2025-03-27 Thread Fabiano Rosas
The following changes since commit b876e721f1c939f3e83ac85bd3c1c2821e12b3fa: Update version for v10.0.0-rc1 release (2025-03-25 13:58:14 -0400) are available in the Git repository at: https://gitlab.com/farosas/qemu.git tags/migration-20250327-pull-request for you to fetch changes up to

Re: [PATCH v2 10/11] hw/avr: Prepare for TARGET_PAGE_SIZE > 256

2025-03-27 Thread Richard Henderson
On 3/27/25 13:24, Philippe Mathieu-Daudé wrote: On 25/3/25 23:44, Richard Henderson wrote: If i/o does not cover the entire first page, allocate a portion of ram as an i/o device, so that the entire first page is i/o. While memory_region_init_ram_device_ptr is happy to allocate the RAMBlock, it

Re: [RFC v5 3/7] vhost: Forward descriptors to device via packed SVQ

2025-03-27 Thread Sahil Siddiq
Hi, On 3/26/25 1:33 PM, Eugenio Perez Martin wrote: On Mon, Mar 24, 2025 at 3:14 PM Sahil Siddiq wrote: On 3/24/25 7:29 PM, Sahil Siddiq wrote: Implement the insertion of available buffers in the descriptor area of packed shadow virtqueues. It takes into account descriptor chains, but does no

Re: [PATCH v6 07/10] ppc/pnv: Introduce Power11 PowerNV machine

2025-03-27 Thread Aditya Gupta
On 25/03/26 11:09PM, Cédric Le Goater wrote: > On 3/26/25 18:21, Aditya Gupta wrote: > > On 26/03/25 13:39, Cédric Le Goater wrote: > > > > > On 3/25/25 18:38, Aditya Gupta wrote: > > > > <...snip...> > > > > > > > > On 25/03/25 22:45, Cédric Le Goater wrote: > > > > > One nice about it IIRC was

Re: [PATCH V2] migration: cpr breaks SNP guest

2025-03-27 Thread Fabiano Rosas
Steve Sistare writes: > With aux-ram-share=off, booting an SNP guest fails with: > > ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. > > This is because a CPR blocker for the guest_memfd ramblock is added > twice, once in ram_block_add_cpr_blocker because aux-ram-share=off so

Re: [PATCH v2 10/11] hw/avr: Prepare for TARGET_PAGE_SIZE > 256

2025-03-27 Thread Philippe Mathieu-Daudé
On 25/3/25 23:44, Richard Henderson wrote: If i/o does not cover the entire first page, allocate a portion of ram as an i/o device, so that the entire first page is i/o. While memory_region_init_ram_device_ptr is happy to allocate the RAMBlock, it does not register the ram for migration. Do this

[PATCH] target/i386: Reset parked vCPUs together with the online ones

2025-03-27 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Commit 3f2a05b31ee9 ("target/i386: Reset TSCs of parked vCPUs too on VM reset") introduced a way to reset TSCs of parked vCPUs during VM reset to prevent them getting desynchronized with the online vCPUs and therefore causing the KVM PV clock to lose PVCLOCK_TSC_STABLE

Re: [PATCH v2 1/5] target/riscv: pmp: don't allow RLB to bypass rule privileges

2025-03-27 Thread Daniel Henrique Barboza
On 3/13/25 4:30 PM, Loïc Lefort wrote: When Smepmp is supported, mseccfg.RLB allows bypassing locks when writing CSRs but should not affect interpretation of actual PMP rules. This is not the case with the current implementation where pmp_hart_has_privs calls pmp_is_locked which implements ms

Re: [PATCH-for-10.1 6/8] target/mips: Introduce mips_cpu_is_64bit() helper

2025-03-27 Thread Philippe Mathieu-Daudé
On 26/3/25 19:22, Richard Henderson wrote: On 3/25/25 10:40, Philippe Mathieu-Daudé wrote: mips_cpu_is_64bit() returns whether the CPU is a 32-bit or a 64-bit one. Signed-off-by: Philippe Mathieu-Daudé ---   target/mips/cpu-qom.h | 2 ++   target/mips/cpu.c | 6 ++   2 files changed, 8 i

Re: [PATCH 01/15] fuse: Copy write buffer content before polling

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:35PM +0100, Hanna Czenczek wrote: > Polling in I/O functions can lead to nested read_from_fuse_export() "Polling" means several different things. "aio_poll()" or "nested event loop" would be clearer. > calls, overwriting the request buffer's content. The only functi

RE: [PATCH for-10.1 v2 09/37] vfio: Move VFIOHostDMAWindow definition into spapr.c

2025-03-27 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH for-10.1 v2 09/37] vfio: Move VFIOHostDMAWindow definition >into spapr.c > >VFIOHostDMAWindow is only used in file "spapr.c". Move it there. > >Reviewed-by: John Levon >Link: https://lore.kernel.org/qemu-devel/20250318095415.

Re: [PATCH v2 0/5] target/riscv: Smepmp fixes to match specification

2025-03-27 Thread Loïc Lefort
Ping On Thu, Mar 13, 2025 at 8:30 PM Loïc Lefort wrote: > These patches fix Smepmp implementation to make it compliant with the spec. > > First patch limits RLB to CSR changes since RLB should not affect privilege > evaluation. Patch 2 extracts some common code into a function (to be used > in >

Re: [PATCH 1/4] migration/savevm: Add a compatibility check for capabilities

2025-03-27 Thread Marco Cavenati
Hello Fabiano, First of all thanks a lot for the quick follow up to my issue! I just want to point out that with only mapped-ram enabled (without multifd) savevm/loadvm do not lead to a crash but just to an error according to my (few) experiments (on upstream). Ciao Marco On Thursday, March 27

[PATCH 1/4] qemu-img: fix division by zero in bench_cb() for zero-sized

2025-03-27 Thread gerben
From: Denis Rastyogin This error was discovered by fuzzing qemu-img. This commit fixes a division by zero error in the bench_cb() function that occurs when using the bench command with a zero-sized image. The issue arises because b->image_size can be zero, leading to a division by zero in the m

[PATCH 4/4] qemu-img: improve queue depth validation in img_bench

2025-03-27 Thread gerben
From: Denis Rastyogin This error was discovered by fuzzing qemu-img. Currently, running `qemu-img bench -d 0` in img_bench is allowed, which is a pointless operation and causes qemu-img to hang. Signed-off-by: Denis Rastyogin --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH 3/4] qemu-img: prevent stack overflow in bench by using bottom half

2025-03-27 Thread gerben
From: Denis Rastyogin This error was discovered by fuzzing qemu-img. Previously, new I/O requests were launched synchronously inside the completion callback `bench_cb`, leading to deep recursion and stack overflow. This patch moves the launching of new requests to a separate function `bench_bh`,

[PATCH 2/4] qemu-img: fix offset calculation in bench

2025-03-27 Thread gerben
From: Denis Rastyogin This error was discovered by fuzzing qemu-img. The current offset calculation leads to an EIO error in block/block-backend.c: blk_check_byte_request(): if (offset > len || len - offset < bytes) { return -EIO; } This triggers the error message: "qemu-img: Failed req

[PATCH 0/4] Fix qemu-img bench issues and improve checks

2025-03-27 Thread gerben
From: Denis Rastyogin This series fixes several qemu-img crashes found during fuzzing. The patch "qemu-img: fix division by zero in bench_cb() for zero-sized" was already submitted earlier: https://lore.kernel.org/qemu-devel/20250318101933.255617-1-ger...@altlinux.org/ However, it has bee

Re: [PATCH v3 0/3] i.MX 8M Plus EVK Fixes

2025-03-27 Thread Philippe Mathieu-Daudé
Bernhard Beschow (3): hw/arm/imx8mp-evk: Fix reference count of SoC object hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE hw/arm/fsl-imx8mp: Remove unused define Series queued to hw-misc, thanks!

Re: [PATCH for-10.1] hw/riscv: do not mark any machine as default

2025-03-27 Thread Philippe Mathieu-Daudé
On 27/3/25 17:14, Philippe Mathieu-Daudé wrote: On 27/3/25 14:02, Daniel Henrique Barboza wrote: Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible

Re: [PATCH for-10.1] hw/riscv: do not mark any machine as default

2025-03-27 Thread Philippe Mathieu-Daudé
On 27/3/25 14:02, Daniel Henrique Barboza wrote: Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible. Today we have 7 risc64 and 6 riscv32 machines

Re: [PATCH V2] migration: cpr breaks SNP guest

2025-03-27 Thread Tom Lendacky
On 3/27/25 09:52, Steve Sistare wrote: > With aux-ram-share=off, booting an SNP guest fails with: > > ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. > > This is because a CPR blocker for the guest_memfd ramblock is added > twice, once in ram_block_add_cpr_blocker because aux-

Re: [PATCH for-10.1 v2 27/37] vfio: Make vfio_devices_query_dirty_bitmap() static

2025-03-27 Thread John Levon
On Wed, Mar 26, 2025 at 08:51:12AM +0100, Cédric Le Goater wrote: > vfio_devices_query_dirty_bitmap() is only used in "container-base.c". > Also, rename to vfio_container_devices_query_dirty_bitmap() to reflect > with the prefix 'vfio_container_devices_' that it simply loops over > the container's

Re: [PATCH v8 0/7] Allow to enable multifd and postcopy migration together

2025-03-27 Thread Prasad Pandit
On Thu, 27 Mar 2025 at 20:05, Fabiano Rosas wrote: > I'll get to it soon. I need to send a PR for the recent SNP breakage and > also check Li Zhijian's RDMA series first. * I see, okay. Thank you for an update, I appreciate it. Thank you. --- - Prasad

Re: [PATCH 15/15] fuse: Increase MAX_WRITE_SIZE with a second buffer

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:55PM +0100, Hanna Czenczek wrote: > We probably want to support larger write sizes than just 4k; 64k seems > nice. However, we cannot read partial requests from the FUSE FD, we > always have to read requests in full; so our read buffer must be large > enough to accomm

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:54PM +0100, Hanna Czenczek wrote: > FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs > (via open("/dev/fuse") + ioctl(FUSE_DEV_IOC_CLONE)). > > We can use this to implement multi-threading. > > Note that the interface presented here differs fro

Re: [PATCH 12/15] fuse: Reduce max read size

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:52PM +0100, Hanna Czenczek wrote: > We are going to introduce parallel processing via coroutines, a maximum > read size of 64 MB may be problematic, allowing users of the export to > force us to allocate quite large amounts of memory with just a few > requests. > > At

Re: [PATCH 11/15] fuse: Manually process requests (without libfuse)

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:51PM +0100, Hanna Czenczek wrote: > Manually read requests from the /dev/fuse FD and process them, without > using libfuse. This allows us to safely add parallel request processing > in coroutines later, without having to worry about libfuse internals. > (Technically,

Re: [PATCH 13/15] fuse: Process requests in coroutines

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:53PM +0100, Hanna Czenczek wrote: > Make fuse_process_request() a coroutine_fn (fuse_co_process_request()) > and have read_from_fuse_fd() launch it inside of a newly created > coroutine instead of running it synchronously. This way, we can process > requests in parall

[PATCH for-10.0] Revert "target/riscv/kvm: add missing KVM CSRs"

2025-03-27 Thread Daniel Henrique Barboza
This commit breaks KVM boot on older kernels, like reported in [1], due to senvcfg not being available in them. There's also another problem related to scounteren. Using a recent enough guest buildroot, 'ping' will be build with rdtime support. In this case, doing a ping in a KVM guest while expos

Re: [PATCH 10/15] fuse: Add halted flag

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:50PM +0100, Hanna Czenczek wrote: > This is a flag that we will want when processing FUSE requests > ourselves: When the kernel sends us e.g. a truncated request (i.e. we > receive less data than the request's indicated length), we cannot rely > on subsequent data to b

Re: [PATCH 09/15] fuse: Introduce fuse_{inc,dec}_in_flight()

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:49PM +0100, Hanna Czenczek wrote: > This is how vduse-blk.c does it, and it does seem better to have > dedicated functions for it. > > Signed-off-by: Hanna Czenczek > --- > block/export/fuse.c | 29 + > 1 file changed, 21 insertions(+), 8

Re: [PATCH 08/15] fuse: Introduce fuse_{at,de}tach_handlers()

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:48PM +0100, Hanna Czenczek wrote: > Pull setting up and tearing down the AIO context handlers into two > dedicated functions. > > Signed-off-by: Hanna Czenczek > --- > block/export/fuse.c | 32 > 1 file changed, 16 insertions(+), 16

Re: [PATCH 1/4] migration/savevm: Add a compatibility check for capabilities

2025-03-27 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Thu, Mar 27, 2025 at 11:39:31AM -0300, Fabiano Rosas wrote: >> It has always been possible to enable arbitrary migration capabilities >> and attempt to take a snapshot of the VM with the savevm/loadvm >> commands as well as their QMP counterparts >> snapshot-save/s

Re: [PATCH 07/15] fuse: Set direct_io and parallel_direct_writes

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:47PM +0100, Hanna Czenczek wrote: > In fuse_open(), set these flags: > - direct_io: We probably actually don't want to have the host page cache > be used for our exports. QEMU block exports are supposed to represent > the image as-is (and thus potentially changing

[PATCH 0/4] migration: savevm testing

2025-03-27 Thread Fabiano Rosas
Hi, we had a bug report that enabling multifd and attempting savevm/loadvm crashes QEMU. This seems to have been around for many years. I'm adding a fix for this in the form of a capabilities check for snapshots. I'm also adding a couple of tests that validate migration capabilities are properly

Re: [PATCH 04/15] fuse: Explicitly set inode ID to 1

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:44PM +0100, Hanna Czenczek wrote: > Setting .st_ino to the FUSE inode ID is kind of arbitrary. While in > practice it is going to be fixed (to FUSE_ROOT_ID, which is 1) because > we only have the root inode, that is not obvious in fuse_getattr(). > > Just explicitly

Re: [PATCH 06/15] fuse: Fix mount options

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:46PM +0100, Hanna Czenczek wrote: > Since I actually took a look into how mounting with libfuse works[1], I > now know that the FUSE mount options are not exactly standard mount > system call options. Specifically: > - We should add "nosuid,nodev,noatime" because that

Re: [PATCH 05/15] fuse: Change setup_... to mount_fuse_export()

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:45PM +0100, Hanna Czenczek wrote: > There is no clear separation between what should go into > setup_fuse_export() and what should stay in fuse_export_create(). > > Make it clear that setup_fuse_export() is for mounting only. Rename it, > and move everything that has

Re: [PATCH 1/4] migration/savevm: Add a compatibility check for capabilities

2025-03-27 Thread Daniel P . Berrangé
On Thu, Mar 27, 2025 at 11:39:31AM -0300, Fabiano Rosas wrote: > It has always been possible to enable arbitrary migration capabilities > and attempt to take a snapshot of the VM with the savevm/loadvm > commands as well as their QMP counterparts > snapshot-save/snapshot-load. > > Most migration c

Re: [PATCH 03/15] fuse: Remove superfluous empty line

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:43PM +0100, Hanna Czenczek wrote: > Signed-off-by: Hanna Czenczek > --- > block/export/fuse.c | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

[PATCH V2] migration: cpr breaks SNP guest

2025-03-27 Thread Steve Sistare
With aux-ram-share=off, booting an SNP guest fails with: ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. This is because a CPR blocker for the guest_memfd ramblock is added twice, once in ram_block_add_cpr_blocker because aux-ram-share=off so rb->fd < 0, and once in ram_block_

Re: [PATCH 02/15] fuse: Ensure init clean-up even with error_fatal

2025-03-27 Thread Stefan Hajnoczi
On Tue, Mar 25, 2025 at 05:06:42PM +0100, Hanna Czenczek wrote: > When exports are created on the command line (with the storage daemon), > errp is going to point to error_fatal. Without ERRP_GUARD, we would > exit immediately when *errp is set, i.e. skip the clean-up code under > the `fail` label

Re: [PATCH 0/4] migration: savevm testing

2025-03-27 Thread Fabiano Rosas
Fabiano Rosas writes: > Hi, we had a bug report that enabling multifd and attempting > savevm/loadvm crashes QEMU. This seems to have been around for many > years. > > I'm adding a fix for this in the form of a capabilities check for > snapshots. > > I'm also adding a couple of tests that validat

Re: [PATCH V1] migration: cpr breaks SNP guest

2025-03-27 Thread Steven Sistare
On 3/27/2025 10:21 AM, Fabiano Rosas wrote: Steve Sistare writes: With aux-ram-share=off, booting an SNP guest fails with: ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. This is because a CPR blocker for the guest_memfd ramblock is added twice, once in ram_block_add_cpr

[PULL 6/8] hw/loongarch/virt: Eliminate error_propagate()

2025-03-27 Thread Markus Armbruster
From: Bibo Mao When there is an error, it is put into a local variable and then propagated to somewhere else. Instead the error can be set right away, error propagation can be removed. Signed-off-by: Bibo Mao Message-ID: <20250320032158.1762751-5-maob...@loongson.cn> Reviewed-by: Markus Armbrus

Re: [PATCH] target/ppc: Fix e200 duplicate SPRs

2025-03-27 Thread Philippe Mathieu-Daudé
On 20/3/25 13:27, Nicholas Piggin wrote: DSRR0/1 registers are in the BookE ISA not e200 specific, so remove the duplicate e200 register definitions. Cc: qemu-sta...@nongnu.org Cc: Author: Roman Kapl Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2768 Fixes: 0e3bf4890906 ("ppc: add

[PATCH 4/4] tests/qtest/migration: Add savevm tests

2025-03-27 Thread Fabiano Rosas
Add a test file for savevm tests so the snapshot functionality can be better tested in the context of migration. There's currently issues with migration capabilities causing crashes in QEMU when running savevm. Start with a couple of tests, one that simply saves and loads a snapshot and another to

[PATCH 3/4] tests/qtest/migration: Add QMP helpers for snapshot

2025-03-27 Thread Fabiano Rosas
Add helpers to call QMP snapshot commands and monitor the snapshot job. Signed-off-by: Fabiano Rosas --- tests/qtest/migration/migration-qmp.c | 120 ++ tests/qtest/migration/migration-qmp.h | 4 + 2 files changed, 124 insertions(+) diff --git a/tests/qtest/migration/m

[PATCH 1/4] migration/savevm: Add a compatibility check for capabilities

2025-03-27 Thread Fabiano Rosas
It has always been possible to enable arbitrary migration capabilities and attempt to take a snapshot of the VM with the savevm/loadvm commands as well as their QMP counterparts snapshot-save/snapshot-load. Most migration capabilities are not meant to be used with snapshots and there's a risk of c

Re: [PATCH v8 0/7] Allow to enable multifd and postcopy migration together

2025-03-27 Thread Fabiano Rosas
Prasad Pandit writes: > Hello Fabiano, > > On Tue, 18 Mar 2025 at 18:10, Prasad Pandit wrote: >> * This series (v8) splits earlier patch-2 which enabled multifd and >> postcopy options together into two separate patches. One modifies >> the channel discovery in migration_ioc_process_incoming

[PATCH] migration: add FEATURE_SEEKABLE to QIOChannelBlock

2025-03-27 Thread Marco Cavenati
Enable the use of the mapped-ram migration feature with savevm/loadvm snapshots by adding the QIO_CHANNEL_FEATURE_SEEKABLE feature to QIOChannelBlock. Implement io_preadv and io_pwritev methods to provide positioned I/O capabilities that don't modify the channel's position pointer. Signed-off-by:

Re: [PATCH V1] migration: cpr breaks SNP guest

2025-03-27 Thread Fabiano Rosas
Steve Sistare writes: > With aux-ram-share=off, booting an SNP guest fails with: > > ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. > > This is because a CPR blocker for the guest_memfd ramblock is added > twice, once in ram_block_add_cpr_blocker because aux-ram-share=off so

Re: [PATCH V1] migration: cpr breaks SNP guest

2025-03-27 Thread Tom Lendacky
On 3/27/25 08:36, Steve Sistare wrote: > With aux-ram-share=off, booting an SNP guest fails with: > > ../util/error.c:68: error_setv: Assertion `*errp == NULL' failed. > > This is because a CPR blocker for the guest_memfd ramblock is added > twice, once in ram_block_add_cpr_blocker because aux-

  1   2   >