Re: [PATCH v2 07/29] vfio: add per-region fd support

2025-05-21 Thread Cédric Le Goater
On 5/20/25 17:03, John Levon wrote: For vfio-user, each region has its own fd rather than sharing vbasedev's. Add the necessary plumbing to support this. For vfio backends with a shared fd, initialize region->fd to the shared one. Signed-off-by: John Levon --- include/hw/vfio/vfio-device.h |

Re: [PATCH] vfio: add more VFIOIOMMUClass docs

2025-05-21 Thread Cédric Le Goater
On 5/20/25 18:25, John Levon wrote: Add some additional doc comments for these class methods. Signed-off-by: John Levon Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/vfio/vfio-container-base.h | 75 +-- 1 file changed, 72 insertions(+), 3 deletions(

[RFC PATCH 1/6] rust: add "bits", a custom bitflags implementation

2025-05-21 Thread Paolo Bonzini
One common thing that device emulation does is manipulate bitmasks, for example to check whether two bitmaps have common bits. One example in the pl011 crate is the checks for pending interrupts, where an interrupt cause corresponds to at least one interrupt source from a fixed set. Unfortunately

[RFC PATCH 6/6] rust: remove bilge crate

2025-05-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- rust/Cargo.lock | 71 ++--- rust/qemu-api/src/vmstate.rs| 34 ++ subprojects/.gitignore | 7 -- subprojects/arbitrary-int-1-rs.wrap | 10 --- subprojects/bilge-0.2-rs

[RFC PATCH 0/6] rust: make usage of bitmasks and bitfields nicer

2025-05-21 Thread Paolo Bonzini
This adds or modifies some of the early choices that were done when writing the pl011 crate. Now that the implementation is safe and readable, it's possible to look at the code as a whole, see what looks ugly and fix it. To see the effect on the pl011 code, jump at patches 2 and 4. But overall t

[RFC PATCH 2/6] rust: pl011: use the bits macro

2025-05-21 Thread Paolo Bonzini
This avoids the repeated ".0" when using the Interrupt struct. Signed-off-by: Paolo Bonzini --- rust/Cargo.lock | 1 + rust/hw/char/pl011/Cargo.toml | 1 + rust/hw/char/pl011/meson.build | 1 + rust/hw/char/pl011/src/device.rs| 51 ++-

[RFC PATCH 3/6] rust: qemu-api-macros: add from_bits and into_bits to #[derive(TryInto)]

2025-05-21 Thread Paolo Bonzini
These const functions make it possible to use enums easily together with the bitfield-struct crate. Signed-off-by: Paolo Bonzini --- rust/qemu-api-macros/src/lib.rs | 48 ++--- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/rust/qemu-api-macros/src/li

Re: [PATCH v2 08/29] vfio: mark posted writes in region write callbacks

2025-05-21 Thread Cédric Le Goater
On 5/20/25 17:03, John Levon wrote: For vfio-user, the region write implementation needs to know if the write is posted; add the necessary plumbing to support this. Signed-off-by: John Levon Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/vfio/vfio-device.h | 4 ++-- include

Re: [PATCH V3 34/42] vfio/iommufd: invariant device name

2025-05-21 Thread Cédric Le Goater
On 5/20/25 23:00, Steven Sistare wrote: On 5/20/2025 9:55 AM, Cédric Le Goater wrote: On 5/12/25 17:32, Steve Sistare wrote: cpr-transfer will use the device name as a key to find the value of the device descriptor in new QEMU.  However, if the descriptor number is specified by a command-line f

Re: Rust in QEMU update, April 2025

2025-05-21 Thread Zhao Liu
On Tue, May 20, 2025 at 07:48:11PM +0200, Paolo Bonzini wrote: > Date: Tue, 20 May 2025 19:48:11 +0200 > From: Paolo Bonzini > Subject: Re: Rust in QEMU update, April 2025 > > On 5/20/25 18:23, Zhao Liu wrote: > > > HPET does some very simple memory accesses; a good safe solution > > > for this m

[RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Paolo Bonzini
The bilge crate, while very nice and espressive, is heavily reliant on traits; because trait functions are never const, bilge and const mix about as well as water and oil. Try using the bitfield-struct crate instead. It is built to support const very well and the only downside is that more manual

Re: [PATCH V3 33/42] vfio/iommufd: define hwpt constructors

2025-05-21 Thread Cédric Le Goater
On 5/21/25 04:48, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH V3 33/42] vfio/iommufd: define hwpt constructors On 5/16/25 10:55, Duan, Zhenzhong wrote: -Original Message- From: Steve Sistare Subject: [PATCH V3 33/42] vfio/iommufd:

[RFC PATCH 4/6] rust: subprojects: add bitfield-struct

2025-05-21 Thread Paolo Bonzini
The bitfield-struct is much smaller than "bilge" and supports "const" expressions better. The main disadvantage is that it does not let you annotate enums as bitfields and does not integrate with arbitrary-int, thus requiring manual size annotations for anything that is not a bool, iNN or uNN. La

Re: [PATCH v2 07/29] vfio: add per-region fd support

2025-05-21 Thread John Levon
On Wed, May 21, 2025 at 10:11:06AM +0200, Cédric Le Goater wrote: > > - * Fill in @info with information on the region given by @info->index. > > + * Fill in @info (and optionally @fd) with information on the region > > given > > + * by @info->index. > > The whole VFIODeviceIOOps str

Re: [PATCH 2/4] qapi/migration: Deprecate migrate argument @detach

2025-05-21 Thread Peter Krempa
On Wed, May 21, 2025 at 09:46:10 +0200, Peter Krempa via Devel wrote: > On Wed, May 21, 2025 at 08:37:09 +0200, Markus Armbruster via Devel wrote: > > Argument @detach has always been ignored. Start the clock to get rid > > of it. > > > > Cc: Peter Xu > > Cc: Fabiano Rosas > > Signed-off-by: Ma

Re: [PATCH v2 10/29] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread John Levon
On Wed, May 21, 2025 at 09:43:11AM +0200, Cédric Le Goater wrote: > !---| > CAUTION: External Email > > |---! > > +Steven, > > On 5/20/25 17:03, John Levon wrote: > >

Re: [PATCH 23/33] include/exec: Allow using 64bit guest addresses on emscripten

2025-05-21 Thread Kohei Tokunaga
Hi Paolo, > On 5/20/25 14:51, Kohei Tokunaga wrote: > > target_kconfig = [] > > foreach sym: accelerators > > -# Disallow 64-bit on 32-bit emulation and virtualization > > -if host_long_bits < config_target['TARGET_LONG_BITS'].to_int() > > - continue > > +if host_arch != '

Re: [RFC PATCH 1/6] rust: add "bits", a custom bitflags implementation

2025-05-21 Thread Daniel P . Berrangé
On Wed, May 21, 2025 at 10:18:40AM +0200, Paolo Bonzini wrote: > One common thing that device emulation does is manipulate bitmasks, for > example > to check whether two bitmaps have common bits. One example in the pl011 crate > is the checks for pending interrupts, where an interrupt cause corre

[PATCH 0/1] Add RISCV ZALASR Extension

2025-05-21 Thread Roan Richmond
Ping, resending as no comments in over 2 weeks. Roan Richmond (1): Add RISCV ZALASR extension target/riscv/cpu.c | 1 + target/riscv/cpu_cfg.h | 1 + target/riscv/insn32.decode | 10 ++ target/riscv/insn_trans/trans_rvzalas

[PATCH 1/1] Add RISCV ZALASR extension

2025-05-21 Thread Roan Richmond
Signed-off-by: Roan Richmond --- target/riscv/cpu.c | 1 + target/riscv/cpu_cfg.h | 1 + target/riscv/insn32.decode | 10 ++ target/riscv/insn_trans/trans_rvzalasr.c.inc | 109 +++ target/riscv/translate.c

Re: [PATCH 2/4] qapi/migration: Deprecate migrate argument @detach

2025-05-21 Thread Markus Armbruster
Peter Krempa writes: > On Wed, May 21, 2025 at 09:46:10 +0200, Peter Krempa via Devel wrote: >> On Wed, May 21, 2025 at 08:37:09 +0200, Markus Armbruster via Devel wrote: >> > Argument @detach has always been ignored. Start the clock to get rid >> > of it. >> > >> > Cc: Peter Xu >> > Cc: Fabia

Re: [PATCH v2 05/29] vfio: export PCI helpers needed for vfio-user

2025-05-21 Thread Cédric Le Goater
On 5/21/25 10:40, John Levon wrote: On Wed, May 21, 2025 at 09:39:42AM +0200, Cédric Le Goater wrote: These routines : Object *vfio_pci_get_object(VFIODevice *vbasedev); void vfio_pci_intx_eoi(VFIODevice *vbasedev); int vfio_pci_load_config(VFIODevice *vbasedev, QEMUFile *f); int v

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 11:19 AM Paolo Bonzini wrote: > > The bilge crate, while very nice and espressive, is heavily reliant on > traits; because trait functions are never const, bilge and const mix > about as well as water and oil. > > Try using the bitfield-struct crate instead. It is built to

[PATCH v5 10/9] scripts/checkpatch.pl: mandate SPDX tag for Rust src files

2025-05-21 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 17b8db40ad..c0b36a85cd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1499,7 +1499,7 @@ sub proce

Re: [RFC PATCH 1/6] rust: add "bits", a custom bitflags implementation

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 11:29 AM Daniel P. Berrangé wrote: > > On Wed, May 21, 2025 at 10:18:40AM +0200, Paolo Bonzini wrote: > > One common thing that device emulation does is manipulate bitmasks, for > > example > > to check whether two bitmaps have common bits. One example in the pl011 > > c

Re: Rust in QEMU update, April 2025

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 11:36 AM Paolo Bonzini wrote: > > > > Il mer 21 mag 2025, 10:21 Zhao Liu ha scritto: >> >> I also realize that once FlatRange/FlatView is associated with >> GuestMemoryRegion/ >> GuestMemory, it changes the usual practice in QEMU, where most memory >> operations >> are b

Re: [PATCH v2 01/24] block: remove outdated comments about AioContext locking

2025-05-21 Thread Kevin Wolf
Am 20.05.2025 um 12:29 hat Fiona Ebner geschrieben: > AioContext locking was removed in commit b49f4755c7 ("block: remove > AioContext locking"). > > Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf

[PATCH v3 4/8] Add memory virtual address write API

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 21 + plugins/api.c | 18 ++ 2 files changed, 39 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 1380

[PATCH v3 0/8] Add additional plugin API functions to read and write memory and registers

2025-05-21 Thread Rowan Hart
This patch series adds several new API functions focused on enabling use cases around reading and writing guest memory from QEMU plugins. To support these new APIs, some utility functionality around retrieving information about address spaces is added as well. The new qemu_plugin_write_register ut

[PATCH v3 5/8] Add memory hardware address read/write API

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 96 +++ plugins/api.c | 100 + 2 files changed, 196 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/i

[PATCH v3 8/8] Update plugin version and add notes

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index d4f229abd9..4cf2955560 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/q

[PATCH v3 6/8] Add patcher plugin and test

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- tests/tcg/Makefile.target | 1 + tests/tcg/plugins/meson.build | 2 +- tests/tcg/plugins/patch.c | 324 ++ tests/tcg/x86_64/Makefile.softmmu-target | 3

[PATCH v3 3/8] Add address space API

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/plugin.h | 6 +++ include/qemu/qemu-plugin.h | 45 ++ plugins/api.c | 79 ++ 3 files changed, 130 insertions(+) diff --git a/include

[PATCH v3 7/8] Add hypercalls plugin and test

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- tests/tcg/Makefile.target | 1 + tests/tcg/plugins/hypercalls.c| 552 ++ tests/tcg/plugins/meson.build | 2 +- tests/tcg/x86_64/Makefile.softmmu-targ

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Alex Bennée
Paolo Bonzini writes: > The bilge crate, while very nice and espressive, is heavily reliant on > traits; because trait functions are never const, bilge and const mix > about as well as water and oil. > > Try using the bitfield-struct crate instead. It is built to support > const very well and th

Re: [PATCH v2 02/24] block: move drain outside of read-locked bdrv_reopen_queue_child()

2025-05-21 Thread Kevin Wolf
Am 20.05.2025 um 12:29 hat Fiona Ebner geschrieben: > This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. > > More granular draining is not trivially possible, because > bdrv_reopen_queue_child() can recursively call itself. > > Signed-off-by: Fiona Ebner Reviewed-by: Kevin W

[PATCH v3 1/8] Expose gdb_write_register function to consumers of gdbstub

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 14 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 565f6b33a9..5846e481be 100644 --- a/gd

[PATCH v3 2/8] Add register write API

2025-05-21 Thread Rowan Hart
From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 57 +- plugins/api.c | 26 - 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/incl

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 12:21 PM Manos Pitsidianakis wrote: > > On Wed, May 21, 2025 at 11:19 AM Paolo Bonzini wrote: > > > > The bilge crate, while very nice and espressive, is heavily reliant on > > traits; because trait functions are never const, bilge and const mix > > about as well as water

Re: [PATCH v2 03/24] block/snapshot: move drain outside of read-locked bdrv_snapshot_delete()

2025-05-21 Thread Kevin Wolf
Am 20.05.2025 um 12:29 hat Fiona Ebner geschrieben: > This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. > > More granular draining is not trivially possible, because > bdrv_snapshot_delete() can recursively call itself. > > The return value of bdrv_all_delete_snapshot() chang

Re: [PULL 13/14] tests: Add iotest mirror-sparse for recent patches

2025-05-21 Thread Fiona Ebner
Hi, Am 15.05.25 um 04:28 schrieb Eric Blake: > +do_test full ignore off full for me, this one fails irregularly (more than 50% of the time) with: -Destination is full; expected full +Destination is unknown; expected full My file system is ext4 inside a virtual machine. > [I] febner@dev8 ~/repos/

Re: [PATCH v2 04/24] block: move drain outside of read-locked bdrv_inactivate_recurse()

2025-05-21 Thread Kevin Wolf
Am 20.05.2025 um 12:29 hat Fiona Ebner geschrieben: > This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. > > More granular draining is not trivially possible, because > bdrv_inactivate_recurse() can recursively call itself. > > Signed-off-by: Fiona Ebner Reviewed-by: Kevin W

Re: [PATCH v2 05/24] block: mark bdrv_parent_change_aio_context() GRAPH_RDLOCK

2025-05-21 Thread Kevin Wolf
Am 20.05.2025 um 12:29 hat Fiona Ebner geschrieben: > This is a small step in preparation to mark bdrv_drained_begin() as > GRAPH_UNLOCKED. More concretely, it allows marking the > change_aio_ctx() callback GRAPH_RDLOCK_PTR, which is the next step. > > Signed-off-by: Fiona Ebner Reviewed-by: Kev

Re: [RFC PATCH] util: split unix socket functions out of qemu-sockets

2025-05-21 Thread Daniel P . Berrangé
On Tue, May 20, 2025 at 05:57:06PM +0100, Alex Bennée wrote: > Since fccb744f41 (gdbstub: Try unlinking the unix socket before > binding) we use the unix_listen() function from linux-user which > causes complications when trying to build statically. > > Fix this by splitting the unix functions int

Re: [PATCH v2 06/29] vfio: enable per-IRQ MSI-X masking

2025-05-21 Thread Cédric Le Goater
+Sẗeven On 5/20/25 17:03, John Levon wrote: If VFIO_IRQ_INFO_MASKABLE is set for VFIO_PCI_MSIX_IRQ_INDEX, record this in ->can_mask_msix, and use it to individually mask MSI-X interrupts as needed. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Si

Re: [PATCH v13 5/5] qtest/cxl: Add aarch64 virt test for CXL

2025-05-21 Thread Itaru Kitayama
> On May 19, 2025, at 21:54, Jonathan Cameron > wrote: > > On Thu, 15 May 2025 18:04:18 +0900 > Itaru Kitayama wrote: > >>> On May 13, 2025, at 20:14, Jonathan Cameron >>> wrote: >>> >>> Add a single complex case for aarch64 virt machine. >>> Given existing much more comprehensive tests

Re: [PATCH v2 05/29] vfio: export PCI helpers needed for vfio-user

2025-05-21 Thread Cédric Le Goater
On 5/20/25 17:03, John Levon wrote: The vfio-user code will need to re-use various parts of the vfio PCI code. Export them in hw/vfio/pci.h, and rename them to the vfio_pci_* namespace. Signed-off-by: John Levon --- hw/vfio/pci.h| 14 hw/vfio/pci.c| 54 ++

Re: [PATCH v2 10/29] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread Cédric Le Goater
+Steven, On 5/20/25 17:03, John Levon wrote: Pass through the MemoryRegion to DMA operation handlers of vfio containers. The vfio-user container will need this later, to translate the vaddr into an offset for the dma map vfio-user message. Originally-by: John Johnson Signed-off-by: Jagannathan

Re: [PATCH 2/4] qapi/migration: Deprecate migrate argument @detach

2025-05-21 Thread Peter Krempa
On Wed, May 21, 2025 at 08:37:09 +0200, Markus Armbruster via Devel wrote: > Argument @detach has always been ignored. Start the clock to get rid > of it. > > Cc: Peter Xu > Cc: Fabiano Rosas > Signed-off-by: Markus Armbruster > --- > docs/about/deprecated.rst | 5 + > qapi/migration.jso

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

2025-05-21 Thread Ani Sinha
> On 8 Apr 2025, at 1:41 PM, Gerd Hoffman wrote: > > Hi, > >> Which means we are back to the single firmware image. I think it makes >> sense to continue supporting classic rom images (which can also be >> loaded via -bios). Any use case which needs more fine-grained control >> must use ig

Re: [PATCH 0/4] i386/cpu: Fix topological field encoding & overflow

2025-05-21 Thread Zhao Liu
Hi Paolo, A gentle poke. There's no conflict for now. Do you agree with these fixes? Thanks, Zhao On Thu, Feb 27, 2025 at 02:25:19PM +0800, Zhao Liu wrote: > Date: Thu, 27 Feb 2025 14:25:19 +0800 > From: Zhao Liu > Subject: [PATCH 0/4] i386/cpu: Fix topological field encoding & overflow > X-Mai

Re: Rust in QEMU update, April 2025

2025-05-21 Thread Paolo Bonzini
Il mer 21 mag 2025, 10:21 Zhao Liu ha scritto: > I also realize that once FlatRange/FlatView is associated with > GuestMemoryRegion/ > GuestMemory, it changes the usual practice in QEMU, where most memory > operations > are built around MemoryRegion/AddressSpace. > That shouldn't be a problem. I

Re: [PATCH v2 05/29] vfio: export PCI helpers needed for vfio-user

2025-05-21 Thread John Levon
On Wed, May 21, 2025 at 09:39:42AM +0200, Cédric Le Goater wrote: > These routines : > > Object *vfio_pci_get_object(VFIODevice *vbasedev); > void vfio_pci_intx_eoi(VFIODevice *vbasedev); > int vfio_pci_load_config(VFIODevice *vbasedev, QEMUFile *f); > int vfio_pci_save_config(VFIODevice

Re: [PATCH v2 2/2] migration/hmp: Add "info migrate -a", reorg the dump

2025-05-21 Thread Zhijian Li (Fujitsu)
On 15/05/2025 04:01, Peter Xu wrote: > A new parameter "-a" is added to "info migrate" to dump all info, while > when not specified it only dumps the important ones. When at it, reorg > everything to make it easier to read for human. > > The general rule is: > >- Put important things at th

Re: [PATCH v6 0/2] tests/functional: add memlock tests

2025-05-21 Thread Alexandr Moshkov
On 4/17/25 16:40, Alexandr Moshkov wrote: Add new tests to check the correctness of the `-overcommit memlock` option (possible values: off, on, on-fault) by using `/proc/{qemu_pid}/smaps` file to check in Size, Rss and Locked fields of anonymous segments: * if `memlock=off`, then Locked = 0 on

Re: [PATCH 3/4] block/copy-before-write: reverse access bitmap

2025-05-21 Thread Andrey Zhadchenko
On 5/20/25 19:26, Eric Blake wrote: [?? ??? ? ?? ?? ebl...@redhat.com. ???, ?? ??? ?, ?? ?? https://aka.ms/LearnAboutSenderIdentification ] On Tue, May 13, 2025 at 03:32:37AM +0200, Andrey Zhadchenko wrote: HBitmaps allow us to search set bits pretty fast. On

Re: [PATCH 2/4] hbitmap: introduce hbitmap_reverse()

2025-05-21 Thread Andrey Zhadchenko
On 5/20/25 18:29, Eric Blake wrote: [?? ??? ? ?? ?? ebl...@redhat.com. ???, ?? ??? ?, ?? ?? https://aka.ms/LearnAboutSenderIdentification ] On Tue, May 13, 2025 at 03:32:36AM +0200, Andrey Zhadchenko wrote: and bdrv_dirty_bitmap_reverse() helper Is 'inverse

Re: [PATCH v6 1/2] tests/functional: add skipLockedMemoryTest decorator

2025-05-21 Thread Thomas Huth
On 17/04/2025 13.40, Alexandr Moshkov wrote: Used in future commit to skipping execution of a tests if the system's locked memory limit is below the required threshold. Signed-off-by: Alexandr Moshkov --- tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/decorators

Re: [PATCH] vfio/igd: OpRegion not found fix error typo

2025-05-21 Thread Cédric Le Goater
On 5/19/25 13:24, edmund.raile wrote: Signed-off-by: Edmund Raile --- hw/vfio/igd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c index e54a2a2f00..36ceb85212 100644 --- a/hw/vfio/igd.c +++ b/hw/vfio/igd.c @@ -203,7 +203,7 @@ static bool vfi

Re: [PATCH] vfio: add more VFIOIOMMUClass docs

2025-05-21 Thread Cédric Le Goater
On 5/20/25 18:25, John Levon wrote: Add some additional doc comments for these class methods. Signed-off-by: John Levon --- include/hw/vfio/vfio-container-base.h | 75 +-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/include/hw/vfio/vfio-container-ba

Re: Rust in QEMU update, April 2025

2025-05-21 Thread Paolo Bonzini
Il mer 21 mag 2025, 11:35 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > vm-memory is a very rigid API unfortunately. It's excellent for > rust-vmm purposes. I presume it's possible to figure out a clever > solution to satisfy both rust-vmm and QEMU use needs but I'm not sure

[PATCH] vfio/iommufd: Add comment emphasizing no movement of hiod->realize() call

2025-05-21 Thread Zhenzhong Duan
The nested IOMMU support needs device and hwpt id which are generated only after attachment. Hiod encapsulates these information in realize() and passes to vIOMMU. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/iommufd.c | 4 1 file changed, 4 insertions(+) diff

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 12:50 PM Alex Bennée wrote: > > Paolo Bonzini writes: > > > The bilge crate, while very nice and espressive, is heavily reliant on > > traits; because trait functions are never const, bilge and const mix > > about as well as water and oil. > > > > Try using the bitfield-st

Re: [PATCH v2 02/12] qapi: expand docs for SEV commands

2025-05-21 Thread Pierrick Bouvier
On 5/18/25 10:57 PM, Markus Armbruster wrote: Pierrick Bouvier writes: From: Daniel P. Berrangé This gives some more context about the behaviour of the commands in unsupported guest configuration or platform scenarios. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signe

Re: [PATCH V3 32/42] vfio/iommufd: export iommufd_cdev_get_info_iova_range

2025-05-21 Thread Steven Sistare
I withdraw this patch. It is not needed if I save ioas_id in cpr-state. - Steve On 5/12/2025 11:32 AM, Steve Sistare wrote: Export iommufd_cdev_get_info_iova_range, for use by CPR in a subsequent patch to reconstruct the userland device state. No functional change. Signed-off-by: Steve Sista

Re: [PATCH v2 08/12] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic

2025-05-21 Thread Pierrick Bouvier
On 5/18/25 11:18 PM, Markus Armbruster wrote: Pierrick Bouvier writes: From: Philippe Mathieu-Daudé We'd like to have some unified QAPI schema. Having a structure field conditional to a target being built in is not very practical. While @deprecated-props is only used by s390x target, it is

Re: [PATCH] vfio/igd: Fix incorrect error propagation in vfio_pci_igd_opregion_detect()

2025-05-21 Thread Alex Williamson
On Wed, 21 May 2025 23:40:36 +0800 Tomita Moeko wrote: > In vfio_pci_igd_opregion_detect(), errp will be set when device does > not have OpRegion or is hotplugged. This errp will be propergated to propagated > pci_qdev_realize(), which interprets it as failure, causing unexpected > termination

Re: [PATCH v2 09/12] qapi: make most CPU commands unconditionally available

2025-05-21 Thread Pierrick Bouvier
On 5/18/25 11:29 PM, Markus Armbruster wrote: Pierrick Bouvier writes: From: Daniel P. Berrangé This removes the TARGET_* conditions from all the CPU commands that are conceptually target independent. Top level stubs are provided to cope with targets which do not currently implement all of t

[PATCH v3 01/14] qapi: expose rtc-reset-reinjection command unconditionally

2025-05-21 Thread Pierrick Bouvier
From: Daniel P. Berrangé This removes the TARGET_I386 condition from the rtc-reset-reinjection command. This requires providing a QMP command stub for non-i386 target. This in turn requires moving the command out of misc-target.json, since that will trigger symbol poisoning errors when built from

Re: [PATCH RFC V5 00/30] Support of Virtual CPU Hotplug for ARMv8 Arch

2025-05-21 Thread Gavin Shan
Hi Gustavo and Salil, On 5/22/25 1:06 AM, Gustavo Romero wrote: Hi Salil, Gavin, and folks, On 5/20/25 21:22, Gavin Shan wrote: Hi Salil, A kindly ping. vCPU hotplug is an important feature and You has put so much energies and amazing efforts to enable the feature from QEMU side, but it seems

Re: [PATCH v3 1/1] hw/riscv: fix PLIC hart topology configuration string when not getting CPUState correctly

2025-05-21 Thread Alistair Francis
On Wed, Apr 16, 2025 at 3:20 PM Chao Liu wrote: > > riscv_plic_hart_config_string() when getting CPUState via qemu_get_cpu() > should be consistent with keeping sifive_plic_realize() > by hartid_base + cpu_index. > > A better approach is to use cpu_by_arch_id() instead of qemu_get_cpu(), > in risc

RE: [PATCH v1 3/3] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts

2025-05-21 Thread Jamin Lin
Hi Cédric > Subject: Re: [PATCH v1 3/3] hw/arm/aspeed_ast27x0: Fix RAM size detection > failure on BE hosts > > On 5/20/25 09:35, Jamin Lin wrote: > > On big-endian hosts, the aspeed_ram_capacity_write() function > > previously passed the address of a 64-bit "data" variable directly to > > addres

Re: [PATCH] virtio-net: Add queues for RSS during migration

2025-05-21 Thread Jason Wang
On Wed, May 21, 2025 at 11:51 AM Akihiko Odaki wrote: > > On 2025/05/21 9:51, Jason Wang wrote: > > On Fri, May 16, 2025 at 11:29 AM Akihiko Odaki > > wrote: > >> > >> On 2025/05/16 10:44, Jason Wang wrote: > >>> On Wed, May 14, 2025 at 2:58 PM Akihiko Odaki > >>> wrote: > > On 2025/

Re: [PATCH v11 8/8] hw/riscv/virt: Add IOPMP support

2025-05-21 Thread Alistair Francis
On Wed, Mar 12, 2025 at 7:43 PM Ethan Chen via wrote: > > - Add 'iopmp=on' option to enable IOPMP. It adds iopmp devices virt machine > to protect all regions of system memory. > > Signed-off-by: Ethan Chen > --- > docs/specs/index.rst | 1 + > docs/specs/riscv-iopmp.rst | 60 ++

Re: [PATCH v3 1/1] hw/riscv: fix PLIC hart topology configuration string when not getting CPUState correctly

2025-05-21 Thread Alistair Francis
On Wed, Apr 16, 2025 at 3:20 PM Chao Liu wrote: > > riscv_plic_hart_config_string() when getting CPUState via qemu_get_cpu() > should be consistent with keeping sifive_plic_realize() > by hartid_base + cpu_index. > > A better approach is to use cpu_by_arch_id() instead of qemu_get_cpu(), > in risc

[PATCH v4 1/1] hw/riscv: fix PLIC hart topology configuration string when not getting CPUState correctly

2025-05-21 Thread Chao Liu
riscv_plic_hart_config_string() when getting CPUState via qemu_get_cpu() should be consistent with keeping sifive_plic_realize() by hartid_base + cpu_index. A better approach is to use cpu_by_arch_id() instead of qemu_get_cpu(), in riscv cpu_by_arch_id() uses the mhartid. For non-numa or single-c

[PATCH v4 0/1] fix the way riscv_plic_hart_config_string() gets the CPUState

2025-05-21 Thread Chao Liu
From: "Chao Liu" Hi, all: Thanks to Alistair for the review~ PATCH v4: Rebasing this on https://github.com/alistair23/qemu/tree/riscv-to-apply.next PATCH v3: Use cpu_by_arch_id() instead of qemu_get_cpu(), when registering gpio in sifive_plic_create(). PATCH v2: During plic initialization,

[PATCH v2 0/3] Fix RAM size detection failure on BE hosts

2025-05-21 Thread Jamin Lin via
v1: 1. Fix RAM size detection failure on BE hosts 2. INTC: Set impl.min_access_size to 4 Fix coding style v2: Fix review issue. Jamin Lin (3): hw/intc/aspeed: Set impl.min_access_size to 4 hw/intc/aspeed Fix coding style hw/arm/aspeed_ast27x0: Fix RAM size detection failure on

[PATCH v2 2/3] hw/intc/aspeed Fix coding style

2025-05-21 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/intc/aspeed_intc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c index 19f88853d8..5cd786dee6 100644 --- a/hw/intc/

[PATCH v2 3/3] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts

2025-05-21 Thread Jamin Lin via
On big-endian hosts, the aspeed_ram_capacity_write() function previously passed the address of a 64-bit "data" variable directly to address_space_write(), assuming host and guest endianness matched. However, the data is expected to be written in little-endian format to DRAM. On big-endian hosts, t

[PATCH v2 1/3] hw/intc/aspeed: Set impl.min_access_size to 4

2025-05-21 Thread Jamin Lin via
This patch explicitly sets ".impl.min_access_size = 4" to match the declared ".valid.min_access_size = 4", enforcing stricter access size checking and preventing inconsistent partial accesses to the interrupt controller registers. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/in

[PATCH v2 6/7] meson: remove lib{system, user}_ss aliases

2025-05-21 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- meson.build | 2 -- accel/tcg/meson.build | 8 gdbstub/meson.build | 4 ++-- hw/core/meson.build | 4 ++-- plugins/meson.build | 4 ++-- system/meson.build| 2 +- tcg/meson.build | 4 ++-- 7 files changed, 13 insertions(+), 15

Re: [PATCH v2 1/2] target/riscv: Extend PMP region up to 64

2025-05-21 Thread Alistair Francis
On Fri, Apr 25, 2025 at 7:45 PM Jay Chang wrote: > > According to the RISC-V Privileged Specification (version >1.12), > RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions > (pmpaddr0–pmpaddr63). > > Reviewed-by: Frank Chang > Signed-off-by: Jay Chang Reviewed-by: Alistair Fra

Re: [PATCH v2 2/2] target/riscv: Make PMP region count configurable

2025-05-21 Thread Alistair Francis
On Fri, Apr 25, 2025 at 7:46 PM Jay Chang wrote: > > Previously, the number of PMP regions was hardcoded to 16 in QEMU. > This patch replaces the fixed value with a new `pmp_regions` field, > allowing platforms to configure the number of PMP regions. > > If no specific value is provided, the defau

Re: [PATCH v11 5/8] hw/misc/riscv_iopmp_txn_info: Add struct for transaction infomation

2025-05-21 Thread Alistair Francis
On Wed, Mar 12, 2025 at 7:43 PM Ethan Chen via wrote: > > The entire valid transaction must fit within a single IOPMP entry. > However, during IOMMU translation, the transaction size is not > available. This structure defines the transaction information required > by the IOPMP. > > Signed-off-by:

Re: [PATCH v11 6/8] hw/misc/riscv_iopmp: Add RISC-V IOPMP device

2025-05-21 Thread Alistair Francis
On Wed, Mar 12, 2025 at 7:41 PM Ethan Chen via wrote: > > Support IOPMP specification v0.7. > The specification url: > https://github.com/riscv-non-isa/iopmp-spec/releases/tag/v0.7 v10 of the series supported v0.9.2RC3 [1], why is this now 0.7? We should be targeting the latest version of a draf

Re: [PATCH V3 37/42] vfio/iommufd: reconstruct device

2025-05-21 Thread Steven Sistare
I withdraw this patch. Most of it is not needed if I save ioas_id in cpr-state. I will move a tiny bit that remains to another patch. - Steve On 5/12/2025 11:32 AM, Steve Sistare wrote: Reconstruct userland device state after CPR. During vfio_realize, skip all ioctls that configure the devic

Re: [PATCH V3 38/42] vfio/iommufd: reconstruct hw_caps

2025-05-21 Thread Steven Sistare
I withdraw this patch. I will instead save devid in cpr-state. - Steve On 5/12/2025 11:32 AM, Steve Sistare wrote: hw_caps is normally derived during realize, at vfio_device_hiod_create_and_realize -> hiod_iommufd_vfio_realize -> iommufd_backend_get_device_info. However, this depends on the d

Re: [PATCH 14/22] hw/i386/acpi-build: Move aml_pci_edsm to a generic place

2025-05-21 Thread Gustavo Romero
Hi Eric, On 5/21/25 13:24, Gustavo Romero wrote: Hi Eric, On 5/21/25 12:56, Eric Auger wrote: Hi Gustavo, On 5/21/25 5:26 PM, Gustavo Romero wrote: Hi Eric, On 5/14/25 14:01, Eric Auger wrote: Move aml_pci_edsm to pcihp since we want to reuse that for ARM and acpi-index support. Signed-of

Re: [PATCH] file-posix: Probe paths and retry SG_IO on potential path errors

2025-05-21 Thread Benjamin Marzinski
On Wed, May 21, 2025 at 07:46:30PM +0200, Kevin Wolf wrote: > Am 20.05.2025 um 16:03 hat Stefan Hajnoczi geschrieben: > > On Thu, May 15, 2025 at 05:02:46PM +0200, Kevin Wolf wrote: > > > Am 15.05.2025 um 16:01 hat Stefan Hajnoczi geschrieben: > > > > On Thu, May 15, 2025 at 10:15:53AM +0200, Kevin

Re: [PATCH v5 23/25] tests: add plugin asserting correctness of discon event's to_pc

2025-05-21 Thread Pierrick Bouvier
On 5/20/25 2:09 PM, Pierrick Bouvier wrote: On 5/20/25 1:44 PM, Julian Ganz wrote: Hi Pierrick, May 20, 2025 at 10:01 PM, Pierrick Bouvier wrote: Regarding the issue with the same tb being mapped at different virtual addresses, I'm ok with the current solution of comparing only page bits. Th

[PATCH] target/arm: Ignore SCTLR_EL2.EnSCXT when !ELIsInHost()

2025-05-21 Thread Oliver Upton
Using an EL2 that enables SCXTNUM_ELx for guests while disabling the feature for the host generates erroneous traps to EL2 when running under TCG. Fix the issue by only evaluating SCTLR_EL2.EnSCXT when ELIsInHost(). Signed-off-by: Oliver Upton --- target/arm/helper.c | 16 1 fi

Re: [PATCH v3 4/8] Add memory virtual address write API

2025-05-21 Thread Pierrick Bouvier
On 5/21/25 2:43 AM, Rowan Hart wrote: From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 21 + plugins/api.c | 18 ++ 2 files changed, 39 insertions(+) Reviewed-by: Pierrick Bouvier

[PATCH v3 02/14] qapi: expand docs for SEV commands

2025-05-21 Thread Pierrick Bouvier
From: Daniel P. Berrangé This gives some more context about the behaviour of the commands in unsupported guest configuration or platform scenarios. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-target.json | 43

[PATCH v3 03/14] qapi: make SEV commands unconditionally available

2025-05-21 Thread Pierrick Bouvier
From: Daniel P. Berrangé This removes the TARGET_I386 condition from the SEV confidential virtualization commands, moving them to the recently introduced misc-i386.json QAPI file, given they are inherantly i386 specific commands. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé

Re: [PATCH v3 2/8] Add register write API

2025-05-21 Thread Pierrick Bouvier
On 5/21/25 2:43 AM, Rowan Hart wrote: From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 57 +- plugins/api.c | 26 - 2 files changed, 56 insertions(+), 27 deletions(-) Re

Re: [PATCH 0/6] single-binary: build target common libraries with dependencies

2025-05-21 Thread Pierrick Bouvier
On 5/15/25 10:27 PM, Pierrick Bouvier wrote: Recently, common libraries per target base architecture were introduced in order to compile those files only once. However, it was missing common dependencies (which include external libraries), so it failed to build on some hosts. This series fixes t

Re: [PATCH v3 5/8] Add memory hardware address read/write API

2025-05-21 Thread Pierrick Bouvier
On 5/21/25 2:43 AM, Rowan Hart wrote: From: novafacing Signed-off-by: novafacing Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 96 +++ plugins/api.c | 100 + 2 files changed, 196 insertions(+)

[PATCH v5 5/6] util/qemu-sockets: Refactor inet_parse() to use QemuOpts

2025-05-21 Thread Juraj Marcin
From: Juraj Marcin Currently, the inet address parser cannot handle multiple options where one is prefixed with the name of the other. For example, with the 'keep-alive-idle' option added, the current parser cannot parse '127.0.0.1:5000,keep-alive-idle=60,keep-alive' correctly. Instead, it fails

[PATCH v5 6/6] util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive

2025-05-21 Thread Juraj Marcin
From: Juraj Marcin With the default TCP stack configuration, it could be even 2 hours before the connection times out due to the other side not being reachable. However, in some cases, the application needs to be aware of a connection issue much sooner. This is the case, for example, for postcop

  1   2   3   4   >