[PATCH] qdev, rust/hpet: fix type of HPET "timers" property

2025-03-20 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c | 35 ++ rust/hw/timer/hpet/src/hpet.rs | 6 +++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qde

[PATCH 1/1] hw/intc/aspeed: Fix IRQ handler mask check

2025-03-20 Thread Steven Lee via
Updated the IRQ handler mask check to AND with select variable. This ensures that the interrupt service routine is correctly triggered for the interrupts within the same irq group. For example, both `eth0` and the debug UART are handled in `GICINT132`. Without this fix, the debug console may hang

RE: [PATCH for-10.1 11/32] vfio: Introduce a new header file for VFIOcontainer declarations

2025-03-20 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH for-10.1 11/32] vfio: Introduce a new header file for >VFIOcontainer declarations > >Gather all VFIOcontainer related declarations into "container.h" to >reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". > >These de

[PATCH 0/1] hw/intc/aspeed: Fix IRQ handler mask check

2025-03-20 Thread Steven Lee via
Dear maintainers, This patch addresses an issue in the ast27x0 interrupt controller where the IRQ handler mask check does not correctly apply the select variable. The fix ensures that the interrupt service routine (ISR) is triggered appropriately for interrupts within the same IRQ group. Please h

Re: [PATCH 3/3] cleanup: Drop pointless label at end of function

2025-03-20 Thread Daniel P . Berrangé
On Wed, Mar 19, 2025 at 02:42:21PM -0500, Corey Minyard wrote: > On Wed, Mar 19, 2025 at 08:21:20PM +0100, Markus Armbruster wrote: > > Corey Minyard writes: > > > > > Is this official coding style? I'm not a big fan of having return > > > statements in the middle of functions, I generally only

Re: [PATCH for-10.1 22/32] vfio: Move vfio_device_list into device.c

2025-03-20 Thread John Levon
On Tue, Mar 18, 2025 at 10:54:05AM +0100, Cédric Le Goater wrote: > 'vfio_device_list' is VFIODevice related. Move its definitions into > "device.c". > > Signed-off-by: Cédric Le Goater Reviewed-by: John Levon regards john

Re: [PATCH for-10.1 27/32] vfio: Rename VFIODevice related services

