Re: [PATCH 06/33] rust: add qdev Device derive macro

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:38PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:38 +0200 > From: Paolo Bonzini > Subject: [PATCH 06/33] rust: add qdev Device derive macro > X-Mailer: git-send-email 2.51.0 > > From: Manos Pitsidianakis > > Add derive macro for declaring qdev proper

Re: [PATCH v6 5/5] hw/nvme: connect SPDM over NVMe Security Send/Recv

2025-09-10 Thread Klaus Jensen
On Sep 11 16:00, Wilfred Mallawa wrote: > From: Wilfred Mallawa > > This patch extends the existing support we have for NVMe with only DoE > to also add support to SPDM over the NVMe Security Send/Recv commands. > > With the new definition of the `spdm-trans` argument, users can specify > `spdm_

Re: [PATCH v6 3/5] hw/nvme: add NVMe Admin Security SPDM support

2025-09-10 Thread Klaus Jensen
On Sep 11 16:00, Wilfred Mallawa wrote: > From: Wilfred Mallawa > > Adds the NVMe Admin Security Send/Receive command support with support > for DMTFs SPDM. The transport binding for SPDM is defined in the > DMTF DSP0286. > > Signed-off-by: Wilfred Mallawa > Reviewed-by: Stefan Hajnoczi > Revi

[PATCH v6 0/5] NVMe: Add SPDM over the storage transport support

2025-09-10 Thread Wilfred Mallawa
From: Wilfred Mallawa This series extends the existing SPDM support in QEMU to support the DSP0286 SPDM Storage Transport [1] for NVMe. SPDM Storage Transport uses the NVMe Admin Security Send/Receive commands, as such, support for these commands have also been added. With the addition of a new

[PATCH v6 3/5] hw/nvme: add NVMe Admin Security SPDM support

2025-09-10 Thread Wilfred Mallawa
From: Wilfred Mallawa Adds the NVMe Admin Security Send/Receive command support with support for DMTFs SPDM. The transport binding for SPDM is defined in the DMTF DSP0286. Signed-off-by: Wilfred Mallawa Reviewed-by: Stefan Hajnoczi Reviewed-by: Jonathan Cameron --- hw/nvme/ctrl.c

[PATCH v6 1/5] spdm-socket: add seperate send/recv functions

2025-09-10 Thread Wilfred Mallawa
From: Wilfred Mallawa This is to support uni-directional transports such as SPDM over Storage. As specified by the DMTF DSP0286. Also update spdm_socket_rsp() to use the new send()/receive() functions. For the case of spdm_socket_receive(), this allows us to do error checking in one place with t

Re: [PATCH 05/33] rust: use inline const expressions

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:37PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:37 +0200 > From: Paolo Bonzini > Subject: [PATCH 05/33] rust: use inline const expressions > X-Mailer: git-send-email 2.51.0 > > They were stabilized in Rust 1.79.0. > > Signed-off-by: Paolo Bonzini >

Re: [PATCH 10/22] qdev: Automatically delete memory subregions

2025-09-10 Thread Peter Xu
On Sat, Sep 06, 2025 at 04:11:19AM +0200, Akihiko Odaki wrote: > A common pattern is that to delete memory subregions during realization > error handling and unrealization. pci automatically automatically > deletes the IO subregions, but the pattern is manually implemented > in other places, which

swtpm persistent state snapshots by copying .permall file

2025-09-10 Thread Stefan Hajnoczi
Hi Stefan, I am investigating QEMU devices with persistent state like swtpm for a specific snapshot use case. The VM is paused while disk images and other persistent state files are snapshotted. This creates a crash-consistent snapshot similar to booting after power failure on a real machine. No RA

Re: [PATCH v7 05/11] target/loongarch: add msg interrupt CSR registers

2025-09-10 Thread Bibo Mao
On 2025/9/10 下午5:11, Song Gao wrote: include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.h | 11 +++ target/loongarch/machine.c | 25 +++-- 3 files changed, 37 insertions(+),

Re: [PATCH 10/22] qdev: Automatically delete memory subregions

2025-09-10 Thread Akihiko Odaki
On 2025/09/11 6:10, Peter Xu wrote: On Sat, Sep 06, 2025 at 04:11:19AM +0200, Akihiko Odaki wrote: A common pattern is that to delete memory subregions during realization error handling and unrealization. pci automatically automatically deletes the IO subregions, but the pattern is manually impl

Re: [PATCH v2 3/3] memory: Stop piggybacking on memory region owners

2025-09-10 Thread Akihiko Odaki
On 2025/09/11 6:45, Peter Xu wrote: On Sat, Sep 06, 2025 at 04:39:06AM +0200, Akihiko Odaki wrote: MemoryRegions used to "piggyback" on their owners instead of using their own reference counters due to the circular dependencies between them, which caused new circular references. Stop piggybackin

Re: [PATCH 02/22] vfio/pci: Do not unparent in instance_finalize()

2025-09-10 Thread Akihiko Odaki
On 2025/09/11 5:41, Peter Xu wrote: On Sat, Sep 06, 2025 at 04:11:11AM +0200, Akihiko Odaki wrote: Children are automatically unparented so manually unparenting is unnecessary. Worse, automatic unparenting happens before the insntance_finalize() callback of the parent gets called, so object_unp

Re: [PATCH 04/33] rust: add missing const markers for MSRV==1.83.0

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:36PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:36 +0200 > From: Paolo Bonzini > Subject: [PATCH 04/33] rust: add missing const markers for MSRV==1.83.0 > X-Mailer: git-send-email 2.51.0 > > Rust 1.83 allows more functions to be marked const. > Fix cl

Re: [PATCH 03/33] meson, cargo: require Rust 1.83.0

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:35PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:35 +0200 > From: Paolo Bonzini > Subject: [PATCH 03/33] meson, cargo: require Rust 1.83.0 > X-Mailer: git-send-email 2.51.0 > > Signed-off-by: Paolo Bonzini > --- > docs/devel/rust.rst | 14 +--

Re: [PATCH 02/33] configure: bump Meson to 1.9.0 for use with Rust

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:34PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:34 +0200 > From: Paolo Bonzini > Subject: [PATCH 02/33] configure: bump Meson to 1.9.0 for use with Rust > X-Mailer: git-send-email 2.51.0 > > Meson 1.9.0 provides mixed linking of Rust and C objects. A

Re: [PATCH 01/33] ci: temporarily remove rust from Debian and Ubuntu

2025-09-10 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:33PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:33 +0200 > From: Paolo Bonzini > Subject: [PATCH 01/33] ci: temporarily remove rust from Debian and Ubuntu > X-Mailer: git-send-email 2.51.0 > > Signed-off-by: Paolo Bonzini > --- > .gitlab-ci.d/buildt

Re: Some iotests are failing with -luks

2025-09-10 Thread Yong Huang
On Thu, Sep 11, 2025 at 2:38 AM Kevin Wolf wrote: > Am 10.09.2025 um 18:08 hat Kevin Wolf geschrieben: > > Am 10.09.2025 um 17:16 hat Thomas Huth geschrieben: > > > luks-detached-header fail [17:15:26] [17:15:38] 12.2s > failed, exit status 1 > > > --- > /home/thuth/devel/qemu/t

Re: [PATCH v7 02/11] hw/loongarch: add virt feature avecintc and cpu feature msgint support

2025-09-10 Thread Bibo Mao
On 2025/9/10 下午5:11, Song Gao wrote: Avecintc feature is added in LoongArchVirtMachinState, and it is used to check whether virt machine supports the advanced interrupt controller and by default set avecintc with ON_OFF_AUTO_ON. LoongArchVirtMachineState adds misc_feature and misc_status for m

Re: [PATCH v7 03/11] hw/loongarch: add misc register supoort avecintc

2025-09-10 Thread Bibo Mao
there is typo issue with mail title "add misc register *supoort* avecintc" :) Regards Bibo Mao On 2025/9/10 下午5:11, Song Gao wrote: Add feature register and misc register for avecintc feature checking and setting Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 11 +

Re: [PATCH v7 10/11] target/loongarch:Implement csrrd CSR_MSGIR register

2025-09-10 Thread Bibo Mao
On 2025/9/10 下午5:11, Song Gao wrote: implement the read-clear feature for CSR_MSGIR register. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c | 21 +++ target/loonga

Re: [PATCH v7 08/11] hw/loongarch: Implement avec set irq

2025-09-10 Thread Bibo Mao
On 2025/9/10 下午5:11, Song Gao wrote: Implement avec set irq and update CSR_MSGIS. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c

Re: [PATCH v3 09/20] ui/vnc: remove use of error_printf_unless_qmp()

2025-09-10 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > The error_printf_unless_qmp() will print to the monitor if the current > one is HMP, if it is QMP nothing will be printed, otherwise stderr > will be used. > > This scenario is easily handled by checking !monitor_cur_is_qmp() and > then calling t

Re: swtpm persistent state snapshots by copying .permall file

2025-09-10 Thread Stefan Berger
On 9/10/25 5:08 PM, Stefan Hajnoczi wrote: Hi Stefan, I am investigating QEMU devices with persistent state like swtpm for a specific snapshot use case. The VM is paused while disk images and other persistent state files are snapshotted. This creates a crash-consistent snapshot similar to boot

Re: [PATCH v2 3/3] memory: Stop piggybacking on memory region owners

2025-09-10 Thread Peter Xu
On Sat, Sep 06, 2025 at 04:39:06AM +0200, Akihiko Odaki wrote: > MemoryRegions used to "piggyback" on their owners instead of using their > own reference counters due to the circular dependencies between > them, which caused new circular references. Stop piggybacking, showing > that the circular de

[PATCH v3 19/20] util: add support for formatting thread info in messages

2025-09-10 Thread Daniel P . Berrangé
The message context is now extended to be able to include the thread ID and thread name, after the program name. On Linux the thread ID will match the process TID visible in /proc, while on other platforms it will merely be an integer repr of the system thread object address/ID. This changes the o

Some iotests are failing with -luks

2025-09-10 Thread Thomas Huth
Hi, when running "./check -luks" in the qemu-iotests directory, some tests are failing for me: 295 296 inactive-node-nbd luks-detached-header Is that a known problem already? FWIW, 295 is failing with the following output: 295 fail [17:03:01] [17:03:17] 15.7sfaile

[PATCH v2] tree-wide: replace tabs with sapce and align code This patch updates by replacing the tabs with spaces and fixing alignment issues Signed-off-by: Harshini Sign

2025-09-10 Thread Harshini
Signed-off-by: Harshini --- target/alpha/cpu.h | 6 +- target/i386/cpu.h| 330 +-- target/i386/svm.h| 334 +-- target/microblaze/cpu.h | 20 +- tests/tcg/alpha/test-cond.c | 36 +- tests/tcg/arm/hello-

[PATCH v3 05/20] audio: make jackaudio use qemu_thread_set_name

2025-09-10 Thread Daniel P . Berrangé
This has greater portability than directly call pthread_setname_np, which is only 1 out of 3 possible functions for pthreads that can set the name. The new API requires a trampoline function, since it can only set the name of the current thread. Signed-off-by: Daniel P. Berrangé --- audio/jacka

[PATCH v3 08/20] log: avoid repeated prefix on incremental qemu_log calls

2025-09-10 Thread Daniel P . Berrangé
Some code makes multiple qemu_log calls to incrementally emit a single message. Currently timestamps get prepended to all qemu_log calls, even those continuing a previous incomplete message. This changes the qemu_log so it skips adding a new line prefix, if the previous qemu_log call did NOT end w

[PATCH v3 03/20] system: unconditionally enable thread naming

2025-09-10 Thread Daniel P . Berrangé
When thread naming was introduced years ago, it was disabled by default and put behind a command line flag: commit 8f480de0c91a18d550721f8d9af969ebfbda0793 Author: Dr. David Alan Gilbert Date: Thu Jan 30 10:20:31 2014 + Add 'debug-threads' suboption to --name This was done based

Re: [PATCH v5 04/29] hw/s390x/ipl: Create certificate store

2025-09-10 Thread Zhuoying Cai
On 9/8/25 8:54 PM, Collin Walling wrote: > On 8/18/25 17:42, Zhuoying Cai wrote: >> Create a certificate store for boot certificates used for secure IPL. >> >> Load certificates from the `boot-certs` parameter of s390-ccw-virtio >> machine type option into the cert store. >> >> Currently, only X.50

Re: [PATCH 02/22] vfio/pci: Do not unparent in instance_finalize()

2025-09-10 Thread Peter Xu
On Sat, Sep 06, 2025 at 04:11:11AM +0200, Akihiko Odaki wrote: > Children are automatically unparented so manually unparenting is > unnecessary. > > Worse, automatic unparenting happens before the insntance_finalize() > callback of the parent gets called, so object_unparent() calls in > the callba

[PATCH v6 1/2] Set KVM initial privilege mode and mp_state

2025-09-10 Thread Xie Bo
For KVM mode, the privilege mode should not include M-mode, and the initial value should be set to S-mode. Additionally, a following patch adds the implementation of putting the vCPU privilege mode to KVM. When the vCPU runs for the first time, QEMU will first put the privilege state to KVM. If

Re: [PATCH v4 2/2] io/channel: document how qio_channel_readv_full() handles fds

2025-09-10 Thread Peter Xu
On Wed, Sep 10, 2025 at 10:31:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: > The only realization, which may have incoming fds is > qio_channel_socket_readv() (in io/channel-socket.c). > qio_channel_socket_readv() do call (through > qio_channel_socket_copy_fds()) qemu_socket_set_block() and > qe

Re: [PATCH v4 1/2] migration/qemu-file: don't make incoming fds blocking again

2025-09-10 Thread Peter Xu
On Wed, Sep 10, 2025 at 10:31:11PM +0300, Vladimir Sementsov-Ogievskiy wrote: > In migration we want to pass fd "as is", not changing its > blocking status. > > The only current user of these fds is CPR state (through VMSTATE_FD), > which of-course doesn't want to modify fds on target when source

[PATCH v4 2/2] io/channel: document how qio_channel_readv_full() handles fds

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
The only realization, which may have incoming fds is qio_channel_socket_readv() (in io/channel-socket.c). qio_channel_socket_readv() do call (through qio_channel_socket_copy_fds()) qemu_socket_set_block() and qemu_set_cloexec() for each fd. Also, qio_channel_socket_copy_fds() is called at the end

[PATCH 2/3] migration: Make migration_has_failed() work even for CANCELLING

2025-09-10 Thread Peter Xu
We set CANCELLED very late, it means migration_has_failed() may not work correctly if it's invoked before updating CANCELLING to CANCELLED. Allow that state will make migration_has_failed() working as expected even if it's invoked slightly earlier. One current user is the multifd code for the TLS

[PATCH 2/2] target/i386: add compatibility property for pdcm feature

2025-09-10 Thread Hector Cao
The pdcm feature is supposed to be disabled when PMU is not available. Up until v10.1, pdcm feature is enabled even when PMU is off. This behavior has been fixed but this change breaks the migration of VMs that are run with QEMU < 10.0 and expect the pdcm feature to be enabled on the destination ho

[PATCH v3 18/20] util: add support for formatting a program name in messages

2025-09-10 Thread Daniel P . Berrangé
The error_report function can include the program name in any messages it prints. The qemu_log function has no equivalent behaviour. This introduces support for a "program name" in the new messages API, which will be included by default for all binaries. This change tweaks the output of the error

[PATCH v4 1/2] migration/qemu-file: don't make incoming fds blocking again

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
In migration we want to pass fd "as is", not changing its blocking status. The only current user of these fds is CPR state (through VMSTATE_FD), which of-course doesn't want to modify fds on target when source is still running and use these fds. Suggested-by: Daniel P. Berrangé Signed-off-by: Vl

[PATCH v4 0/2] save qemu-file incoming non-blocking fds

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
Hi all! That's a new version for [PATCH v3] migration/qemu-file: don't make incoming fds blocking again Supersedes: <20250910143156.1053779-1-vsement...@yandex-team.ru> , adding small changes suggested by Peter. Also, I've added here documentation patch from [PATCH 00/10] io: deal with blockin

Re: [PATCH 04/10] util: drop qemu_socket_set_nonblock()

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
On 10.09.25 21:15, Daniel P. Berrangé wrote: On Wed, Sep 10, 2025 at 08:55:57PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 10.09.25 12:44, Daniel P. Berrangé wrote: @@ -36,7 +37,11 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel, g_warning("error converting fd to g

Re: [PATCH 1/4] hw/pcie: Support enabling flit mode

2025-09-10 Thread Davidlohr Bueso
On Tue, 09 Sep 2025, Markus Armbruster wrote: "Michael S. Tsirkin" writes: On Mon, Aug 11, 2025 at 04:57:41PM +0100, Jonathan Cameron wrote: On Sun, 10 Aug 2025 20:34:02 -0700 Davidlohr Bueso wrote: > As with the link speed and width training, have ad-hoc property for > setting the flit mo

[PATCH v3 16/20] util: convert error-report & log to message API for timestamp

2025-09-10 Thread Daniel P . Berrangé
Both the error-report and log APIs can optional emit a timestamp as a prefix on messages, with the '-msg timestamp=on' command line flag is set. Convert them to the new message API for formatting the context prefix, guaranteeing they will have matching behaviour going forward. There is no change

[PATCH v3 07/20] util: add API to fetch the current thread name

2025-09-10 Thread Daniel P . Berrangé
This will be used to include the thread name in error reports in a later patch. It returns a const string stored in a thread local to avoid memory allocation when it is called repeatedly in a single thread. This makes the assumption that the thread name is set at the very start of the thread, which

[PATCH v4 09/12] aio-posix: add aio_add_sqe() API for user-defined io_uring requests

2025-09-10 Thread Stefan Hajnoczi
Introduce the aio_add_sqe() API for submitting io_uring requests in the current AioContext. This allows other components in QEMU, like the block layer, to take advantage of io_uring features without creating their own io_uring context. This API supports nested event loops just like file descriptor

[PATCH v4 11/12] block/io_uring: use aio_add_sqe()

2025-09-10 Thread Stefan Hajnoczi
AioContext has its own io_uring instance for file descriptor monitoring. The disk I/O io_uring code was developed separately. Originally I thought the characteristics of file descriptor monitoring and disk I/O were too different, requiring separate io_uring instances. Now it has become clear to me

Re: [PATCH 04/10] util: drop qemu_socket_set_nonblock()

2025-09-10 Thread Daniel P . Berrangé
On Wed, Sep 10, 2025 at 08:55:57PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 10.09.25 12:44, Daniel P. Berrangé wrote: > > > @@ -36,7 +37,11 @@ static gboolean ga_channel_listen_accept(GIOChannel > > > *channel, > > > g_warning("error converting fd to gsocket: %s", > > > strerror(

[PATCH v4 02/12] aio-posix: keep polling enabled with fdmon-io_uring.c

2025-09-10 Thread Stefan Hajnoczi
Commit 816a430c517e ("util/aio: Defer disabling poll mode as long as possible") kept polling enabled when the event loop timeout is 0. Since there is no timeout the event loop will continue immediately and the overhead of disabling and re-enabling polling can be avoided. fdmon-io_uring.c is unable

[PATCH v3 12/20] monitor: introduce monitor_cur_hmp() function

2025-09-10 Thread Daniel P . Berrangé
A number of callers use monitor_cur() followed by !monitor_cur_is_qmp(). This is undesirable because monitor_cur_is_qmp() will itself call monitor_cur() again, and monitor_cur() must acquire locks and do hash table lookups. Introducing a monitor_cur_hmp() helper will combine the two operations int

[PATCH v3 11/20] monitor: move error_vprintf() back to error-report.c

2025-09-10 Thread Daniel P . Berrangé
This conceptually reverts 397d30e9401d2da96dbdf0ce49805d6d4bb68833. The discussion around stubs in that commit does not appear to be important to the current state of the codebase. This makes the error_vprintf() impl source file match that of error_printf(), and also match the header where it is d

[PATCH v3 15/20] util: introduce common helper for error-report & log code

2025-09-10 Thread Daniel P . Berrangé
The error-report and log code both have a need to add prefixes to messages they are printing, with the current example being a timestamp. The format and configuration they use should be consistent, so providing a common helper will ensure this is always the case. Initially the helper only emits a

[PATCH v4 06/12] aio: free AioContext when aio_context_new() fails

2025-09-10 Thread Stefan Hajnoczi
g_source_destroy() only removes the GSource from the GMainContext it's attached to, if any. It does not free it. Use g_source_unref() instead so that the AioContext (which embeds a GSource) is freed. There is no need to call g_source_destroy() in aio_context_new() because the GSource isn't attache

[PATCH v3 09/20] ui/vnc: remove use of error_printf_unless_qmp()

2025-09-10 Thread Daniel P . Berrangé
The error_printf_unless_qmp() will print to the monitor if the current one is HMP, if it is QMP nothing will be printed, otherwise stderr will be used. This scenario is easily handled by checking !monitor_cur_is_qmp() and then calling the error_printf() function. Signed-off-by: Daniel P. Berrangé

[PATCH v3 20/20] util: add brackets around guest name in message context

2025-09-10 Thread Daniel P . Berrangé
The message context can optionally include the guest name if the argument '-msg guest-name=on' is given. The formatting, however, does not look good if the guest name contains whitespace. Change the output to include square brackets to demarcate the name. Before: # qemu-system-x86_64 -object tl

[PATCH v4 03/12] tests/unit: skip test-nested-aio-poll with io_uring

2025-09-10 Thread Stefan Hajnoczi
test-nested-aio-poll relies on internal details of how fdmon-poll.c handles AioContext polling. Skip it when other fdmon implementations are in use. Note that this test is only built on POSIX systems so it is safe to include "util/aio-posix.h". Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Bl

[PATCH v4 10/12] aio-posix: avoid EventNotifier for cqe_handler_bh

2025-09-10 Thread Stefan Hajnoczi
fdmon_ops->wait() is called with notify_me enabled. This makes it an expensive place to call qemu_bh_schedule() because aio_notify() invokes write(2) on the EventNotifier. Moving qemu_bh_schedule() after notify_me is reset improves IOPS from 270k to 300k IOPS with --blockdev file,aio=io_uring. I

[PATCH v4 08/12] aio-posix: gracefully handle io_uring_queue_init() failure

2025-09-10 Thread Stefan Hajnoczi
io_uring may not be available at runtime due to system policies (e.g. the io_uring_disabled sysctl) or creation could fail due to file descriptor resource limits. Handle failure scenarios as follows: If another AioContext already has io_uring, then fail AioContext creation so that the aio_add_sqe

[PATCH v4 07/12] aio: add errp argument to aio_context_setup()

2025-09-10 Thread Stefan Hajnoczi
When aio_context_new() -> aio_context_setup() fails at startup it doesn't really matter whether errors are returned to the caller or the process terminates immediately. However, it is not acceptable to terminate when hotplugging --object iothread at runtime. Refactor aio_context_setup() so that er

[PATCH v4 01/12] aio-posix: fix race between io_uring CQE and AioHandler deletion

2025-09-10 Thread Stefan Hajnoczi
When an AioHandler is enqueued on ctx->submit_list for removal, the fill_sq_ring() function will submit an io_uring POLL_REMOVE operation to cancel the in-flight POLL_ADD operation. There is a race when another thread enqueues an AioHandler for deletion on ctx->submit_list when the POLL_ADD CQE ha

[PATCH v3 01/20] include: define constant for early constructor priority

2025-09-10 Thread Daniel P . Berrangé
Functions marked with __attribute__((__constructor__)) will be invoked in linker order. In theory this is well defined, but in practice, it is hard to determine what this order will be with the layers of indirection through meson, ninja and the static libraries QEMU builds. Notably, the order curr

[PATCH v4 12/12] block/io_uring: use non-vectored read/write when possible

2025-09-10 Thread Stefan Hajnoczi
The io_uring_prep_readv2/writev2() man pages recommend using the non-vectored read/write operations when possible for performance reasons. I didn't measure a significant difference but it doesn't hurt to have this optimization in place. Suggested-by: Eric Blake Signed-off-by: Stefan Hajnoczi --

[PATCH v4 05/12] aio: remove aio_context_use_g_source()

2025-09-10 Thread Stefan Hajnoczi
There is no need for aio_context_use_g_source() now that epoll(7) and io_uring(7) file descriptor monitoring works with the glib event loop. AioContext doesn't need to be notified that GSource is being used. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- include/block/aio.h

Re: [RFC 0/4] util: qmessage_context followup

2025-09-10 Thread Daniel P . Berrangé
On Tue, Sep 02, 2025 at 12:30:06PM +0200, Richard Henderson wrote: > Hi Daniel, > > I'm still not keen on qmessage_context allocating a string. > > If we *did* allocate a string, it should be a GString so that we can > easily append to that. The only benefit I see from this is that we > would co

[PATCH v3 14/20] util: fix interleaving of error & trace output

2025-09-10 Thread Daniel P . Berrangé
The monitor_cur_hmp() function will acquire/release mutex locks, which will trigger trace probes, which can in turn trigger qemu_log() calls. vreport() calls monitor_cur() multiple times through its execution both directly and indirectly via error_vprintf(). The result is that the prefix informati

[PATCH v3 00/20] util: sync error_report & qemu_log output more closely

2025-09-10 Thread Daniel P . Berrangé
This series is a tangent that came out of discussion in https://lists.nongnu.org/archive/html/qemu-devel/2025-08/msg00903.html In thinking about adding thread info to error_report, I came to realize we should likely make qemu_log behave consistently with error_report & friends. We already hono

[PATCH v3 02/20] monitor: initialize global data from a constructor

2025-09-10 Thread Daniel P . Berrangé
Some monitor functions, most notably, monitor_cur() rely on global data being initialized by 'monitor_init_globals()'. The latter is called relatively late in startup. If code triggers error_report() before monitor_init_globals() is called, QEMU will abort when accessing the uninitialized monitor m

[PATCH v3 10/20] monitor: remove redundant error_[v]printf_unless_qmp

2025-09-10 Thread Daniel P . Berrangé
These functions only had one caller which was easily converted to the normal error_printf() function. Remove them as they don't add sufficient value. Signed-off-by: Daniel P. Berrangé --- include/monitor/monitor.h | 3 --- monitor/monitor.c | 24 stubs/error-pri

Re: [PATCH 04/10] util: drop qemu_socket_set_nonblock()

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
On 10.09.25 12:44, Daniel P. Berrangé wrote: @@ -36,7 +37,11 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel, g_warning("error converting fd to gsocket: %s", strerror(errno)); goto out; } -qemu_socket_set_nonblock(client_fd); +if (!qemu_set_blocki

Re: [RFC V2 0/8] Live update: tap and vhost

2025-09-10 Thread Peter Xu
On Wed, Sep 10, 2025 at 12:35:10AM +0300, Vladimir Sementsov-Ogievskiy wrote: > > > I wished devices could opt-in to provide its own model so that it is > > > prepared to boot the QEMU without FDs being there and pause itself at that > > > stage if a load would happen. > > > > So, you suggest to p

Re: [PATCH v6 2/2] Fix VM resume after QEMU+KVM migration

2025-09-10 Thread Andrew Jones
On Wed, Sep 10, 2025 at 05:35:28PM +0800, Xie Bo wrote: > Fix two migration issues for virtual machines in KVM mode: > 1.It saves and restores the vCPU's privilege mode to ensure that the > vCPU's privilege mode is correct after migration. > 2.It saves and restores the vCPU's mp_state (runnable or

Re: [PATCH v6 1/2] Set KVM initial privilege mode and mp_state

2025-09-10 Thread Andrew Jones
On Wed, Sep 10, 2025 at 05:35:27PM +0800, Xie Bo wrote: > For KVM mode, the privilege mode should not include M-mode, and the > initial value should be set to S-mode. Additionally, a following patch > adds the implementation of putting the vCPU privilege mode to KVM. > When the vCPU runs for the

Re: [PATCH] migration: Apply migration specific keep-alive defaults to inet socket

2025-09-10 Thread Peter Xu
On Wed, Sep 10, 2025 at 08:10:57AM +0100, Daniel P. Berrangé wrote: > On Tue, Sep 09, 2025 at 05:58:49PM -0400, Peter Xu wrote: > > On Tue, Sep 09, 2025 at 04:09:23PM +0100, Daniel P. Berrangé wrote: > > > On Tue, Sep 09, 2025 at 05:01:24PM +0200, Juraj Marcin wrote: > > > > From: Juraj Marcin > >

Re: Some iotests are failing with -luks

2025-09-10 Thread Kevin Wolf
Am 10.09.2025 um 17:16 hat Thomas Huth geschrieben: > > Hi, > > when running "./check -luks" in the qemu-iotests directory, > some tests are failing for me: > > 295 296 inactive-node-nbd luks-detached-header > > Is that a known problem already? Not to me anyway. > FWIW, 295 is failing with t

Re: Rust high-level pre/post migration callbacks

2025-09-10 Thread Zhao Liu
On Wed, Sep 10, 2025 at 01:33:53PM +0200, Paolo Bonzini wrote: > Date: Wed, 10 Sep 2025 13:33:53 +0200 > From: Paolo Bonzini > Subject: Re: Rust high-level pre/post migration callbacks > > On Wed, Sep 10, 2025 at 9:58 AM Zhao Liu wrote: > > > If a pure snapshot is possible, implementing the new

[PATCH 1/3] migration/tls: Gracefully shutdown main and preempt channels

2025-09-10 Thread Peter Xu
QEMU supported graceful shutdowns for multifd channels starting from commit 48796f6b44 ("migration/multifd: Terminate the TLS connection"). Then error check was enabled for premature TLS terminations. Now if we run the preempt TLS unit test, the test would pass, but there will be a warning report

[PATCH 3/3] migration/multifd: Use the new graceful termination helper

2025-09-10 Thread Peter Xu
Multifd has a separate loop to do TLS terminations gracefully. Meanwhile, it depends on two variables which records thread creations. It works perfectly before, however relying on "whether some threads are created" flag might be not as straightforward to decide a graceful shutdown. Since we'll n

Re: [PATCH 04/10] util: drop qemu_socket_set_nonblock()

2025-09-10 Thread Daniel P . Berrangé
On Wed, Sep 03, 2025 at 12:44:04PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Use common qemu_set_blocking() instead. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > contrib/ivshmem-server/ivshmem-server.c | 5 - > hw/hyperv/syndbg.c | 4 +++- > hw/virtio/vho

[PATCH 3/3] tests/qemu-iotest: Add more image formats to the thorough testing

2025-09-10 Thread Thomas Huth
From: Thomas Huth Now that the "check" script is a little bit smarter with providing a list of tests that are supported for an image format, we can also add more image formats that can be used for generic block layer testing. (Note: qcow1 and luks are not added because some tests there currently

[PATCH 2/3] tests/qemu-iotests: Improve the dry run list to speed up thorough testing

2025-09-10 Thread Thomas Huth
From: Thomas Huth When running the tests in thorough mode, e.g. with: make -j$(nproc) check SPEED=thorough we currently always get a huge amount of total tests that the test runner tries to execute (2457 in my case), but a big bunch of them are only skipped (1099 in my case, meaning that only

[PATCH 0/3] tests/qemu-iotests: Improve test detection for meson

2025-09-10 Thread Thomas Huth
When running the test in thorough mode, we currently try to run a lot of tests that are only skipped, which is somewhat annoying. This series fixes the problems (see second patch), and add some more image formats in the third patch (which should be fine now that the list of tests that we try to exe

[PATCH v2 4/4] target/riscv: Save stimer and vstimer in CPU vmstate

2025-09-10 Thread TANG Tiancheng
vmstate_riscv_cpu was missing env.stimer and env.vstimer. Without migrating these QEMUTimer fields, active S/VS-mode timer events are lost after snapshot or migration. Add VMSTATE_TIMER_PTR() entries to save and restore them. Reviewed-by: LIU Zhiwei Reviewed-by: Daniel Henrique Barboza Signed-o

[PATCH v2 3/4] hw/intc: Save timers array in RISC-V mtimer VMState

2025-09-10 Thread TANG Tiancheng
The current 'timecmp' field in vmstate_riscv_mtimer is insufficient to keep timers functional after migration. If an mtimer's entry in 'mtimer->timers' is active at the time the snapshot is taken, it means riscv_aclint_mtimer_write_timecmp() has written to 'mtimecmp' and scheduled a timer into QEM

Re: [PATCH v2] tree-wide: replace tabs with sapce and align code This patch updates by replacing the tabs with spaces and fixing alignment issues Signed-off-by: Harshini

2025-09-10 Thread Michael Tokarev
Please don't. For the countless number of times. This changes authorship of code while actual code has not changed. Thanks, /mjt

Re: [PATCH v3] migration/qemu-file: don't make incoming fds blocking again

2025-09-10 Thread Daniel P . Berrangé
On Wed, Sep 10, 2025 at 05:31:56PM +0300, Vladimir Sementsov-Ogievskiy wrote: > In migration we want to pass fd "as is", not changing its > blocking status. > > The only current user of these fds is CPR state (through VMSTATE_FD), > which of-course doesn't want to modify fds on target when source

[PATCH v3] migration/qemu-file: don't make incoming fds blocking again

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
In migration we want to pass fd "as is", not changing its blocking status. The only current user of these fds is CPR state (through VMSTATE_FD), which of-course doesn't want to modify fds on target when source is still running and use these fds. Suggested-by: Daniel P. Berrangé Signed-off-by: Vl

Re: [PATCH v2 4/8] qapi: add interface for local TAP migration

2025-09-10 Thread Vladimir Sementsov-Ogievskiy
On 10.09.25 09:28, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: To migrate TAP device (including open fds) locally, user should: 1. enable local-tap migration capability both on source and target 2. use additional local-incoming=true option for tap on target Why capability i

Re: [PATCH v2] tree-wide: replace tabs with sapce and align code This patch updates by replacing the tabs with spaces and fixing alignment issues Signed-off-by: Harshini

2025-09-10 Thread Daniel P . Berrangé
On Wed, Sep 10, 2025 at 04:19:56PM +0300, Michael Tokarev wrote: > Please don't. For the countless number of times. > This changes authorship of code while actual code > has not changed. FWIW, we can workaround that by adding to .git-blame-ignore-revs, but bulk re-formatting across multiple subsy

Re: [PATCH 3/4] export/fuse: Safe termination for FUSE-uring

2025-09-10 Thread Stefan Hajnoczi
On Tue, Sep 09, 2025 at 04:51:32PM -0400, Brian Song wrote: > > > On 9/9/25 3:33 PM, Stefan Hajnoczi wrote: > > On Fri, Aug 29, 2025 at 10:50:24PM -0400, Brian Song wrote: > > > @@ -901,24 +941,15 @@ static void fuse_export_shutdown(BlockExport > > > *blk_exp) > > >*/ > > >

Re: [PATCH 4/4] iotests: add tests for FUSE-over-io_uring

2025-09-10 Thread Stefan Hajnoczi
On Tue, Sep 09, 2025 at 04:51:12PM -0400, Brian Song wrote: > > > On 9/9/25 3:38 PM, Stefan Hajnoczi wrote: > > On Fri, Aug 29, 2025 at 10:50:25PM -0400, Brian Song wrote: > > > To test FUSE-over-io_uring, set the environment variable > > > FUSE_OVER_IO_URING=1. This applies only when using the >

[PATCH v8 3/7] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec

2025-09-10 Thread Albert Esteve
Add SHMEM_MAP/_UNMAP request to the vhost-user spec documentation. Reviewed-by: Stefan Hajnoczi Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 58 + 1 file changed, 58 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhos

Question: ThreadSanitizer support in QEMU user-mode

2025-09-10 Thread Arkadiusz Marud
Hi all, I am experimenting with running a C++ project built with ThreadSanitizer (TSAN) under QEMU. The documentation describes TSAN usage in system-mode (qemu-system-x86_64) with --enable-tsan, but I couldn’t find any reference to support in user-mode (qemu-x86_64). Does QEMU user-mode supp

[PATCH] docs/interop/firmware: Add riscv64 to FirmwareArchitecture

2025-09-10 Thread Andrea Bolognani
Descriptors using this value have been shipped for years by distros, so we just need to update the spec to match reality. Signed-off-by: Andrea Bolognani --- docs/interop/firmware.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/interop/firmware.json b/docs/intero

[RFC PATCH 0/2] Fix cross migration issue with missing features: pdcm, arch-capabilities

2025-09-10 Thread Hector Cao
Hello, Since it is a blocking issue for us, we went further and ended up with a solution along [1] that allows us to get out of this situation. The idea is to add compatibility properties to restore legacy behaviors for machine types with older versions of QEMU (<10.1). 2 compatiblity propertie

[PATCH v8 7/7] vhost-user-device: Add shared memory BAR

2025-09-10 Thread Albert Esteve
Add shared memory BAR support to vhost-user-device-pci to enable direct file mapping for VIRTIO Shared Memory Regions. The implementation creates a consolidated shared memory BAR that contains all VIRTIO Shared Memory Regions as subregions. Each region is configured with its proper shmid, size, an

[PATCH v8 6/7] qmp: add shmem feature map

2025-09-10 Thread Albert Esteve
Add new vhost-user protocol VHOST_USER_PROTOCOL_F_SHMEM feature to feature map. Reviewed-by: Stefan Hajnoczi Signed-off-by: Albert Esteve --- hw/virtio/virtio-qmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index 3b6377cf0d..8c2cfd091

[PATCH v8 2/7] vhost_user.rst: Align VhostUserMsg excerpt members

2025-09-10 Thread Albert Esteve
Add missing members to the VhostUserMsg excerpt in the vhost-user spec documentation. Reviewed-by: David Hildenbrand Reviewed-by: Stefan Hajnoczi Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs/interop/vhost-user.rst b/d

[PATCH] ui/sdl2: fix reset scaling binding to be consistent with gtk

2025-09-10 Thread Nir Lichtman
Problem: Currently the reset scaling hotkey is inconsistent between SDL and GTK graphics modes. Solution: Fix SDL to use MOD+0 instead of MOD+u which is in line with GTK and generally more consistent with other apps. This is also related to my previously sent patch fixing the docs. Suggested-by:

Re: [PULL 24/28] hpet: switch to fine-grained device locking

2025-09-10 Thread Paolo Bonzini
On Wed, Sep 10, 2025 at 1:16 PM Igor Mammedov wrote: > > On Mon, 8 Sep 2025 15:30:19 +0100 > Daniel P. Berrangé wrote: > > > Hi, > > > > This patches causes a regression making QEMU abort in the KVM Xen > > functional test. > > > > To reproduce please run 'make check-functional-x86_64', or more

  1   2   >