[PULL 23/61] rust: add missing const markers for MSRV==1.83.0

2025-09-13 Thread Paolo Bonzini
Rust 1.83 allows more functions to be marked const. Fix clippy with bumped minimum supported Rust version. Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-5-pbonz...@redhat.com Signed-off-by: Paolo Bonzini --- rust/bits/src/lib.rs| 6 +++--- rust/qemu-ap

[PATCH v4 9/9] tests/functional: Add test for IBM PPE42 instructions

2025-09-13 Thread Glenn Miles
Adds a functional test for the IBM PPE42 instructions which downloads a test image from a public github repo and then loads and executes the image. (see https://github.com/milesg-github/ppe42-tests for details) Test status is checked by periodically issuing 'info register' commands and checking th

Re: [PATCH v5 04/47] hw/arm/xlnx-versal: canfd: refactor creation

2025-09-13 Thread Edgar E. Iglesias
On Fri, Sep 12, 2025 at 12:00:13PM +0200, Luc Michel wrote: > Refactor the CAN controllers creation using the VersalMap structure. > > Note that the connection to the CRL is removed for now and will be > re-added by next commits. > > The xlnx-versal-virt machine now dynamically creates the correc

Re: [PATCH v4 00/10] virtio-console: notify about the terminal size

2025-09-13 Thread Filip Hejsek
On Fri, 2025-09-12 at 04:41 -0400, Michael S. Tsirkin wrote: > > The patch series in its current form provides no way to disable > > the console size functionality, > > Well I see the console-size property, no? That only disables the VIRTIO_CONSOLE_F_SIZE feature flag, but VIRTIO_CONSOLE_RESIZE

[PATCH v5 21/47] hw/arm/xlnx-versal: add the mp_affinity property to the CPU mapping

2025-09-13 Thread Luc Michel
Add a way to configure the MP affinity value of the CPUs given their core and cluster IDs. For the Versal APU CPUs, the MP affinity value is given by the core ID in Aff0. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias --- hw/arm/xlnx-versal.c | 16 1 file changed, 16

[PATCH v4 8/9] hw/ppc: Add a test machine for the IBM PPE42 CPU

2025-09-13 Thread Glenn Miles
Adds a test machine for the IBM PPE42 processor, including a DEC, FIT, WDT and 512 KiB of ram. The purpose of this machine is only to provide a generic platform for testing instructions of the recently added PPE42 processor model which is used extensively in the IBM Power9, Power10 and future Pow

Re: [PATCH v4 39/47] target/arm/tcg/cpu64: add the cortex-a78ae CPU

2025-09-13 Thread Peter Maydell
On Fri, 22 Aug 2025 at 16:17, Luc Michel wrote: > > Add support for the ARM Cortex-A78AE CPU. > > Signed-off-by: Luc Michel > --- > target/arm/tcg/cpu64.c | 79 ++ > 1 file changed, 79 insertions(+) > > diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/

[PATCH] hpet: guard IRQ handling with BQL

2025-09-13 Thread Igor Mammedov
Commit [1] made qemu fail with abort: xen_evtchn_set_gsi: Assertion `bql_locked()' failed. when running ./tests/functional/x86_64/test_kvm_xen.py tests. To fix it make sure that BQL is held when manipulating IRQs. 1) Fixes: 7defb58baf (hpet: switch to fine-grained device locking) Reported-by: D

[PATCH v8 for v10.0.0 2/2] Fix VM resume after QEMU+KVM migration

2025-09-13 Thread Xie Bo
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 stopped) and includes this state in the migration sequence, up

[PATCH v5 23/47] hw/intc/arm_gicv3: Introduce a 'first-cpu-index' property

2025-09-13 Thread Luc Michel
From: Francisco Iglesias Introduce a 'first-cpu-index' property for specifying the first QEMU CPU connected to the GICv3. This makes it possible to have multiple instances of the GICv3 connected to different CPU clusters. For KVM, mark this property has unsupported. It probably does not make muc

Re: [PATCH 23/33] rust: split "system" crate

2025-09-13 Thread Zhao Liu
On Mon, Sep 08, 2025 at 12:49:55PM +0200, Paolo Bonzini wrote: > Date: Mon, 8 Sep 2025 12:49:55 +0200 > From: Paolo Bonzini > Subject: [PATCH 23/33] rust: split "system" crate > X-Mailer: git-send-email 2.51.0 > > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau > Link: > https:/

[PATCH v8 0/2] Generate strided vector loads/stores with tcg nodes

2025-09-13 Thread Chao Liu
Hi all, Thanks Richard for the review. In patch v8: Richard gave some good improvements, but I don't have time or energy to do them now. So this patch only fixes the clear and easy problems first. 1. Use the right TCGv type for each variable — for example, make mask_elem type TCGv_i64. 2. Us

Re: [PATCH trivial] ui/gtk: Fix callback function signature

2025-09-13 Thread Alex Bennée
Filip Hejsek writes: > The correct type for opaque pointer is gpointer, > not gpointer * (which is a pointer to a pointer). > > Signed-off-by: Filip Hejsek Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH] .gitmodules: move u-boot mirrors to qemu-project-mirrors

2025-09-13 Thread Alex Bennée
Alex Bennée writes: > To continue our GitLab Open Source Program license we need to pass an > automated license check for all repos under qemu-project. While U-Boot > is clearly GPLv2 rather than fight with the automated validation > script just move the mirror across to a separate project. > > S

[PATCH v8 2/2] tests/tcg/riscv64: Add test for vlsseg8e32 instruction

2025-09-13 Thread Chao Liu
From: Chao Liu This case, it copied 64 bytes from a0 to a1 with vlsseg8e32. Signed-off-by: Chao Liu Signed-off-by: Nicholas Piggin Tested-by: Eric Biggers --- tests/tcg/riscv64/Makefile.softmmu-target | 7 +- tests/tcg/riscv64/test-vlsseg8e32.S | 107 ++ 2 files c

Re: [PULL 00/61] CPU, Rust, x86 changes for 2025-09-13

2025-09-13 Thread Peter Maydell
On Sat, 13 Sept 2025 at 09:12, Paolo Bonzini wrote: > > The following changes since commit 190d5d7fd725ff754f94e8e0cbfb69f279c82b5d: > > Merge tag 'pull-request-2025-09-09' of https://gitlab.com/thuth/qemu into > staging (2025-09-11 12:41:01 +0100) > > are available in the Git repository at: >

[PATCH v8 1/2] target/riscv: Use tcg nodes for strided vector ld/st generation

2025-09-13 Thread Chao Liu
This commit improves the performance of QEMU when emulating strided vector loads and stores by substituting the call for the helper function with the generation of equivalent TCG operations. PS: An implementation is permitted to cause an illegal instruction if vstart is not 0 and it is set to a v

Re: [PATCH v2 1/8] char-socket: tcp_chr_recv(): drop extra _set_(block,cloexec)

2025-09-13 Thread Daniel P . Berrangé
On Thu, Sep 11, 2025 at 12:19:59PM +0300, Vladimir Sementsov-Ogievskiy wrote: > qio_channel_readv_full() guarantees BLOCKING and CLOEXEC states for > incoming descriptors, no reason to call extra ioctls. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > chardev/char-socket.c | 14 -

[PULL 18/61] accel: make all calls to qemu_process_cpu_events look the same

2025-09-13 Thread Paolo Bonzini
There is no reason for some accelerators to use qemu_process_cpu_events_common (which is separated from qemu_process_cpu_events() specifically for round robin TCG). They can also check for events directly on the first pass through the loop, instead of setting cpu->exit_request to true. Reviewed-b

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

2025-09-13 Thread Wilfred Mallawa
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_trans=nvme` or `spdm_trans=doe`. This allows us to sel

[PATCH v4 0/4] tests/functional: Test with scripts/vmstate-static-checker.py

2025-09-13 Thread Thomas Huth
There are also some files available in tests/vmstate-static-checker-data/ which were used in the past to verify the functionality of the checker script. Move them to tests/data/vmstate-static-checker now and add an automated test that checks for the expected output when using these files with the s

Re: [PATCH v3 1/6] hw/sd/sdcard: Fix size check for backing block image

2025-09-13 Thread Warner Losh
On Tue, Sep 9, 2025 at 6:51 AM Jan Kiszka wrote: > From: Jan Kiszka > > Alignment rules apply the the individual partitions (user, boot, later > on also RPMB) and depend both on the size of the image and the type of > the device. Up to and including 2GB, the power-of-2 rule applies to the > user

[PULL 07/23] tests/functional: enable force refresh of cached assets

2025-09-13 Thread Thomas Huth
From: Daniel P. Berrangé If the 'QEMU_TEST_REFRESH_CACHE' environment variable is set, then ignore any existing cached asset and download a fresh copy. This can be used to selectively refresh assets if set before running a single test script. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. B

Re: [PATCH 0/2] arm: add kvm-psci-version vcpu property

2025-09-13 Thread Sebastian Ott
On Thu, 11 Sep 2025, Peter Maydell wrote: On Thu, 11 Sept 2025 at 17:29, Sebastian Ott wrote: On Thu, 11 Sep 2025, Peter Maydell wrote: On Thu, 11 Sept 2025 at 16:59, Sebastian Ott wrote: On Thu, 11 Sep 2025, Peter Maydell wrote: On Thu, 11 Sept 2025 at 15:49, Sebastian Ott wrote: This

[PATCH v5 00/47] AMD Versal Gen 2 support

2025-09-13 Thread Luc Michel
v5: - Patch 36 (xlnx-versal-crl versal2 version): replaced `return NULL' with a `g_assert_not_reached()' in the versal2_decode_periph_rst function. [Phil] - Fixed remaining memory leaks in the Versal SoC by adding a finalize function. [Peter] - Patch 39 (cortex-a78ae addition):

RE: [RFC PATCH v3 06/15] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd

2025-09-13 Thread Shameer Kolothum
> -Original Message- > From: Eric Auger > Sent: 05 September 2025 09:43 > To: qemu-...@nongnu.org; qemu-devel@nongnu.org; Shameer Kolothum > > Cc: peter.mayd...@linaro.org; Jason Gunthorpe ; Nicolin > Chen ; ddut...@redhat.com; berra...@redhat.com; > Nathan Chen ; Matt Ochs ; > smost...

Re: seabios-hppa: is it acpi-aware?

2025-09-13 Thread Helge Deller
On 9/12/25 23:09, Michael Tokarev wrote: On 12.09.2025 23:49, Helge Deller wrote: On 9/12/25 22:35, Michael Tokarev wrote: Does seabios-hppa needs ACPI? No. When building, it embeds the acpi tables (src/fw/acpi-dsdt.hex etc). That table can be dropped. If you come up with a patch to build

[PATCH v5 45/47] docs/system/arm/xlnx-versal-virt: add a note about dumpdtb

2025-09-13 Thread Luc Michel
Add a note in the DTB section explaining how to dump the generated DTB using the dumpdtb machine option. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias --- docs/system/arm/xlnx-versal-virt.rst | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/system/arm/

Re: [PATCH v4 00/10] virtio-console: notify about the terminal size

2025-09-13 Thread Michael S. Tsirkin
On Fri, Sep 12, 2025 at 04:41:05AM -0400, Michael S. Tsirkin wrote: > On Fri, Sep 12, 2025 at 05:39:45AM +0200, Filip Hejsek wrote: > > The goal of this series is to have a resizable terminal into a guest > > without having to set up networking and using, e.g. ssh. > > > > The virtio spec allows a

Re: [PATCH v7 for v10.0.0 0/2] target/riscv:Fix riscv64 kvm migration

2025-09-13 Thread Andrew Jones
On Thu, Sep 11, 2025 at 04:36:14PM +0800, Xie Bo wrote: > This series(v7) replaces the earlier series patch"[PATCH v6 for v10.0.0 0/2] > target/riscv: Fix riscv64 kvm migration". > > Changes since v6: > - Patch 1: allow boot CPU to be randomly selected on each reset > - Patch 2: unchanged; keep Re

[PATCH v5 19/47] hw/arm/xlnx-versal-virt: virtio: refactor creation

2025-09-13 Thread Luc Michel
Refactor the creation of virtio devices. Use the accessors provided by the Versal SoC to retrieve the reserved MMIO and IRQ space. Those are defined in the VersalMap structure. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias --- include/hw/arm/xlnx-versal.h | 3 +++ hw/arm/xlnx-versa

[PATCH v5 09/47] hw/arm/xlnx-versal: usb: refactor creation

2025-09-13 Thread Luc Michel
Refactor the USB controller creation using the VersalMap structure. Note that the connection to the CRL is removed for now and will be re-added by next commits. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias --- include/hw/arm/xlnx-versal.h | 5 --- hw/arm/xlnx-versal-virt.c| 5

[PATCH v5 36/47] hw/misc/xlnx-versal-crl: add the versal2 version

2025-09-13 Thread Luc Michel
Add the versal2 version of the CRL device. For the implemented part, it is similar to the versal version but drives reset line of more devices. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias Reviewed-by: Philippe Mathieu-Daudé --- include/hw/arm/xlnx-versal-version.h | 1 + includ

[PATCH v5 07/47] hw/arm/xlnx-versal: adma: refactor creation

2025-09-13 Thread Luc Michel
Refactor the ADMA creation using the VersalMap structure. Note that the connection to the CRL is removed for now and will be re-added by next commits. Signed-off-by: Luc Michel Reviewed-by: Francisco Iglesias --- include/hw/arm/xlnx-versal.h | 2 - hw/arm/xlnx-versal-virt.c| 28 --

[PULL 48/61] rust: re-export qemu_macros internal helper in "bits"

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Avoid the need to import "qemu_macros". Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-21-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/bits/src/lib.rs | 7 +-- 1 file changed, 5 in

[PULL 36/61] rust: make build.rs generic over various ./rust/projects

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Guess the name of the subdir from the manifest directory, instead of hard-coding it. In the following commits, other crates can then link to this file, instead of maintaining their own copy. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147

[PULL 20/61] ci: temporarily remove rust from Ubuntu

2025-09-13 Thread Paolo Bonzini
This is for the purpose of getting an easy-to-use base for future development. The plan is: - that Debian will require trixie to enable Rust usage - that Ubuntu will backport 1.83 to its 22.04 and 24.04 versions (https://bugs.launchpad.net/ubuntu/+source/rustc-1.83/+bug/2120318) Marc-André is w

[PULL 37/61] rust: split "util" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-7-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/qemu-api/wrapper.h | 6 --- ru

[PULL 46/61] rust/pl011: drop dependency on qemu_api

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-19-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/wrapper.h | 51 ++ rust/Cargo.lock

[PULL 24/61] rust: use inline const expressions

2025-09-13 Thread Paolo Bonzini
They were stabilized in Rust 1.79.0. Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-6-pbonz...@redhat.com Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst| 9 +++-- rust/qemu-api/src/callbacks.rs | 27 +-- rust/qemu-api/

[PULL 42/61] rust: split "system" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-15-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/qemu-api/wrapper.h | 3 --

[PULL 30/61] rust: remove unused global qemu "allocator"

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau The global allocator has always been disabled. There is no clear reason Rust and C should use the same allocator. Allocations made from Rust must be freed by Rust, and same for C, otherwise we head into troubles. Signed-off-by: Marc-André Lureau Link: https://lore.kerne

[PULL 54/61] i386/cpu: Enable SMM cpu address space under KVM

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li Kirill Martynov reported assertation in cpu_asidx_from_attrs() being hit when x86_cpu_dump_state() is called to dump the CPU state[*]. It happens when the CPU is in SMM and KVM emulation failure due to misbehaving guest. The root cause is that QEMU i386 never enables the SMM add

[PULL 61/61] accel/kvm: Set guest_memfd_offset to non-zero value only when guest_memfd is valid

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li Current QEMU unconditionally sets the guest_memfd_offset of KVMSlot in kvm_set_phys_mem(), which leads to the trace of kvm_set_user_memory looks: kvm_set_user_memory AddrSpace#0 Slot#4 flags=0x2 gpa=0xe size=0x2 ua=0x7f5840de guest_memfd=-1 guest_memfd_offset=0x3e00

[PULL 52/61] rust: do not inline do_init_io

2025-09-13 Thread Paolo Bonzini
This is now possible since the hwcore integration tests do not link the system crate anymore. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-34-pbonz...@redhat.com Signed-off-by: Paolo Bonzini --- rust/system/src/memory.rs | 5 - 1

[PULL 55/61] target/i386: Define enum X86ASIdx for x86's address spaces

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li Define X86ASIdx as enum, like ARM's ARMASIdx, so that it's clear index 0 is for memory and index 1 is for SMM. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Tested-By: Kirill Martynov Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20250730095253.183341

[PULL 34/61] rust: move Cell vmstate impl

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau This will allow to split vmstate to a standalone crate next. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-10-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/cell.rs| 6

[PULL 56/61] multiboot: Fix the split lock

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li While running the kvm-unit-tests on Intel platforms with "split lock disable" feature, every test triggers a kernel warning of x86/split lock detection: #AC: qemu-system-x86_64/373232 took a split_lock trap at address: 0x1e3 Hack KVM by exiting to QEMU on split lock #AC, we

[PULL 58/61] i386/kvm: Drop KVM_CAP_X86_SMM check in kvm_arch_init()

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li x86_machine_is_smm_enabled() checks the KVM_CAP_X86_SMM for KVM case. No need to check KVM_CAP_X86_SMM in kvm_arch_init(). So just drop the check of KVM_CAP_X86_SMM to simplify the code. Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20250729062014.1669578-3-xiaoyao

[PULL 08/61] cpus: document that qemu_cpu_kick() can be used for BQL-less operation

2025-09-13 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- include/hw/core/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 23bd02277f4..8b57bcd92c9 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h

[PULL 04/61] target-arm: remove uses of cpu_interrupt() for user-mode emulation

2025-09-13 Thread Paolo Bonzini
Arm leaves around some functions that use cpu_interrupt(), even for user-mode emulation when the code is unreachable. Pull out the system-mode implementation to a separate file, and add stubs for CONFIG_USER_ONLY. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/arm/inter

[PULL 45/61] rust/hpet: drop now unneeded qemu_api dep

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-18-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/Cargo.lock| 1 - rust/hw/timer/hpet/Cargo.toml | 1 - rust/hw/timer/hpet/

[PULL 06/61] treewide: clear bits of cs->interrupt_request with cpu_reset_interrupt()

2025-09-13 Thread Paolo Bonzini
Open coding cpu_reset_interrupt() can cause bugs if the BQL is not taken, for example i386 has the call chain kvm_cpu_exec() -> kvm_put_vcpu_events() -> kvm_arch_put_registers(). Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo B

[PULL 39/61] rust: split "bql" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Unfortunately, an example had to be compile-time disabled, since it relies on higher level crates (qdev, irq etc). The alternative is probably to move that code to an example in qemu-api or elsewere and make a link to it, or include_str. Signed-off-by: Marc-André Lureau

[PULL 60/61] accel/kvm: Zero out mem explicitly in kvm_set_user_memory_region()

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li Zero out the entire mem explicitly before it's used, to ensure the unused feilds (pad1, pad2) are all zeros. Otherwise, it might cause problem when the pad fields are extended by future KVM. Fixes: ce5a983233b4 ("kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot") Signed-off-b

[PULL 41/61] rust: split "chardev" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-14-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/chardev/wrapper.h| 2

[PULL 44/61] rust: rename qemu_api_macros -> qemu_macros

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Since "qemu_api" is no longer the unique crate to provide APIs. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-17-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS

[PULL 11/61] accel/tcg: create a thread-kick function for TCG

2025-09-13 Thread Paolo Bonzini
Round-robin TCG is calling into cpu_exit() directly. In preparation for making cpu_exit() usable from all accelerators, define a generic thread-kick function for TCG which is used directly in the multi-threaded case, and through CPU_FOREACH in the round-robin case. Use it also for user-mode emula

[PULL 16/61] bsd-user, linux-user: introduce qemu_process_cpu_events

2025-09-13 Thread Paolo Bonzini
Add a user-mode emulation version of the function. More will be added later, for now it is just process_queued_cpu_work. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- bsd-user/aarch64/target_arch_cpu.h | 2 +- bsd-user/arm/target_arch_cpu.

[PULL 35/61] rust: split Rust-only "common" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-6-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/Cargo.lock

[PULL 53/61] hpet: guard IRQ handling with BQL

2025-09-13 Thread Paolo Bonzini
From: Igor Mammedov Commit [1] made qemu fail with abort: xen_evtchn_set_gsi: Assertion `bql_locked()' failed. when running ./tests/functional/x86_64/test_kvm_xen.py tests. To fix it make sure that BQL is held when manipulating IRQs. Fixes: 7defb58baf (hpet: switch to fine-grained device lock

[PULL 25/61] rust: add qdev Device derive macro

2025-09-13 Thread Paolo Bonzini
From: Manos Pitsidianakis Add derive macro for declaring qdev properties directly above the field definitions. To do this, we split DeviceImpl::properties method on a separate trait so we can implement only that part in the derive macro expansion (we cannot partially implement the DeviceImpl trai

[PULL 29/61] docs/rust: update msrv

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-2-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 2 +- rust/Cargo.toml | 1 + 2 files changed, 2 insertions(+), 1 delet

[PULL 28/61] rust: qdev: const_refs_to_static

2025-09-13 Thread Paolo Bonzini
Now that const_refs_static can be assumed, convert the members of the DeviceImpl trait from functions to constants. This lets the compiler know that they have a 'static lifetime, and removes the need for the weird "Box::leak()". Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/2025090810500

[PULL 07/61] cpu-common: use atomic access for interrupt_request

2025-09-13 Thread Paolo Bonzini
Writes to interrupt_request used non-atomic accesses, but there are a few cases where the access was not protected by the BQL. Now that there is a full set of helpers, it's easier to guarantee that interrupt_request accesses are fully atomic, so just drop the requirement instead of fixing them. R

[PULL 43/61] rust: split "hwcore" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-16-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/hw/core/wrapper.h| 3

[PULL 09/61] accel: use store_release/load_acquire for cross-thread exit_request

2025-09-13 Thread Paolo Bonzini
Reads and writes cpu->exit_request do not use a load-acquire/store-release pair right now, but this means that cpu_exit() may not write cpu->exit_request after any flags that are read by the vCPU thread. Probably everything is protected one way or the other by the BQL, because cpu->exit_request le

[PULL 33/61] rust: move VMState handling to QOM module

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau This will allow to split vmstate to a standalone crate next. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-9-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/qom.rs | 3

[PULL 50/61] docs: update rust.rst

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-23-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 61 - 1 file changed, 32 inse

[PULL 12/61] accel/tcg: inline cpu_exit()

2025-09-13 Thread Paolo Bonzini
Right now, cpu_exit() is not usable from all accelerators because it includes a TCG-specific thread kick. In fact, cpu_exit() doubles as the TCG thread-kick via tcg_kick_vcpu_thread(). In preparation for changing that, inline cpu_exit() into tcg_kick_vcpu_thread(). The direction of the calls can

[PULL 51/61] rust: meson: remove unnecessary complication in device crates

2025-09-13 Thread Paolo Bonzini
It is not necessary anymore to explicitly list procedural macro crates when doing the final link using rustc. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-33-pbonz...@redhat.com Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/mes

[PULL 01/61] target/ppc: limit cpu_interrupt_exittb to system emulation

2025-09-13 Thread Paolo Bonzini
It is not used by user-mode emulation and is the only caller of cpu_interrupt() in qemu-ppc* binaries. Reviewed-by: Igor Mammedov Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/ppc/helper_regs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/ppc/helper_reg

[PULL 05/61] user-exec: remove cpu_interrupt() stub

2025-09-13 Thread Paolo Bonzini
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/tcg/user-exec.c | 5 - 1 file changed, 5 deletions(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 748bfab04a7..66c25fba7dd 100644 --- a/accel/tcg/user-exec.c +++ b

[PULL 26/61] rust: vmstate: convert to use builder pattern

2025-09-13 Thread Paolo Bonzini
From: Zhao Liu Similar to MemoryRegionOps, the builder pattern has two advantages: 1) it makes it possible to build a VMStateDescription that knows which types it will be invoked on; 2) it provides a way to wrap the callbacks and let devices avoid "unsafe". Unfortunately, building a static VMSta

[PULL 57/61] i386/kvm: Get X86MachineState in kvm_arch_init() without the cast check

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li Commit 8f54bbd0b4d9 ("x86: Check for machine state object class before typecasting it") added back the object_dynamic_cast() check before casting MachineState to X86MachineState. And commit 035d1ef26565 ("i386: Add ratelimit for bus locks acquired in guest") followed it. The rea

[PULL 02/61] target/sparc: limit cpu_check_irqs to system emulation

2025-09-13 Thread Paolo Bonzini
It is not used by user-mode emulation and is the only caller of cpu_interrupt() in qemu-sparc* binaries. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/sparc/int32_helper.c | 2 ++ target/sparc/int64_helper.c | 2 ++ 2 files changed,

[PULL 22/61] meson, cargo: require Rust 1.83.0

2025-09-13 Thread Paolo Bonzini
Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-4-pbonz...@redhat.com Signed-off-by: Paolo Bonzini --- docs/about/build-platforms.rst | 15 --- docs/devel/rust.rst| 14 +- meson.build| 6 +++--- clippy.toml

[PULL 49/61] rust: re-export qemu macros from common/qom/hwcore

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau This is just a bit nicer. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-22-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 2 +- rust/Cargo.lock

[PULL 47/61] rust: repurpose qemu_api -> tests

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau The crate purpose is only to provide integration tests at this point, that can't easily be moved to a specific crate. It's also often a good practice to have a single integration test crate (see for ex https://github.com/rust-lang/cargo/issues/4867) Drop README.md, use d

[PULL 59/61] accel/kvm: Switch to check KVM_CAP_GUEST_MEMFD and KVM_CAP_USER_MEMORY2 on VM

2025-09-13 Thread Paolo Bonzini
From: Xiaoyao Li It returns more accruate result on checking KVM_CAP_GUEST_MEMFD and KVM_CAP_USER_MEMORY2 on VM instance instead of on KVM platform. Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20250728115707.1374614-2-xiaoyao...@intel.com Signed-off-by: Paolo Bonzini --- accel/k

[PULL 32/61] rust: move vmstate_clock!() to qdev module

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau This will allow to split vmstate to a standalone crate next. Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-8-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/qdev.rs| 3

[PULL 38/61] rust: split "migration" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-11-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/migration/wrapper.h

[PULL 31/61] rust: add workspace authors

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Link: https://lore.kernel.org/r/20250827104147.717203-4-marcandre.lur...@redhat.com Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/Cargo.toml b/rust/Cargo

[PULL 27/61] rust: vmstate: use const_refs_to_static

2025-09-13 Thread Paolo Bonzini
The VMStateDescriptionBuilder already needs const_refs_static, so use it to remove the need for vmstate_clock! and vmstate_struct!, as well as to simplify the implementation for scalars. If the consts in the VMState trait can reference to static VMStateDescription, scalars do not need the info_enu

[PULL 15/61] treewide: rename qemu_wait_io_event/qemu_wait_io_event_common

2025-09-13 Thread Paolo Bonzini
Do so before extending it to the user-mode emulators, where there is no such thing as an "I/O thread". Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- include/hw/core/cpu.h | 2 +- include/system/cpus.h | 4 ++-- accel/dummy-cpus.c| 2 +-

[PULL 19/61] tcg/user: do not set exit_request gratuitously

2025-09-13 Thread Paolo Bonzini
Whenever user-mode emulation needs to go all the way out of the cpu exec loop, it uses cpu_exit(), which already sets cpu->exit_request. Therefore, there is no need for tcg_kick_vcpu_thread() to set cpu->exit_request again outside system emulation. Reviewed-by: Igor Mammedov Signed-off-by: Paolo

[PULL 40/61] rust: split "qom" crate

2025-09-13 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250827104147.717203-13-marcandre.lur...@redhat.com Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + rust/qom/wrapper.h| 27 ++

[PULL 14/61] cpus: properly kick CPUs out of inner execution loop

2025-09-13 Thread Paolo Bonzini
Now that cpu_exit() actually kicks all accelerators, use it whenever the message to another thread is processed in qemu_wait_io_event(). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- cpu-common.c| 3 ++- hw/ppc/ppc.c| 2 ++ hw/ppc/spapr_hcall.c

[PULL 00/61] CPU, Rust, x86 changes for 2025-09-13

2025-09-13 Thread Paolo Bonzini
The following changes since commit 190d5d7fd725ff754f94e8e0cbfb69f279c82b5d: Merge tag 'pull-request-2025-09-09' of https://gitlab.com/thuth/qemu into staging (2025-09-11 12:41:01 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you t

[PULL 13/61] cpus: remove TCG-ism from cpu_exit()

2025-09-13 Thread Paolo Bonzini
Now that TCG has its own kick function, make cpu_exit() do the right kick for all accelerators. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/cpu-common.c | 4 +--- 1 file changed, 1 insertion(+), 3 delet

[PULL 17/61] cpus: clear exit_request in qemu_process_cpu_events

2025-09-13 Thread Paolo Bonzini
Make the code common to all accelerators: after seeing cpu->exit_request set to true, accelerator code needs to reach qemu_process_cpu_events_common(). So for the common cases where they use qemu_process_cpu_events(), go ahead and clear it in there. Note that the cheap qatomic_set() is enough bec