2025-03-20 Thread John Levon
On Tue, Mar 18, 2025 at 10:54:10AM +0100, Cédric Le Goater wrote: > index > 4fdb74e33c427595a9b0a4d28b2b5a70df951e4e..9000702aed960ccb69ca67ec052f1ebe11ee1919 > 100644 > --- a/hw/vfio/ap.c > +++ b/hw/vfio/ap.c > @@ -117,7 +117,7 @@ static bool vfio_ap_register_irq_notifier(VFIOAPDevice > *vapde

Re: [PATCH v6] hw/misc/vmfwupdate: Introduce hypervisor fw-cfg interface support

2025-03-20 Thread Jörg Rödel
(Excuse my delayed reply, still suffering from some flu or whatever...) On Mon, Mar 17, 2025 at 10:56:04AM +0100, Gerd Hoffman wrote: > Yep. But we have to sort the details. > > (1) How we are going to load kernel + initrd in case the firmware is > igvm? Just update the igvm to also inclu

[PATCH 0/2] rust: Kconfig: factor out Rust vs C impl choice

2025-03-20 Thread Peter Maydell
This patchset fixes a compilation failure if CONFIG_VMAPPLE is enabled in a Rust build, which happens because hw/vmapple/Kconfig didn't have the "pick the Rust PL011 if Rust is enabled" logic in it. Rather than just adding that to yet another PL011-using board model, this patchset refactors how we

Re: [PATCH 1/1] target/loongarch: fix bad shift in check_ps()

2025-03-20 Thread bibo mao
On 2025/3/19 上午9:41, Song Gao wrote: In expression 1ULL << tlb_ps, left shifting by more than 63 bits has undefined behavior. The shift amount, tlb_ps, is as much as 64. check "tlb_ps >=64" to fix. Resolves: Coverity CID 1593475 Fixes: d882c284a3 ("target/loongarch: check tlb_ps") Suggest

Re: [PATCH v5 23/24] hw/uefi: add MAINTAINERS entry

2025-03-20 Thread Philippe Mathieu-Daudé
On 25/2/25 17:30, Gerd Hoffmann wrote: Signed-off-by: Gerd Hoffmann --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1911949526ce..451fc33306dc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2807,6 +2807,12 @@ F: hw/misc/ivshmem-flat.c

Re: [PATCH 02/10] gdbstub: introduce target independent gdb register helper

2025-03-20 Thread Philippe Mathieu-Daudé
Hi Alex, On 19/3/25 19:22, Alex Bennée wrote: The current helper.h functions rely on hard coded assumptions about target endianess to use the tswap macros. We also end up double swapping a bunch of values if the target can run in multiple endianess modes. Avoid this by getting the target to pass

Re: [PATCH 02/10] gdbstub: introduce target independent gdb register helper

2025-03-20 Thread Akihiko Odaki
On 2025/03/20 3:22, Alex Bennée wrote: The current helper.h functions rely on hard coded assumptions about target endianess to use the tswap macros. We also end up double swapping a bunch of values if the target can run in multiple endianess modes. Avoid this by getting the target to pass the end

Re: [PATCH v5 2/6] hw/loongarch/virt: Fix error handling in cpu plug

2025-03-20 Thread bibo mao
On 2025/3/20 下午3:25, Markus Armbruster wrote: bibo mao writes: On 2025/3/20 下午2:16, Markus Armbruster wrote: Bibo Mao writes: In function virt_cpu_plug(), it will send cpu plug message to interrupt controller extioi and ipi irqchip. If there is problem in this function, system should con

Re: [PATCH for-10.1 19/32] vfio: Introduce a new file for VFIODevice definitions

2025-03-20 Thread Cédric Le Goater
On 3/19/25 17:42, John Levon wrote: On Tue, Mar 18, 2025 at 10:54:02AM +0100, Cédric Le Goater wrote: diff --git a/hw/vfio/device.c b/hw/vfio/device.c new file mode 100644 index ..daa5bae59ca9c65ef23aa193d4e63976fcefdde0 --- /dev/null +++ b/hw/vfio/devic

Re: VDPA MAC address problem

2025-03-20 Thread Cindy Lu
Hi Konstantin yes, we have found this kind of issue in this upstream So here is a fix for this problem in kernel https://lore.kernel.org/kvm/caclfguuyny6-1cyabsgs+qtdzo+mkp3o09t_gt-bmm4jgdp...@mail.gmail.com/T/ vdpa: support set mac address from vdpa tool This tool allows the user to change the M

RE: [PATCH for-10.1 09/32] vfio: Introduce a new header file for VFIOIOMMUFD declarations

2025-03-20 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH for-10.1 09/32] vfio: Introduce a new header file for >VFIOIOMMUFD declarations > >Gather all VFIOIOMMUFD related declarations into "iommufd.h" to >reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". > >Signed-off-by:

Re: [PATCH 10/10] target/microblaze: convert gdbstub to new helper

2025-03-20 Thread Philippe Mathieu-Daudé
On 19/3/25 19:22, Alex Bennée wrote: This is a pretty simple conversion which will be trivial to update once TARGET_BIGENDIAN is replaced with a helper function. Signed-off-by: Alex Bennée --- target/microblaze/gdbstub.c | 44 ++--- 1 file changed, 17 insertio

Re: [PATCH v5 0/6] target/loongarch: Fix some issues reported from coccinelle

2025-03-20 Thread bibo mao
On 2025/3/20 下午3:01, Markus Armbruster wrote: Bibo Mao writes: This patch set solves errors reported by coccinelle tool with commands: spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/ spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/ The main problem

Re: [PATCH v5 2/6] hw/loongarch/virt: Fix error handling in cpu plug

2025-03-20 Thread Markus Armbruster
bibo mao writes: On 2025/3/20 下午2:16, Markus Armbruster wrote: >> Bibo Mao writes: >> >>> In function virt_cpu_plug(), it will send cpu plug message to interrupt >>> controller extioi and ipi irqchip. If there is problem in this function, >>> system should continue to run and keep state the sam

[PATCH] virtio-gpu-virgl: fix a bug in context create

2025-03-20 Thread liweishi
From: Weishi Li When VIRGL_VERSION_MAJOR<1, virtio_gpu_context_init_enabled will always return false, causing virgl_cmd_context_create to always return error. Therefore, it is necessary to also include the virtio_gpu_context_init_enabled segment in the VIRGL_VERSION_MAJOR judgment to ensure that

Re: [PATCH 09/10] include/exec: fix assert in size_memop

2025-03-20 Thread Philippe Mathieu-Daudé
On 20/3/25 07:29, Akihiko Odaki wrote: Updating the email address of Juan Quintela according to .mailmap. On 2025/03/20 3:22, Alex Bennée wrote: We can handle larger sized memops now, expand the range of the assert. Fixes: 4b473e0c60 (tcg: Expand MO_SIZE to 3 bits) Signed-off-by: Alex Bennée

Re: [PATCH v2 1/2] util/qemu-sockets: Add support for keep-alive flag to passive sockets

2025-03-20 Thread Vladimir Sementsov-Ogievskiy
On 19.03.25 19:36, Juraj Marcin wrote: From: Juraj Marcin Commit aec21d3175 (qapi: Add InetSocketAddress member keep-alive) introduces the keep-alive flag, which enables the SO_KEEPALIVE socket option, but only on client-side sockets. However, this option is also useful for server-side sockets,

Re: [PATCH v2 2/2] utils/qemu-sockets: Introduce keep-alive-idle-period inet socket option

2025-03-20 Thread Vladimir Sementsov-Ogievskiy
On 19.03.25 19:36, Juraj Marcin wrote: From: Juraj Marcin The default idle period for TCP connection could be even 2 hours. However, in some cases, the application needs to be aware of a connection issue much sooner. This is the case, for example, for postcopy live migration. If there is no tra

Re: [PULL 19/25] rust: pl011: switch to safe chardev operation

2025-03-20 Thread Peter Maydell
On Wed, 19 Mar 2025 at 20:51, Paolo Bonzini wrote: > > On 3/19/25 20:25, Peter Maydell wrote: > > Hi -- this commit seems to have broken use of the PL011 in > > boards/SoCs that directly embed it in their state structs, so > > "qemu-system-arm -M raspi2b -display none" now asserts on startup. > >

[PATCH 06/10] target/ppc: make ppc_maybe_bswap_register static

2025-03-20 Thread Alex Bennée
It's not used outside of the gdbstub code. Signed-off-by: Alex Bennée --- target/ppc/cpu.h | 1 - target/ppc/gdbstub.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 1e833ade04..950bb6e06c 100644 --- a/target/ppc/cpu.h +++ b/ta

Re: [PATCH v2 4/4] docs/firmware: add feature flag for qemu variable store

2025-03-20 Thread Daniel P . Berrangé
On Wed, Mar 19, 2025 at 02:03:09PM +0100, Gerd Hoffmann wrote: > Hi, > > > > > > There is 'stateless' already for 'firmware image in r/o flash'. > > > > > > > > What's the behaviour of UEFI if build with JSON vars support, but > > > > without > > > > QEMU providing any JSON vars backend ? > >

ANN: working on an accelerator for MSHV

2025-03-20 Thread Magnus Kulke
Hi all, We would like to informally announce an effort we started at Microsoft to expose the Microsoft Hypervisor (MSHV) as an alternative accelerator in Qemu on Linux hosts. L1 VMs that have been launched on Azure or HyperV will be able to use a /dev/mshv device to accelerate the operation of L2

Re: [PATCH v2 1/3] virtio: add VM state change cb with return value

2025-03-20 Thread Haoqian He
> 2025年3月19日 22:50,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:32AM -0400, Haoqian He wrote: >> This patch contains two changes: >> >> 1. Add VM state change cb type VMChangeStateHandlerExt which has return >> value for virtio devices VMChangeStateEntry. When VM state changes, >>

Re: [PATCH v2 2/3] vhost: return failure if stop virtqueue failed in vhost_dev_stop

2025-03-20 Thread Haoqian He
> 2025年3月19日 23:11,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:33AM -0400, Haoqian He wrote: >> The backend maybe crash when vhost_dev_stop and GET_VRING_BASE >> would fail, we can return failure to indicate the connection >> with the backend is broken. >> >> Signed-off-by: Haoqia

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-03-20 Thread Haoqian He
> 2025年3月19日 23:20,Stefano Garzarella 写道: > > On Fri, Mar 14, 2025 at 06:15:34AM -0400, Haoqian He wrote: >> Live migration should be terminated if the backend crashes before >> the migration completes. >> >> Since the vhost device will be stopped when VM is stopped before >> the end of the l

[PATCH] target/ppc: Fix facility interrupt checks for VSX

2025-03-20 Thread Nicholas Piggin
Facility interrupt checks in general should come after the ISA version check, because the facility interrupt and facility type themselves are ISA dependent and should not appear on CPUs where the instruction does not exist at all. This resolves a QEMU crash booting NetBSD/macppc due to qemu: fa

[PATCH 0/3] rust: Fix PL011State size mismatch assert

2025-03-20 Thread Peter Maydell
We have some users of the PL011 struct which embed it directly into their own state structs. This means that the Rust version of the device must have a state struct that is the same size or smaller than the C struct. In commit 9b642097d6b7 ("rust: pl011: switch to safe chardev operation") the Rust

[PATCH 1/3] rust: assertions: add static_assert

2025-03-20 Thread Peter Maydell
From: Paolo Bonzini Add a new assertion that is similar to "const { assert!(...) }" but can be used outside functions and with older versions of Rust. A similar macro is found in Linux, whereas the "static_assertions" crate has a const_assert macro that produces worse error messages. Suggested-

[PATCH 3/3] rust: pl011: Check size of state struct at compile time

2025-03-20 Thread Peter Maydell
The PL011 device's C implementation exposes its PL011State struct to users of the device, and one common usage pattern is to embed that struct into the user's own state struct. (The internals of the struct are technically visible to the C user of the device, but in practice are treated as implemen

[PATCH 2/3] hw/char/pl011: Pad PL011State struct to same size as Rust impl

2025-03-20 Thread Peter Maydell
We have some users of the PL011 struct which embed it directly into their own state structs. This means that the Rust version of the device must have a state struct that is the same size or smaller than the C struct. In commit 9b642097d6b7 ("rust: pl011: switch to safe chardev operation") the Rust

Re: [PATCH v2] rust: assertions: add static_assert

2025-03-20 Thread Peter Maydell
On Thu, 20 Mar 2025 at 11:55, Paolo Bonzini wrote: > > Add a new assertion that is similar to "const { assert!(...) }" but can be > used > outside functions and with older versions of Rust. A similar macro is found > in > Linux, whereas the "static_assertions" crate has a const_assert macro tha

Re: [PATCH v3 3/3] target/riscv/kvm: add missing KVM CSRs

2025-03-20 Thread Andrea Bolognani
On Mon, Mar 03, 2025 at 01:46:53PM +1000, Alistair Francis wrote: > On Mon, Feb 24, 2025 at 10:32 PM Daniel Henrique Barboza > wrote: > > We're missing scounteren and senvcfg CSRs, both already present in the > > KVM UAPI. > > > > Signed-off-by: Daniel Henrique Barboza > > Reviewed-by: Andrew Jo

Re: [PATCH for-10.1 15/32] vfio: Introduce a new header file for helper services

2025-03-20 Thread John Levon
On Tue, Mar 18, 2025 at 10:53:58AM +0100, Cédric Le Goater wrote: > Gather all helper routine declarations into "helpers.h" to reduce > exposure of VFIO internals in "hw/vfio/vfio-common.h". > > Signed-off-by: Cédric Le Goater Reviewed-by: John Levon but > +struct vfio_info_cap_header * > +v

Re: [PATCH 09/10] include/exec: fix assert in size_memop

2025-03-20 Thread Akihiko Odaki
Updating the email address of Juan Quintela according to .mailmap. On 2025/03/20 3:22, Alex Bennée wrote: We can handle larger sized memops now, expand the range of the assert. Fixes: 4b473e0c60 (tcg: Expand MO_SIZE to 3 bits) Signed-off-by: Alex Bennée --- include/exec/memop.h | 4 ++-- 1

[PATCH] load_aout: replace bswap_needed with big_endian

2025-03-20 Thread Paolo Bonzini
Targets know whether they are big-endian more than they know if the endianness is different from the host: the former is mostly a constant, at least in machine creation code, while the latter has to be computed with TARGET_BIG_ENDIAN != HOST_BIG_ENDIAN or something like that. load_aout, however, t

Re: [PATCH for-10.1 09/32] vfio: Introduce a new header file for VFIOIOMMUFD declarations

2025-03-20 Thread Cédric Le Goater
On 3/20/25 10:18, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: [PATCH for-10.1 09/32] vfio: Introduce a new header file for VFIOIOMMUFD declarations Gather all VFIOIOMMUFD related declarations into "iommufd.h" to reduce exposure of VFIO internals in "hw/v

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

2025-03-20 Thread Greg Kurz
On Thu, 20 Mar 2025 13:16:20 +0100 Christian Schoenebeck wrote: > According to 'man 2 close' errors returned by close() should only be used > for either diagnostic purposes or for catching data loss due to a previous > write error, as an error result of close() usually indicates a deferred > erro

Re: [PATCH v3 3/3] target/riscv/kvm: add missing KVM CSRs

2025-03-20 Thread Daniel Henrique Barboza
On 3/20/25 11:25 AM, Andrea Bolognani wrote: On Mon, Mar 03, 2025 at 01:46:53PM +1000, Alistair Francis wrote: On Mon, Feb 24, 2025 at 10:32 PM Daniel Henrique Barboza wrote: We're missing scounteren and senvcfg CSRs, both already present in the KVM UAPI. Signed-off-by: Daniel Henrique Ba

Re: [PATCH 1/2] migration: Add some documentation for multifd

2025-03-20 Thread Fabiano Rosas
Prasad Pandit writes: > Hello Fabiano, > > * First big thank you for starting/writing this document. It is a > great resource. > > On Fri, 7 Mar 2025 at 19:13, Fabiano Rosas wrote: >> +++ b/docs/devel/migration/multifd.rst >> @@ -0,0 +1,254 @@ >> +Multifd >> +Multifd is the name given for the mi

Re: [PATCH] hvf: arm: Emulate ICC_RPR_EL1 accesses properly

2025-03-20 Thread Zenghui Yu
On 2025/3/19 00:56, Peter Maydell wrote: > On Sat, 15 Mar 2025 at 13:21, Zenghui Yu wrote: > > > > Commit a2260983c655 ("hvf: arm: Add support for GICv3") added GICv3 support > > by implementing emulation for a few system registers. ICC_RPR_EL1 was > > defined but not plugged in the sysreg handler

Re: VDPA MAC address problem

2025-03-20 Thread Konstantin Shkolnyy
On 3/19/2025 19:58, Jason Wang wrote: On Thu, Mar 20, 2025 at 12:34 AM Konstantin Shkolnyy wrote: Upon reading this forum, I see that VHOST_VDPA_SET_CONFIG is “deprecated”, and so VIRTIO_NET_CTRL_MAC_ADDR_SET must be the right method, but it’s apparently called too late. VHOST_VDPA_SET_CONFIG

Re: [PATCH-for-10.1 0/6] qom: Add object_class_implements_type()

2025-03-20 Thread Philippe Mathieu-Daudé
On 20/3/25 16:47, Philippe Mathieu-Daudé wrote: Hi, object_class_dynamic_cast() checks whether a class implements a type name, and return the class casted appropriately. This also works with interfaces, except when an interface is implemented multiple times (by intermediate abstract parents / in

QEMU Userspace NVMe driver and multiple iothreads

2025-03-20 Thread Farhan Ali
Hi, I have been experimenting with the QEMU Userspace NVMe driver on s390x architecture. I have noticed an issue when assigning multiple virtqueues and multiple iothreads to the block device. The driver works well with a single iothread, but when using more than one iothread we can hit a prob

Re: [PATCH] linux-user: fix resource leaks in gen-vdso

2025-03-20 Thread Daniel P . Berrangé
ping, any thoughts on this patch On Wed, Feb 19, 2025 at 10:03:36AM +, Daniel P. Berrangé wrote: > There are a number of resource leaks in gen-vdso. In theory they are > harmless because this is a short lived process, but when building QEMU > with --extra-cflags="-fsanitize=address" problems e

Re: [PATCH 1/3] rust: assertions: add static_assert

2025-03-20 Thread Zhao Liu
On Thu, Mar 20, 2025 at 01:32:46PM +, Peter Maydell wrote: > Date: Thu, 20 Mar 2025 13:32:46 + > From: Peter Maydell > Subject: [PATCH 1/3] rust: assertions: add static_assert > X-Mailer: git-send-email 2.43.0 > > From: Paolo Bonzini > > Add a new assertion that is similar to "const { a

Re: [PATCH] ppc/amigaone: Check blk_pwrite return value

2025-03-20 Thread Nicholas Piggin
On Mon Mar 17, 2025 at 11:13 PM AEST, BALATON Zoltan wrote: > On Mon, 17 Mar 2025, Cédric Le Goater wrote: >> On 3/14/25 21:01, BALATON Zoltan wrote: >>> Coverity reported that return value of blk_pwrite() maybe should not >>> be ignored. We can't do much if this happens other than report an >>> er

Re: [PATCH v3 0/7] Move memory listener register to vhost_vdpa_init

2025-03-20 Thread Lei Yang
Hi Dragos, Si-Wei 1. I applied [0] [1] [2] to the downstream kernel then tested hotplug/unplug, this bug still exists. [0] 35025963326e ("vdpa/mlx5: Fix suboptimal range on iotlb iteration") [1] 29ce8b8a4fa7 ("vdpa/mlx5: Fix PA offset with unaligned starting iotlb map") [2] a6097e0a54a5 ("vdpa/m

Re: [PATCH] target/ppc: Fix facility interrupt checks for VSX

2025-03-20 Thread Richard Henderson
On 3/20/25 04:59, Nicholas Piggin wrote: Facility interrupt checks in general should come after the ISA version check, because the facility interrupt and facility type themselves are ISA dependent and should not appear on CPUs where the instruction does not exist at all. This resolves a QEMU cra

Re: [PATCH 2/3] hw/char/pl011: Pad PL011State struct to same size as Rust impl

2025-03-20 Thread Zhao Liu
On Thu, Mar 20, 2025 at 01:32:47PM +, Peter Maydell wrote: > Date: Thu, 20 Mar 2025 13:32:47 + > From: Peter Maydell > Subject: [PATCH 2/3] hw/char/pl011: Pad PL011State struct to same size as > Rust impl > X-Mailer: git-send-email 2.43.0 > > We have some users of the PL011 struct which

[PATCH] rust: assertions: add const_assert

2025-03-20 Thread Paolo Bonzini
Add a new assertion that is similar to "const { assert!(...) }" but can be used outside functions and with older versions of Rust. Similar in concept (but not in code) to the homonymous macro of the "static_assertions" crate. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- rust/qe

Re: [PATCH] block: Fix bdrv_activate() not to fail without medium

2025-03-20 Thread Kevin Wolf
Am 13.03.2025 um 12:53 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 12.03.2025 um 15:37 hat Markus Armbruster geschrieben: > >> bdrv_activate() returns failure without setting an error when > >> !bs->drv. This is suspicious. Turns out it used to succeed then, > >> until comm

[PATCH-for-10.1 0/6] qom: Add object_class_implements_type()

2025-03-20 Thread Philippe Mathieu-Daudé
Hi, object_class_dynamic_cast() checks whether a class implements a type name, and return the class casted appropriately. This also works with interfaces, except when an interface is implemented multiple times (by intermediate abstract parents / interfaces). This series factors object_class_imple

[PATCH-for-10.1 1/6] qom: Factor object_class_dynamic_cast_ambiguous() out

2025-03-20 Thread Philippe Mathieu-Daudé
In order to allow matching ambiguous types in the next commit, factor object_class_dynamic_cast_ambiguous() out of object_class_dynamic_cast(). Signed-off-by: Philippe Mathieu-Daudé --- qom/object.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qom/object.c

[PATCH-for-10.1 2/6] qom: Add object_class_implements_type()

2025-03-20 Thread Philippe Mathieu-Daudé
Add the object_class_implements_type() method to check whether a class implement a type, which can be ambiguous for interfaces. Signed-off-by: Philippe Mathieu-Daudé --- include/qom/object.h | 10 ++ qom/object.c | 11 +++ 2 files changed, 21 insertions(+) diff --git a/i

[PATCH-for-10.1 4/6] qom: Prefer object_class_implements_type() to check type implementation

2025-03-20 Thread Philippe Mathieu-Daudé
When we only want to check a type is implemented and are not interested by the returned class, prefer object_class_implements_type() over object_class_dynamic_cast(). Signed-off-by: Philippe Mathieu-Daudé --- chardev/char.c | 2 +- hw/arm/xlnx-versal-virt.c | 2 +- hw/core/cpu-commo

[RFC PATCH-for-10.1 6/6] qom: Test object_class_get_list()

2025-03-20 Thread Philippe Mathieu-Daudé
RFC FIXME: this doesn't work well :/ In the first iteration the TYPE_TEST_IF is ambiguous (matched 2 times) so OBJECT_CLASS_CHECK() triggers the cast exception. Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/check-qom-interface.c | 16 1 file changed, 16 insertions(+) di

[PATCH-for-10.1 5/6] qom: Use object_class_implements_type() in object_class_foreach()

2025-03-20 Thread Philippe Mathieu-Daudé
Previously classes indirectly implementing an interface more than once were triggering the ambiguous cast assertion. Since we are not interested in the returned class, but only whether it implements or not, use object_class_implements_type(). Signed-off-by: Philippe Mathieu-Daudé --- qom/object.

Re: [PATCH v3 0/7] Move memory listener register to vhost_vdpa_init

2025-03-20 Thread Dragos Tatulea
Hi Lei, On 03/20, Lei Yang wrote: > Hi Dragos, Si-Wei > > 1. I applied [0] [1] [2] to the downstream kernel then tested > hotplug/unplug, this bug still exists. > > [0] 35025963326e ("vdpa/mlx5: Fix suboptimal range on iotlb iteration") > [1] 29ce8b8a4fa7 ("vdpa/mlx5: Fix PA offset with unalign

[PATCH-for-10.1 3/6] qom: Test object_class_implements_type()

2025-03-20 Thread Philippe Mathieu-Daudé
Test TYPE_INDIRECT_IMPL (indirectly) implements TYPE_TEST_IF (via TYPE_TEST_IF2A or TYPE_TEST_IF2B interface). Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/check-qom-interface.c | 40 1 file changed, 40 insertions(+) diff --git a/tests/unit/check-qom-int

Re: [PATCH 1/2] migration: Add some documentation for multifd

2025-03-20 Thread Peter Xu
On Thu, Mar 20, 2025 at 11:45:29AM -0300, Fabiano Rosas wrote: > There's a bunch of other issues as well: > > - no clear distinction between what should go in the header and what > should go in the packet. > > - the header taking up one slot in the iov, which should in theory be > responsibil

Re: [PATCH v3 3/3] target/riscv/kvm: add missing KVM CSRs

2025-03-20 Thread Andrew Jones
On Thu, Mar 20, 2025 at 07:25:07AM -0700, Andrea Bolognani wrote: > On Mon, Mar 03, 2025 at 01:46:53PM +1000, Alistair Francis wrote: > > On Mon, Feb 24, 2025 at 10:32 PM Daniel Henrique Barboza > > wrote: > > > We're missing scounteren and senvcfg CSRs, both already present in the > > > KVM UAPI

Re: [PATCH v2] rust: assertions: add static_assert

2025-03-20 Thread Pierrick Bouvier
On 3/20/25 12:19, Pierrick Bouvier wrote: On 3/20/25 04:55, Paolo Bonzini wrote: Add a new assertion that is similar to "const { assert!(...) }" but can be used outside functions and with older versions of Rust. A similar macro is found in Linux, whereas the "static_assertions" crate has a cons

Re: [PATCH for-10.1 13/32] vfio: Move VFIOAddressSpace helpers into container-base.c

2025-03-20 Thread Cédric Le Goater
+John On 3/20/25 10:36, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: [PATCH for-10.1 13/32] vfio: Move VFIOAddressSpace helpers into container-base.c VFIOAddressSpace is a common object used by VFIOContainerBase which is declared in "hw/vfio/vfio-contain

<    1   2