]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
6 weeks agolinux-user: Move get_elf_hwcap to sh4/elfload.c
Richard Henderson [Mon, 28 Jul 2025 07:28:05 +0000 (21:28 -1000)] 
linux-user: Move get_elf_hwcap to sh4/elfload.c

Change the return type to abi_ulong, and pass in the cpu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_elf_hwcap to mips/elfload.c
Richard Henderson [Mon, 28 Jul 2025 07:23:05 +0000 (21:23 -1000)] 
linux-user: Move get_elf_hwcap to mips/elfload.c

Change the return type to abi_ulong, and pass in the cpu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_elf_hwcap to loongarch64/elfload.c
Richard Henderson [Mon, 28 Jul 2025 07:17:08 +0000 (21:17 -1000)] 
linux-user: Move get_elf_hwcap to loongarch64/elfload.c

Change the return type to abi_ulong, and pass in the cpu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move hwcap functions to ppc/elfload.c
Richard Henderson [Mon, 28 Jul 2025 07:12:54 +0000 (21:12 -1000)] 
linux-user: Move hwcap functions to ppc/elfload.c

Change the return type to abi_ulong, and pass in the cpu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_elf_hwcap to sparc/elfload.c
Richard Henderson [Mon, 28 Jul 2025 07:03:12 +0000 (21:03 -1000)] 
linux-user: Move get_elf_hwcap to sparc/elfload.c

Change the return type to abi_ulong, and pass in the cpu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move hwcap functions to {arm,aarch64}/elfload.c
Richard Henderson [Mon, 28 Jul 2025 06:52:01 +0000 (20:52 -1000)] 
linux-user: Move hwcap functions to {arm,aarch64}/elfload.c

For get_elf_hwcap and get_elf_hwcap2, change the return type to
abi_ulong, and pass in the cpu.  We must do these targets at the
same time because of the ifdef dependency between TARGET_AARCH64
and TARGET_ARM.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_elf_hwcap to {i386,x86_64}/elfload.c
Richard Henderson [Mon, 28 Jul 2025 06:34:19 +0000 (20:34 -1000)] 
linux-user: Move get_elf_hwcap to {i386,x86_64}/elfload.c

Change the return type to abi_ulong, and pass in the cpu.
Duplicate the one line function between i386 and x86_64,
as most other additions to elfload.c won't be common.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_elf_cpu_model to target/elfload.c
Richard Henderson [Tue, 29 Jul 2025 20:09:57 +0000 (10:09 -1000)] 
linux-user: Move get_elf_cpu_model to target/elfload.c

Rename from cpu_get_model to emphasize that this is an elf-specific
function.  Declare the function once in loader.h.

This frees up target_elf.h for other uses.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move ppc uabi/asm/elf.h workaround to osdep.h
Richard Henderson [Tue, 29 Jul 2025 23:40:15 +0000 (13:40 -1000)] 
linux-user: Move ppc uabi/asm/elf.h workaround to osdep.h

Move the workaround out of linux-user/elfload.c, so that
we don't have to replicate it in many places.  Place it
immediately after the include of <signal.h>, which draws
in the relevant symbols.

Note that ARCH_DLINFO is not defined by the kernel header,
and so there's no need to undef it either.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Create target/elfload.c files
Richard Henderson [Tue, 29 Jul 2025 18:03:41 +0000 (08:03 -1000)] 
linux-user: Create target/elfload.c files

Prepare to split the main linux-user/elfload.c.
Create empty files for each target, and add the common build rule.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agosemihosting: Initialize heap once per process
Richard Henderson [Sat, 2 Aug 2025 00:25:12 +0000 (10:25 +1000)] 
semihosting: Initialize heap once per process

While semihosting isn't really thread aware, the current
implementation allocates space for the heap per-thread.

Remove the heap_base and heap_limit fields from TaskState.
Replace with static variables within do_common_semihosting.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agosemihosting: Retrieve stack top from image_info
Richard Henderson [Sat, 2 Aug 2025 00:12:01 +0000 (10:12 +1000)] 
semihosting: Retrieve stack top from image_info

Remove the write-once field TaskState.stack_base, and use the
same value from struct image_info.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agoMerge tag 'pull-request-2025-08-27' of https://gitlab.com/thuth/qemu into staging
Richard Henderson [Wed, 27 Aug 2025 09:11:08 +0000 (19:11 +1000)] 
Merge tag 'pull-request-2025-08-27' of https://gitlab.com/thuth/qemu into staging

* Add v10.2 compat machines
* Move functional tests to target specific subfolders
* Fix some issues in functional tests

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCgAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmiuuP0RHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVMEA//egQiaWsMquQan7D8RWt7TkD2deY2L5Dx
# D/pkO3xGA1hxCzD37ptGfFw2NO6cVpH8cjOevrJYUwW1Yefbsf8HqUlC7PrqDjTw
# +ztyIPSl7ny3xQxif+1Oc2rmt6MCNCQTw9CLdB0k3D1jr7aY0Z20JrxFrQmExhOe
# oSqiILYwiZGfNI4jiQSBYtBVpKrqwCQ+gEs6HyqayQOczaYynHvt8Gqwyp/DpKpY
# bfBcqbREK8zYTMMRYl5d/qcJpWgVtCj5OeqDQyhLMSgNt9fGmdKMzjK5Wzgl18gX
# 8A9tFK8KreXXLu1UfJWe+/kFAHMWhEWMkOv81Z/gqB4Zmp/eMioKlGDwVBU//PPm
# VFigfAPtqBqvOiuJo673ze2AOWMGROtLyZ9nyfv8/MZcQqoYLtvfZMUa08/M74/w
# TRSsBMGKk3H2O/prrXjFHK8q0aRXB2Ld3to0TyZOwlB17rhaD5jq/P8ge2UgGRGb
# fSghUKGmBAHueZyUdlCer+TEzH8ySl5zmotfiDeQfIYkwQ6rWUQZfehLxoycuHvr
# Kl3ZU6RD7fD2kCzRbvUOsyg0H3pihVvzcCL5BMxbGQ1sqZ+WI1dWPoOaUrZ9EvOg
# lQtsNMiu2i7bVqaJ27zNR4V3nwU77f/f+6zJwyXtD+6Wb+bFcQu5aYfgjqOr/Tlv
# zEVoqp5pRU4=
# =pSMT
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 27 Aug 2025 05:51:25 PM AEST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [unknown]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [unknown]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2025-08-27' of https://gitlab.com/thuth/qemu: (31 commits)
  tests/functional: Mark main in QemuBaseTest class as a static method
  MAINTAINERS: Adjust wildcards for the migration, multiprocess and replay tests
  tests/functional: Move the generic tests to a subfolder
  tests/functional: Move xtensa tests into target-specific folder
  tests/functional: Move x86_64 tests into target-specific folder
  tests/functional: Move sparc/sparc64 tests into target-specific folders
  tests/functional: Move sh4/sh4eb tests into target-specific folders
  tests/functional: Move s390x tests into target-specific folders
  tests/functional: Move rx test into target-specific folders
  tests/functional: Move riscv32/riscv64 tests into target-specific folders
  tests/functional: Move ppc/ppc64 tests into target-specific folders
  tests/functional: Move or1k tests into target-specific folders
  tests/functional: Move mips tests into target-specific folders
  tests/functional: Move microblaze tests into architecture specific folder
  tests/functional: Move m68k tests into architecture specific folder
  tests/functional: Move loongarch64 tests into architecture specific folder
  tests/functional: Move i386 tests into architecture specific folder
  tests/functional: Move hppa tests into architecture specific folder
  tests/functional: Move avr tests into architecture specific folder
  tests/functional: Move arm tests into architecture specific folder
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agotests/functional: Mark main in QemuBaseTest class as a static method
Gustavo Romero [Tue, 19 Aug 2025 14:39:15 +0000 (14:39 +0000)] 
tests/functional: Mark main in QemuBaseTest class as a static method

The main() method in the QemuBaseTest class has no parameters but is
defined as a regular method. Currently, this does not cause any issues
because in the functional tests main() is always called directly from
QemuBaseTest (never from instances), but the way this method is defined
makes its signature wrong, implying a 'self'. Hence, it's best practice
to define such a method as a static method, so decorate it with
@staticmethod.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-ID: <20250819143916.4138035-4-gustavo.romero@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
6 weeks agoMAINTAINERS: Adjust wildcards for the migration, multiprocess and replay tests
Thomas Huth [Tue, 19 Aug 2025 11:24:02 +0000 (13:24 +0200)] 
MAINTAINERS: Adjust wildcards for the migration, multiprocess and replay tests

Now that we moved the tests into subfolders, we have to adjust the
wildcards accordingly.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-26-thuth@redhat.com>

6 weeks agotests/functional: Move the generic tests to a subfolder
Thomas Huth [Tue, 19 Aug 2025 11:24:01 +0000 (13:24 +0200)] 
tests/functional: Move the generic tests to a subfolder

This also removes the line for using tests from the main folder
since we do not have any tests left here. And while we're at it,
also mark the vnc test as generic now since it is not specific to x86.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-25-thuth@redhat.com>

6 weeks agotests/functional: Move xtensa tests into target-specific folder
Thomas Huth [Tue, 19 Aug 2025 11:24:00 +0000 (13:24 +0200)] 
tests/functional: Move xtensa tests into target-specific folder

The tests/functional folder has become quite crowded, thus move the
xtensa tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-24-thuth@redhat.com>

6 weeks agotests/functional: Move x86_64 tests into target-specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:59 +0000 (13:23 +0200)] 
tests/functional: Move x86_64 tests into target-specific folder

The tests/functional folder has become quite crowded, thus move the
x86_64 tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-23-thuth@redhat.com>

6 weeks agotests/functional: Move sparc/sparc64 tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:58 +0000 (13:23 +0200)] 
tests/functional: Move sparc/sparc64 tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
sparc tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-22-thuth@redhat.com>

6 weeks agotests/functional: Move sh4/sh4eb tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:57 +0000 (13:23 +0200)] 
tests/functional: Move sh4/sh4eb tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
sh4 tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-21-thuth@redhat.com>

6 weeks agotests/functional: Move s390x tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:56 +0000 (13:23 +0200)] 
tests/functional: Move s390x tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
s390x tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-20-thuth@redhat.com>

6 weeks agotests/functional: Move rx test into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:55 +0000 (13:23 +0200)] 
tests/functional: Move rx test into target-specific folders

Move the architecture specific test into an architecture specific
subdirectory.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-19-thuth@redhat.com>

6 weeks agotests/functional: Move riscv32/riscv64 tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:54 +0000 (13:23 +0200)] 
tests/functional: Move riscv32/riscv64 tests into target-specific folders

The opensbi test is used for both, riscv32 and riscv64. Copy the main
test to the riscv64 folder and add a simple wrapper to the riscv32
folder to be able to run it for that target, too.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-18-thuth@redhat.com>

6 weeks agotests/functional: Move ppc/ppc64 tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:53 +0000 (13:23 +0200)] 
tests/functional: Move ppc/ppc64 tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
ppc and ppc64 tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-17-thuth@redhat.com>

6 weeks agotests/functional: Move or1k tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:52 +0000 (13:23 +0200)] 
tests/functional: Move or1k tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
openrisc tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-16-thuth@redhat.com>

6 weeks agotests/functional: Move mips tests into target-specific folders
Thomas Huth [Tue, 19 Aug 2025 11:23:51 +0000 (13:23 +0200)] 
tests/functional: Move mips tests into target-specific folders

The tests/functional folder has become quite crowded, thus move the
mips tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-15-thuth@redhat.com>

6 weeks agotests/functional: Move microblaze tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:50 +0000 (13:23 +0200)] 
tests/functional: Move microblaze tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
microblaze tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-14-thuth@redhat.com>

6 weeks agotests/functional: Move m68k tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:49 +0000 (13:23 +0200)] 
tests/functional: Move m68k tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
m68k tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-13-thuth@redhat.com>

6 weeks agotests/functional: Move loongarch64 tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:48 +0000 (13:23 +0200)] 
tests/functional: Move loongarch64 tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
loongarch64 tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-12-thuth@redhat.com>

6 weeks agotests/functional: Move i386 tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:47 +0000 (13:23 +0200)] 
tests/functional: Move i386 tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
i386 tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-11-thuth@redhat.com>

6 weeks agotests/functional: Move hppa tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:46 +0000 (13:23 +0200)] 
tests/functional: Move hppa tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
avr tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-10-thuth@redhat.com>

6 weeks agotests/functional: Move avr tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:45 +0000 (13:23 +0200)] 
tests/functional: Move avr tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
avr tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-9-thuth@redhat.com>

6 weeks agotests/functional: Move arm tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:44 +0000 (13:23 +0200)] 
tests/functional: Move arm tests into architecture specific folder

The tests/functional folder has become quite crowded, thus move the
arm tests into a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-8-thuth@redhat.com>

6 weeks agotests/functional: Move alpha tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:43 +0000 (13:23 +0200)] 
tests/functional: Move alpha tests into architecture specific folder

The tests/functional folder has become quite crowded already, some
restructuring would be helpful here. Thus move the alpha tests into
a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-7-thuth@redhat.com>

6 weeks agotests/functional: Move aarch64 tests into architecture specific folder
Thomas Huth [Tue, 19 Aug 2025 11:23:42 +0000 (13:23 +0200)] 
tests/functional: Move aarch64 tests into architecture specific folder

The tests/functional folder has become quite crowded already, some
restructuring would be helpful here. Thus move the aarch64 tests into
a target-specific subfolder.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-6-thuth@redhat.com>

6 weeks agotests/functional/meson.build: Allow tests to reside in subfolders
Thomas Huth [Tue, 19 Aug 2025 11:23:41 +0000 (13:23 +0200)] 
tests/functional/meson.build: Allow tests to reside in subfolders

We are going to move target-specific tests to subfolders that are
named after the target (and generic tests will be put into a "generic"
folder), so prepare the meson.build file to allow such locations, too.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-5-thuth@redhat.com>

6 weeks agotests/functional/meson.build: Split timeout settings by target
Thomas Huth [Tue, 19 Aug 2025 11:23:40 +0000 (13:23 +0200)] 
tests/functional/meson.build: Split timeout settings by target

We are going to move these settings into target-specific subfolders.
As a first step, split the big test_timeouts array up into individual
ones.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-4-thuth@redhat.com>

6 weeks agotests/functional: Rework the multiprocess test to have target-specific files
Thomas Huth [Tue, 19 Aug 2025 11:23:39 +0000 (13:23 +0200)] 
tests/functional: Rework the multiprocess test to have target-specific files

We are going to move the tests for each target into separate subdirectories.
The multiprocess test currently contains code for both, x86 and aarch64,
so it does not quite fit into this scheme. Rework the test to have a common
test class, and target specific files with a target specific class, so
that this will fit better into the new scheme.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-3-thuth@redhat.com>

6 weeks agotests/functional: Rework the migration test to have target-specific files
Thomas Huth [Tue, 19 Aug 2025 11:23:38 +0000 (13:23 +0200)] 
tests/functional: Rework the migration test to have target-specific files

We are going to move the tests for each target into separate subdirectories.
The migration test does not fit quite into this scheme, since it works
for multiple targets, but not all. Rework the test to have a common
test class, and target specific files with a target specific class, so
that this will fit better into the new scheme.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250819112403.432587-2-thuth@redhat.com>

6 weeks agotests/functional: Use more fine-grained locking when looking for free ports
Thomas Huth [Thu, 21 Aug 2025 09:47:35 +0000 (11:47 +0200)] 
tests/functional: Use more fine-grained locking when looking for free ports

Currently, we have one lock that is held while a test is looking for
free ports. However, we are also using different ranges for looking
for free ports nowadays (PORTS_START is based on the PID of the process),
so instead of using only one lock, we should rather use a lock per
range instead. This should help to allow running more tests in parallel.

While we're at it, also create the lock files without executable bit
(mode is 0o777 by default).

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250821094735.804210-1-thuth@redhat.com>

6 weeks agotests/functional: Fix reverse_debugging asset precaching
Gustavo Romero [Wed, 27 Aug 2025 00:10:08 +0000 (00:10 +0000)] 
tests/functional: Fix reverse_debugging asset precaching

This commit fixes the asset precaching in the reverse_debugging test on
aarch64.

QemuBaseTest.main() precaches assets (kernel, rootfs, DT blobs, etc.)
that are defined in variables with the ASSET_ prefix. This works because
it ultimately calls Asset.precache_test(), which relies on introspection
to locate these variables.

If an asset variable is not named with the ASSET_ prefix, precache_test
cannot find the asset and precaching silently fails. Hence, fix the
asset precaching by fixing the asset variable name.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-ID: <20250827001008.22112-1-gustavo.romero@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
6 weeks agotests/functional/test_aarch64_virt_gpu: Skip test if EGL won't initialize
Peter Maydell [Tue, 26 Aug 2025 12:34:55 +0000 (13:34 +0100)] 
tests/functional/test_aarch64_virt_gpu: Skip test if EGL won't initialize

If you are using the Nvidia drivers and have installed new versions
of those packages but have not yet rebooted the host kernel,
attempting to use the egl-headless display will cause QEMU to fail to
start with

$ qemu-system-aarch64 -M virt -display egl-headless
qemu-system-aarch64: egl: eglInitialize failed: EGL_NOT_INITIALIZED
qemu-system-aarch64: egl: render node init failed

together with this complaint in the host kernel dmesg:

[7874777.555649] NVRM: API mismatch: the client has the version 535.247.01, but
                 NVRM: this kernel module has the version 535.230.02.  Please
                 NVRM: make sure that this kernel module and all NVIDIA driver
                 NVRM: components have the same version.

This isn't a problem with QEMU itself, so reporting this as a test
failure is misleading.  Instead skip the tests, as we already do for
various other kinds of "host system can't actually run the EGL
display" situation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20250826123455.2856988-1-peter.maydell@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
6 weeks agoCI: Use mingw-w64-x86_64-curl-winssl instead of mingw-w64-x86_64-curl for Windows...
Stefan Weil [Wed, 6 Aug 2025 20:09:09 +0000 (22:09 +0200)] 
CI: Use mingw-w64-x86_64-curl-winssl instead of mingw-w64-x86_64-curl for Windows build

mingw-w64-x86_64-curl-winssl is required for https connections.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20250806200909.507803-1-sw@weilnetz.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
6 weeks agohw: add compat machines for 10.2
Cornelia Huck [Tue, 5 Aug 2025 09:56:16 +0000 (11:56 +0200)] 
hw: add compat machines for 10.2

Add 10.2 machine types for arm/i440fx/m68k/q35/s390x/spapr.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20250805095616.1168905-1-cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
6 weeks agoOpen 10.2 development tree
Stefan Hajnoczi [Tue, 26 Aug 2025 18:10:25 +0000 (14:10 -0400)] 
Open 10.2 development tree

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 weeks agoUpdate version for the v10.1.0 release v10.1.0
Stefan Hajnoczi [Tue, 26 Aug 2025 15:23:27 +0000 (11:23 -0400)] 
Update version for the v10.1.0 release

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 weeks agoUpdate version for the v10.1.0-rc4 release v10.1.0-rc4
Stefan Hajnoczi [Tue, 19 Aug 2025 14:39:59 +0000 (10:39 -0400)] 
Update version for the v10.1.0-rc4 release

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 weeks agoRevert "i386/cpu: Warn about why CPUID_EXT_PDCM is not available"
Paolo Bonzini [Tue, 19 Aug 2025 15:02:35 +0000 (17:02 +0200)] 
Revert "i386/cpu: Warn about why CPUID_EXT_PDCM is not available"

This reverts commit 00268e00027459abede448662f8794d78eb4b0a4.
(The only conflict is in the !is_tdx_vm() part of the condition,
which is safe to keep).

mark_unavailable_features() actively blocks usage of the feature,
so it is a functional change, not merely a emitting warning.
The commit was intended to merely warn if PDCM was enabled when
the performance counters are not, so revert it.

Reported-by: Christian A. Ehrhardt <christian.ehrhardt@canonical.com>
Analyzed-by: Daniel P. Berrangé <berrange@redhat.com>
Analyzed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20250819150235.785559-1-pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8 weeks agoMerge tag 'uefi-20250812-pull-request' of https://gitlab.com/kraxel/qemu into staging
Stefan Hajnoczi [Wed, 13 Aug 2025 19:19:29 +0000 (15:19 -0400)] 
Merge tag 'uefi-20250812-pull-request' of https://gitlab.com/kraxel/qemu into staging

hw/uefi: last-minute bug fixes for the uefi variable store [for 10.1]

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmibENYACgkQTLbY7tPo
# cTi2vQ/9FlAPZTZ/z/D5dfDHLhB06esVe6qd7LuI7rV3/6bUB+g+LYwoJI40SVMq
# Q5YDsQGX0muhzsE343XYMXIcz8yxUEvALpvFVW6e5pg92Q2g1aeHeJaxsaiPdbo2
# gG9WU3paCOQzRK488fUe8ed6Gkqmu6SLDwuAtQ5D9UXZ7qCSfy2Rr8/Li9Qs5JCJ
# StLccRvK6G72S+ESYDo/O1Q1P0CdpgJXuOV+75NdYZn4e7G0GUXN52l1U3fH0JZZ
# sSqoo4TgMjrchEhE4YrXNm/UFrhLpn+uv1Xhyv6UuLpLLWlSU/5EeARS7mGjMGbp
# z3Np11LrqtbB9fxxrxf75OLzya2aKBVUlmuh/HCP1wLNx7kxYpT4yyjsywXkksQ3
# TV2dMknDHm0JRf/i2DJuS6bDZlbehfu+1KkR25+0h/QSd2tK9Ct/ZxO59QcR02Kt
# ecvSzRfFG8+jTVorwVguftDyRe4b/qpFn4X7KujlkKvLiOA4lZ8NZsIFi0x2FGeA
# efdLRVEaDRJBmblcykPR+NYAyxcwGdHYerOsbf/vnRlCAsNQw1oofqTSU6qxnjnH
# hDF+fGBVQ2drjTfb5aFdLpQ4Fq9yD+x9fdpshT8IzqIdsJDKrlPYZK4ueSBF4A3V
# 32N2ZumxH17bvE44WkclJ0aog25M2+dgs5OJvqjcYY5VllEMTis=
# =Ntwr
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Aug 2025 06:00:54 EDT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'uefi-20250812-pull-request' of https://gitlab.com/kraxel/qemu:
  hw/uefi: open json file in binary mode
  hw/uefi: check access for first variable
  hw/uefi: return success for notifications
  hw/uefi: clear uefi-vars buffer in uefi_vars_write callback

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoUpdate version for the v10.1.0-rc3 release v10.1.0-rc3
Stefan Hajnoczi [Tue, 12 Aug 2025 20:26:39 +0000 (16:26 -0400)] 
Update version for the v10.1.0-rc3 release

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging
Stefan Hajnoczi [Tue, 12 Aug 2025 20:26:05 +0000 (16:26 -0400)] 
Merge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging

Patches for QEMU 10.1.0-rc3

- configure: Don't disable Rust for too old meson version
- rbd: Fix hang in query-named-block-nodes if the server is down
- iotests: Fix reference output for newer bash versions

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCgAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmiblrYRHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9Z3UQ//Xl3LZP4ZHScc16X4vDhH/4eru9Yu5zz/
# k2kWqmns6aClUZXplfWPKnM5a47b/23ZiM7MaxhgTolShtFPAODP0dDxAaPJSCJD
# EjhMbTB8u4GeMCe7T4HqGY/UHcGDWGzD9Ne5ssxt8yRT3fkuM/XxTptlIT93Rz9w
# bjTuCnctP6pGWW3za67bUdr9ZzwpmMXvXwpcXrlhKCqq+qbpHK8/rTp2yaNF5Pi9
# 3K+uITLOVk04UL1JbSgXgvId5JSBDE0JnPDFPhhkAcliQJKR3W3iWhIKwA4rvnZ5
# dzAMNk3TafzUsZp+k9gPXdQ/+km3Hj17vyHLEoEk0cPVoNi+ZbpKCij15O6OPKAn
# OP6aznanat8W8hQh+2lv29fLyYICZpXbsEGB7X7Kfz4uf4BhhopHHvq6SOnZwO14
# MaUjVEO7kBWHgXH3o8PzyHsZq7oWQdEZuKhcnemMb5+6ngLoGX1N1zZUGAcuaar+
# 31rePhgWprdOfZEW9X46i6AKff3xWHl5yQ9jQMPZWNwiYXNemh4oZXSYsgVbvNHd
# g73d/4G5iUt61fg6CtyqFDDa4/1WP0jU4164p6kcvYJVj1HaKy3FrAVrOfINbFFy
# dX3jCECkd52ilBwWisDWSWUqh2S09LJrn7O7FZUwYySivINuajZWwJYuDdxRvyc6
# q7Qg7ocWaQ8=
# =goPX
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Aug 2025 15:32:06 EDT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* tag 'for-upstream' of git://repo.or.cz/qemu/kevin:
  qemu-iotests: Ignore indentation in Killed messages
  rbd: Fix .bdrv_get_specific_info implementation
  configure: Don't disable Rust for too old meson version

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoui/spice: Destroy the temporary egl fb after the blit is submitted
Vivek Kasireddy [Fri, 18 Jul 2025 23:40:39 +0000 (16:40 -0700)] 
ui/spice: Destroy the temporary egl fb after the blit is submitted

The temporary egl fb scanout_tex_fb is only needed to facilitate the
blit to the display surface's texture (ssd->ds->texture). Therefore,
destroy it after the blit is submitted. And, also make sure that it
is empty initialized before it is actually used.

Fixes: f851cd65 ("ui/spice: Blit the scanout texture if its memory layout is not linear")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20250718234039.2266704-1-vivek.kasireddy@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoreadthedocs: don't build extra formats
Alex Bennée [Mon, 4 Aug 2025 16:29:59 +0000 (17:29 +0100)] 
readthedocs: don't build extra formats

We don't build the PDFs ourselves for the hosted docs and it looks
like rtd can't manage building PDFs now they have gone over a certain
size. Disable the extra formats so we can at least have the online
stuff again.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20250804162959.330060-1-alex.bennee@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'sdmmc-20250812' of https://github.com/philmd/qemu into staging
Stefan Hajnoczi [Tue, 12 Aug 2025 18:59:32 +0000 (14:59 -0400)] 
Merge tag 'sdmmc-20250812' of https://github.com/philmd/qemu into staging

SD/MMC patches queue

- Return noise (dummy byte) when no SD card connected over SPI

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmibcbsACgkQ4+MsLN6t
# wN5DkA/9F9lOPelfONSvAkZ4IkahoTaulYglQHxePbYvCopufx7RiM5yigmVrcGW
# I6MhGf9PtD4nlQ6Zl8ZUcr+WHMZQJaCcizdtzDsWR597to1z+ylbgoQqlhZi3gEX
# V6mOl5peS2LZ0nZ5WQpMs9kNUTTGahTagqkBRLWTCuTVZF/UAyXGFGK+9U3c4vu+
# iOS8XMkfACg2Df51Jj4cnyMmjjYoJgoQliGueaiOTyNEL0Euq18t/FiaL1C6X9+i
# rraagCq9s4rVLeh3KTZSz4ywKHticNtsXpHXGzlBIRJbxGCv7rV4GOehzjHdDcgq
# H7zpv9l7J4bBr9uY6m8SHP0WkxKE/B+g261h6mIg3PNjyamjrwWnoX9IYU4wPaVu
# +JUaxqU24HUyVi5r//h5pCASQPCl0MhtrsDHQSvClaiXVcCu8dBfiFxR5+tDuCaO
# An6ORL+Rd5S5dS36XQZr+CnmLCfnlr10auPq4tQ+L32VcPWjqHp+70+yM4DVtPfq
# sFb1O5ChQEsCzk9laO7OLqDqf8zJ5T4n21/i83vH/QGOi4+NRFIJoncGfXmHW/GW
# OzAE1S3LRDVBq+RA66so4y30i83H2CCZNqjRkXCoa+680P0MP5aUSxNhS7T3dN6u
# Er3QXkZQPeQDtVTCbslXnEtJ7drU6Jtfj4ZPTanua9TpCotAnb4=
# =4VWG
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 12 Aug 2025 12:54:19 EDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'sdmmc-20250812' of https://github.com/philmd/qemu:
  tests/functional: Test SPI-SD adapter without SD card connected
  hw/sd/ssi-sd: Return noise (dummy byte) when no card connected

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agomkvenv: Support pip 25.2
Sv. Lockal [Mon, 11 Aug 2025 19:01:59 +0000 (15:01 -0400)] 
mkvenv: Support pip 25.2

Fix compilation with pip-25.2 due to missing distlib.version

Bug: https://gitlab.com/qemu-project/qemu/-/issues/3062

Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
[Edits: Type "safety" whackamole --js]
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250811190159.237321-1-jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotests/functional: Test SPI-SD adapter without SD card connected
Philippe Mathieu-Daudé [Fri, 8 Aug 2025 13:45:34 +0000 (15:45 +0200)] 
tests/functional: Test SPI-SD adapter without SD card connected

SPI-SD adapter should be usable, even without any SD card
wired. Refactor test_riscv64_sifive_u_mmc_spi() to make it
more generic and add another test, inspired by this report:
https://lore.kernel.org/qemu-devel/5b2dc427-f0db-4332-a997-fe0c82415acd@roeck-us.net/

Inspired-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250812140415.70153-3-philmd@linaro.org>

2 months agohw/sd/ssi-sd: Return noise (dummy byte) when no card connected
Philippe Mathieu-Daudé [Fri, 8 Aug 2025 12:57:44 +0000 (14:57 +0200)] 
hw/sd/ssi-sd: Return noise (dummy byte) when no card connected

Commit 1585ab9f1ba ("hw/sd/sdcard: Fill SPI response bits in card
code") exposed a bug in the SPI adapter: if no SD card is plugged,
we are returning "there is a card with an error". This is wrong,
we shouldn't return any particular packet response, but the noise
shifted on the MISO line. Return the dummy byte, otherwise we get:

  qemu-system-riscv64: ../hw/sd/ssi-sd.c:160: ssi_sd_transfer: Assertion `s->arglen > 0' failed.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 775616c3ae8 ("Partial SD card SPI mode support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250812140415.70153-2-philmd@linaro.org>

2 months agoqemu-iotests: Ignore indentation in Killed messages
Werner Fink [Wed, 6 Aug 2025 06:54:51 +0000 (08:54 +0200)] 
qemu-iotests: Ignore indentation in Killed messages

New bash 5.3 uses a different padding for reporting job status.

Resolves: boo#1246830
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3050
Signed-off-by: Werner Fink <werner@suse.de>
Message-ID: <aJL8RH8ePPNEteMg@boole.nue2.suse.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 months agorbd: Fix .bdrv_get_specific_info implementation
Kevin Wolf [Mon, 11 Aug 2025 13:40:10 +0000 (15:40 +0200)] 
rbd: Fix .bdrv_get_specific_info implementation

qemu_rbd_get_specific_info() has at least two problems:

The first is that it issues a blocking rbd_read() call in order to probe
the encryption format for the image while querying the node. This means
that if the connection to the server goes down, not only I/O is stuck
(which is unavoidable), but query-names-block-nodes will actually make
the whole QEMU instance unresponsive. .bdrv_get_specific_info
implementations shouldn't perform blocking operations, but only return
what is already known.

The second is that the information returned isn't even correct. If the
image is already opened with encryption enabled at the RBD level, we'll
probe for "double encryption", i.e. if the encrypted data contains
another encryption header. If it doesn't (which is the normal case), we
won't return the encryption format. If it does, we return misleading
information because it looks like we're talking about the outer level
(the encryption format of the image itself) while the information is
about an encryption header in the guest data.

Fix this by storing the encryption format in BDRVRBDState when the image
is opened (and we do blocking operations anyway) and returning only the
stored information in qemu_rbd_get_specific_info().

The information we'll store is either the actual encryption format that
we enabled on the RBD level, or if the image is unencrypted, the result
of the same probing as we previously did when querying the node. Probing
image formats based on content that can be modified by the guest has
long been known as problematic, but as long as we only output it to the
user instead of making decisions based on it, it should be okay. It is
undoubtedly useful in the context of 'qemu-img info' when you're trying
to figure out which encryption options you have to use to open the
image successfully.

Fixes: 42e4ac9ef5a6 ("block/rbd: Add support for rbd image encryption")
Buglink: https://issues.redhat.com/browse/RHEL-105440
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250811134010.81787-1-kwolf@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 months agoconfigure: Don't disable Rust for too old meson version
Kevin Wolf [Mon, 11 Aug 2025 14:29:23 +0000 (16:29 +0200)] 
configure: Don't disable Rust for too old meson version

If the user explicitly specified --enable-rust, don't just fail if meson
is too old for Rust support, but do the same thing as if meson was too
old for the C code: Just download a newer one.

In order to avoid the additional download for people who aren't
intentionally opting in to Rust, keep the automatic disabling based on
the meson version as the default if neither --enable-rust nor
--disable-rust were given.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250811142923.89983-1-kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 months agohw/uefi: open json file in binary mode
Gerd Hoffmann [Mon, 11 Aug 2025 13:01:10 +0000 (15:01 +0200)] 
hw/uefi: open json file in binary mode

Fixes file length discrepancies due to line ending conversions
on windows hosts.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3058
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20250811130110.820958-4-kraxel@redhat.com>

2 months agohw/uefi: check access for first variable
Gerd Hoffmann [Mon, 11 Aug 2025 13:01:09 +0000 (15:01 +0200)] 
hw/uefi: check access for first variable

When listing variables (via get-next-variable-name) only the names of
variables which can be accessed will be returned.  That check was
missing for the first variable though.  Add it.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20250811130110.820958-3-kraxel@redhat.com>

2 months agohw/uefi: return success for notifications
Gerd Hoffmann [Mon, 11 Aug 2025 13:01:08 +0000 (15:01 +0200)] 
hw/uefi: return success for notifications

Set status to SUCCESS for ready-to-boot and exit-boot-services
notification calls.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20250811130110.820958-2-kraxel@redhat.com>

2 months agohw/uefi: clear uefi-vars buffer in uefi_vars_write callback
Mauro Matteo Cascella [Mon, 11 Aug 2025 10:11:24 +0000 (12:11 +0200)] 
hw/uefi: clear uefi-vars buffer in uefi_vars_write callback

When the guest writes to register UEFI_VARS_REG_BUFFER_SIZE, the .write
callback `uefi_vars_write` is invoked. The function allocates a
heap buffer without zeroing the memory, leaving the buffer filled with
residual data from prior allocations. When the guest later reads from
register UEFI_VARS_REG_PIO_BUFFER_TRANSFER, the .read callback
`uefi_vars_read` returns leftover metadata or other sensitive process
memory from the previously allocated buffer, leading to an information
disclosure vulnerability.

Fixes: CVE-2025-8860
Fixes: 90ca4e03c27d ("hw/uefi: add var-service-core.c")
Reported-by: ZDI <zdi-disclosures@trendmicro.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Message-ID: <20250811101128.17661-1-mcascell@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 months agoMerge tag 'pull-nvme-20250811' of https://gitlab.com/birkelund/qemu into staging
Stefan Hajnoczi [Mon, 11 Aug 2025 16:57:55 +0000 (12:57 -0400)] 
Merge tag 'pull-nvme-20250811' of https://gitlab.com/birkelund/qemu into staging

nvme queue

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmiZmYQACgkQTeGvMW1P
# DenI0wf9GPov0a82A2F23UTU+R8NC/NASBovEfPRTz7/J9fGL844ID3G6uT4emFP
# wAilGmMbNuPHKAtII4holCximP/7yosVZJIIdjLsRBBP9AZqpMHkr27VBny9rklZ
# X7TW6zI8INIjdqvRlIBevH5t5By/qLiaDc6GzRWJ3PoeXE6SKACDi0lNBsn75xah
# IbcHi72c96CwYJCEtOHXBs+zECo1yGDhK0OPvs/s7OykuRcOumF21IzuY958bVs/
# 7dJZkTL+oarZHIvKiUrErKK3gWfSrLeaWrR6sW1QNuOhzEeNHk47w86p+CEQ7CrU
# w0ioEaZ9awXk7wnZeY//CpUKFbsmwQ==
# =Qfvu
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 11 Aug 2025 03:19:32 EDT
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* tag 'pull-nvme-20250811' of https://gitlab.com/birkelund/qemu:
  hw/nvme: cap MDTS value for internal limitation
  hw/nvme: revert CMIC behavior
  hw/nvme: fix namespace attachment

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'pull-vfio-20250810' of https://github.com/legoater/qemu into staging
Stefan Hajnoczi [Mon, 11 Aug 2025 16:57:43 +0000 (12:57 -0400)] 
Merge tag 'pull-vfio-20250810' of https://github.com/legoater/qemu into staging

vfio queue:

* Add documentation for the use-legacy-x86-rom property
* Preserve pending VFIO interrupts during CPR

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmiYwgkACgkQUaNDx8/7
# 7KH5ew//ThaCgYlT2KwwJFfNUw290uQuvZAZUCB0vx+zhsQzQW5vzAx6KvFO+UQu
# k64BQLk8OV97tDpsEcnZEUoPfLo/05mxlcSKYfG3rTpp+ZxoCXUBhQ9f0ZR9t2gz
# WihHrA+g/r69VlcW9fCdar/n2svvysmY2OzybSAILplmJlk5CsJRB4cbpy09AR70
# t70bWGl+4+voENeVQjdYa35588bjwTdnzpOqy7fbFacs6L17NzaW30lJ8S8AWX8W
# a84nnuJgL2qkR73EvY1wL10EyqqR6gYCsbE39ARf4GoC8UE0cRp7tSXm/xkFd6U1
# I6Wv/7zx9FkKq51b8GB9n8NfW9U3XTTfJSS6QR6GYU77zcukUj06Fr5PNLEg9yOf
# 9dfrPt6pap1vx4xuoq9IqrwOVcKd9e9vi9hARLonlzcLMXZqJnKr3KcelcCcF8El
# Sf994H1izHjr1PqpKCDn7dDJ5Bp7CkvnR9RSCzRssovDzfRBmSI5iC75vpjcEd9z
# zMpKG1auyamlpjyFIBOw3rlMXSkv4vk0wmjv/P5aQxKTlu0Oyyp4dZMPl7C4Grut
# WmXJao6zrcUsxvxf2pi2aELGKzLow240Xh4oceD+dDyLQ6Z25J5aj/4MUWxXbbUT
# YffunKYQ00Bk5+x0gp7tiitNu9s4Z2ezshqebweBxNGHWMiJ5sI=
# =lM1W
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 10 Aug 2025 12:00:09 EDT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-vfio-20250810' of https://github.com/legoater/qemu:
  vfio: Document 'use-legacy-x86-rom' property
  vfio/pci: preserve pending interrupts
  vfio/pci: augment set_handler

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotests/functional: fix URLs in PCI hotplug test for aarch64
Stefan Hajnoczi [Mon, 11 Aug 2025 16:23:15 +0000 (12:23 -0400)] 
tests/functional: fix URLs in PCI hotplug test for aarch64

Debian trixie has been released. The "stable" alias no longer refers to
the Debian bookworm release, so URLs referring to bookworm artifacts via
the "stable" alias no longer work.

Switch to explicit release naming ("bookworm") to make a permalink so
the test passes again.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 374a245573b8 ("tests/functional: Add PCI hotplug test for aarch64")
Resolves: #3073 ("PCI hotplug test for aarch64 fails due to broken Debian installer URL")
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20250811162315.59997-1-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agohw/nvme: cap MDTS value for internal limitation
Keith Busch [Fri, 1 Aug 2025 14:24:57 +0000 (07:24 -0700)] 
hw/nvme: cap MDTS value for internal limitation

The emulated device had let the user set whatever max transfers size
they wanted, including no limit. However the device does have an
internal limit of 1024 segments. NVMe doesn't report max segments,
though. This is implicitly inferred based on the MDTS and MPSMIN values.

IOV_MAX is currently 1024 which 4k PRPs can exceed with 2MB transfers.
Don't allow MDTS values that can exceed this, otherwise users risk
seeing "internal error" status to their otherwise protocol compliant
commands.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 months agohw/nvme: revert CMIC behavior
Klaus Jensen [Tue, 3 Jun 2025 12:59:06 +0000 (14:59 +0200)] 
hw/nvme: revert CMIC behavior

Commit cd59f50ab017 ("hw/nvme: always initialize a subsystem") causes
the controller to always set the CMIC.MCTRS ("Multiple Controllers")
bit. While spec-compliant, this is a deviation from the previous
behavior where this was only set if an nvme-subsys device was explicitly
created (to configure a subsystem with multiple controllers/namespaces).

Revert the behavior to only set CMIC.MCTRS if an nvme-subsys device is
created explicitly.

Reported-by: Alan Adamson <alan.adamson@oracle.com>
Fixes: cd59f50ab017 ("hw/nvme: always initialize a subsystem")
Reviewed-by: Alan Adamson <alan.adamson@oracle.com>
Tested-by: Alan Adamson <alan.adamson@oracle.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 months agohw/nvme: fix namespace attachment
Klaus Jensen [Tue, 3 Jun 2025 12:59:05 +0000 (14:59 +0200)] 
hw/nvme: fix namespace attachment

Commit 6ccca4b6bb9f ("hw/nvme: rework csi handling") introduced a bug in
Namespace Attachment, causing it to

  a) not allow a controller to attach namespaces to other controllers
  b) assert if a valid non-attached namespace is detached

This fixes both issues.

Fixes: 6ccca4b6bb9f ("hw/nvme: rework csi handling")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2976
Reviewed-by: Jesper Wendel Devantier <foss@defmacro.it>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 months agoMerge tag 'pull-qapi-2025-08-09' of https://repo.or.cz/qemu/armbru into staging
Stefan Hajnoczi [Sat, 9 Aug 2025 17:50:05 +0000 (13:50 -0400)] 
Merge tag 'pull-qapi-2025-08-09' of https://repo.or.cz/qemu/armbru into staging

QAPI patches for 2025-08-09

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmiW4TgSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTuQEP+waO/E590BU0LIBUoZZbi5/xYY0mavtn
# oMn7dtJZGdjV4c247/YghuwhVvPTmNdPsTTsvf1T/Q1SSXmuAgW3vTtsaG/NzbBy
# gJMkvjNOBN5ihI+3cIDC95w8l1e93Wg6YcHsPKQh/NYoBSoy5Kk+QJctcO2Y1R66
# f/9rxaVBAjnWEmCGrP9acJnsTvxWIwmk+E6ABhlt24DCYG1Wjp8CgTrLqveqi8Fx
# lmhVF0XuHgnkwsItj6mnSAnj60SVQjT6F7iaAO8L+4UxHhO+LzXIQiTjdgBHppfJ
# llakFeFLKDulBvRnsnxxrT1CkO1apMfrNkua8JCwHzQAxikuhhkgV1QTIlXQXa7A
# hBE/5VQ5Jev+W6rzM6hmYl0HByKjKB23bQK7j8m8logV9OJCw+1Scsn2kgFX7rWL
# PLIyp63auXnt+vX29+T80KYu+qGi4o9BcQIr44myq/nIuAgcE7eEz7r6y0N66OiQ
# cvShDvd9YO0v8JtPbtUZAeUEyjLOEiYaExBJIAY98r0XFtxlroT8C7o8kjYlQX1K
# K5mv1Xs9y4J8kgxRjveYDosFbJAW4EOkypDc1tV50WV7f83kHRFUx340u+pnX3AI
# vmB/2KIftlt3bDVbJrJkWdbNshJyG4YBsfkzi7WScn/2BnpboNNzk8yKKkGOxrOl
# NQ3QQbUj4Gid
# =RYBV
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 09 Aug 2025 01:48:40 EDT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-qapi-2025-08-09' of https://repo.or.cz/qemu/armbru:
  docs/devel/qapi-code-gen: Update cross-reference syntax
  docs/devel/qapi-code-gen: Fix typos in QAPI schema language grammar
  docs/devel/qapi-code-gen: Add two cross-references we missed

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agodocs/devel/qapi-code-gen: Update cross-reference syntax
Markus Armbruster [Thu, 31 Jul 2025 05:40:44 +0000 (07:40 +0200)] 
docs/devel/qapi-code-gen: Update cross-reference syntax

The new QAPI code generator creates a cross-reference target for each
definition documentation.  Enabled for the QEMU QMP Reference manual
in commit a377f39f38f, and for the QEMU Storage Daemon QMP Reference
Manual and the QEMU Guest Agent Protocol Reference in commit
a6af5443440.  We've put these targets to use since, but neglected to
update doc comment markup documentation.  Do that now.

Co-developed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250731054044.4011789-4-armbru@redhat.com>

2 months agodocs/devel/qapi-code-gen: Fix typos in QAPI schema language grammar
Markus Armbruster [Thu, 31 Jul 2025 05:40:43 +0000 (07:40 +0200)] 
docs/devel/qapi-code-gen: Fix typos in QAPI schema language grammar

Fixes: 3248c1aaf2db (docs: update the documentation upfront about schema configuration)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250731054044.4011789-3-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2 months agodocs/devel/qapi-code-gen: Add two cross-references we missed
Markus Armbruster [Thu, 31 Jul 2025 05:40:42 +0000 (07:40 +0200)] 
docs/devel/qapi-code-gen: Add two cross-references we missed

Missed in commit 9c66762a601 (docs/qapi-code-gen: add
cross-references).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250731054044.4011789-2-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2 months agovfio: Document 'use-legacy-x86-rom' property
Cédric Le Goater [Tue, 5 Aug 2025 06:55:43 +0000 (08:55 +0200)] 
vfio: Document 'use-legacy-x86-rom' property

Commit 350785d41d8b ("ramfb: Add property to control if load the
romfile") introduced the `use-legacy-x86-rom` property for the
`vfio-pci-nohotplug` device. Add documentation for the property.

Fixes: d5fcf0d960d8 ("hw/i386: Add the ramfb romfile compatibility")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20250805065543.120091-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agovfio/pci: preserve pending interrupts
Steve Sistare [Wed, 16 Jul 2025 18:06:09 +0000 (11:06 -0700)] 
vfio/pci: preserve pending interrupts

cpr-transfer may lose a VFIO interrupt because the KVM instance is
destroyed and recreated.  If an interrupt arrives in the middle, it is
dropped.  To fix, stop pending new interrupts during cpr save, and pick
up the pieces.  In more detail:

Stop the VCPUs. Call kvm_irqchip_remove_irqfd_notifier_gsi --> KVM_IRQFD to
deassign the irqfd gsi that routes interrupts directly to the VCPU and KVM.
After this call, interrupts fall back to the kernel vfio_msihandler, which
writes to QEMU's kvm_interrupt eventfd.  CPR already preserves that
eventfd.  When the route is re-established in new QEMU, the kernel tests
the eventfd and injects an interrupt to KVM if necessary.

Deassign INTx in a similar manner.  For both MSI and INTx, remove the
eventfd handler so old QEMU does not consume an event.

If an interrupt was already pended to KVM prior to the completion of
kvm_irqchip_remove_irqfd_notifier_gsi, it will be recovered by the
subsequent call to cpu_synchronize_all_states, which pulls KVM interrupt
state to userland prior to saving it in vmstate.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/1752689169-233452-3-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agovfio/pci: augment set_handler
Steve Sistare [Wed, 16 Jul 2025 18:06:08 +0000 (11:06 -0700)] 
vfio/pci: augment set_handler

Extend vfio_pci_msi_set_handler() so it can set or clear the handler.
Add a similar accessor for INTx.  No functional change.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/1752689169-233452-2-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agoMerge tag 'pull-loongarch-20250808' of https://github.com/gaosong715/qemu into staging
Stefan Hajnoczi [Fri, 8 Aug 2025 13:49:06 +0000 (09:49 -0400)] 
Merge tag 'pull-loongarch-20250808' of https://github.com/gaosong715/qemu into staging

pul-loongarch-20250808

# -----BEGIN PGP SIGNATURE-----
#
# iLMEAAEIAB0WIQTKRzxE1qCcGJoZP81FK5aFKyaCFgUCaJVRCAAKCRBFK5aFKyaC
# Fn9TA/97BaWn3s3HlDy8HhIEereLJ1NWz9FGmYw2jBT77IVrpWeSSmUY3LapmHT0
# lVTrj4aCRlY5zjKn4xw8AQLACrNl2SL5brPXg4YMuwow062Akq/Ow+ooj3LHSlnX
# qXULIMi7hq3gPcmjLeR03AJjiSR2fgIjTzUN8RjangAS+PZ8/A==
# =ZQ4o
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 07 Aug 2025 21:21:12 EDT
# gpg:                using RSA key CA473C44D6A09C189A193FCD452B96852B268216
# gpg: Good signature from "Song Gao <gaosong@loongson.cn>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: CA47 3C44 D6A0 9C18 9A19  3FCD 452B 9685 2B26 8216

* tag 'pull-loongarch-20250808' of https://github.com/gaosong715/qemu:
  target/loongarch: Fix [X]VLDI raising exception incorrectly

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
Stefan Hajnoczi [Fri, 8 Aug 2025 13:46:17 +0000 (09:46 -0400)] 
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging

trivial patches for 2025-08-07

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmiVEtUACgkQgqpKJDse
# lHh6Lg/+MdkCRc9q+1lo2pQqu5AY3uWMVxCgHZSGgTkkBpSgp4AXgPU9AusOU7jd
# ZEKsmfHTiSodahE7+c6k09yzD+6FIBO3CTi502YPvzJ4Fmyd1Y5hWjUcG+lh9Qhs
# zDA4rg3Gfg8ecCZX9S4A0DAlLmgxCCnqJaGnJhv1sCYgmG1/jshTdpZbgxHDhxho
# 202yMqJagsWApTPmslEBgdBBC8cKUqd8+Lb9AYd+68As9mvCyLq8VbA4lPJ9sSgm
# PdeJzNdFSc5UNKbUe5AYghXeof++mBdKrvegIzRfCVtDkS64ermh2kL22iZI+9Ij
# nxgxYWQAYrsyF6d3vrRTVDWovAPEReu4j1VywOAbaQX6464EVnXDAeq+y9JOlZDs
# +d2pb1uyyFUqGh1A3OwSApyiGGOeMXxDxm77ixkFgf+WTPZ+BNOOrl/YootRxk87
# z7BmTqzycO2eRo6OGNh04LfEOTILhXtENy7NrS/dC2EG4+lgWuGOb3Cl4v1O6cE9
# E2cS7pqpihGyNTXai//USazr3Dh6NxmBsMEfZvWw/WMDy71kBx7XpKn4jv6Dnh+b
# wgg3CoLu9YeCdpmp1zb/g0wKEvFU41f2W1dR7BvCG18xtalr5zmFbdiDRwhnSwJh
# VW8k0XHcBXYHeBBqyrNglZ31alGq2UlmVG29LOzZyfFEVxz+HfM=
# =GrRa
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 07 Aug 2025 16:55:49 EDT
# gpg:                using RSA key 64AA2AB531D56903366BFEF982AA4A243B1E9478
# gpg: Good signature from "Michael Tokarev <mjt@debian.org>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@tls.msk.ru>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
#      Subkey fingerprint: 64AA 2AB5 31D5 6903 366B  FEF9 82AA 4A24 3B1E 9478

* tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu:
  meson: Fix brlapi compile test for Windows builds
  tests/qemu-iotests/tests/mirror-sparse: actually require O_DIRECT

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotarget/loongarch: Fix [X]VLDI raising exception incorrectly
WANG Rui [Mon, 4 Aug 2025 13:22:12 +0000 (21:22 +0800)] 
target/loongarch: Fix [X]VLDI raising exception incorrectly

According to the specification, [X]VLDI should trigger an invalid instruction
exception only when Bit[12] is 1 and Bit[11:8] > 12. This patch fixes an issue
where an exception was incorrectly raised even when Bit[12] was 0.

Test case:

```
    .global main
main:
    vldi    $vr0, 3328
    ret
```

Reported-by: Zhou Qiankang <wszqkzqk@qq.com>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-ID: <20250804132212.4816-1-wangrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
2 months agomeson: Fix brlapi compile test for Windows builds
Stefan Weil via [Wed, 6 Aug 2025 20:45:58 +0000 (22:45 +0200)] 
meson: Fix brlapi compile test for Windows builds

brlapi__openConnection returns a brlapi_fileDescriptor which is a pointer
for Windows builds.

The test for brlapi fails with cross builds on Debian trixie
(x86_64-w64-mingw32-gcc (GCC) 14-win32):

testfile.c:4:30: error: returning 'brlapi_fileDescriptor' {aka 'void *'} from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
    4 |      int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------
../../../meson.build:1607: WARNING: could not link brlapi, disabling

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2 months agotests/qemu-iotests/tests/mirror-sparse: actually require O_DIRECT
Michael Tokarev [Wed, 6 Aug 2025 07:48:37 +0000 (10:48 +0300)] 
tests/qemu-iotests/tests/mirror-sparse: actually require O_DIRECT

Commit c0ddcb2cbc146e introduced the test which uses cache=direct
mode, without checking if the scratch filesystem supports O_DIRECT.
A subsequent commit, afeb002e0ad49d, tried to fix that issue, but
instead of checking for o_direct, it checked for
`_supported_cache_modes none directsync`, which is not what the
original mirror-sparse test uses.  Fix both by actually checking
for o_direct.

Fixes: c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches"
Fixes: afeb002e0ad49d "tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported"
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2 months agoMerge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging
Stefan Hajnoczi [Thu, 7 Aug 2025 15:02:50 +0000 (11:02 -0400)] 
Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging

UI-fix for v10.1.0-rc3

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCgA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmiUez8cHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5RL+D/92hJRQpHex+m5JjJGW
# zpsIK1bbP+rN7waYN8YY+QpyJ8ihSvypT5tp/Qg4Q2SsGbLs1QuVrKsseDma/lVb
# DRV7JFS6FbLApOx/zvTWK88stKbbzHua93H3XQS2wHIkGYCBgZ/LlK0EIjniWCOP
# 2vfld0WT1FfUag6oiHO/s0fO3/uXep9RzCFAZguDd0WnU/i+qMH60Mwi35x4dIIy
# XqXDlYKUBEoYV8m3WuUtqq4otttm08/5ufkkME5rt3HjrWRjnCnAsvg4Rx4RQLuk
# /azEXVlFTS7FIxsjq2jLF+ZjUeysOHOLOZNKNV4h2bV+5/nvqaNxQqLt7pq+/k14
# gSv8CB1p/fxFfhnIg6x+QHEraZ25MfBafkZM7M5ocLlPPw9uAwu/5ZJBlD5vNO90
# imcDkzHGNWOYtzV03aiQ5o4jHsee/21hCiWo/XGhGfXVACxODI0RjYJwQQ7dsxqh
# yEFFwMO0Z8jxPrqDL5J6i+6/IrcMgqPlYmM8/9PqDo1yNBBhaMPc5JhFpxRDPoda
# suNEBXzbiR8s4CHZqcAH+8Sl7GT9s6DQOJCguOafXtHUeSa7Sr9TfNAn2X2vTEFC
# PNTcDIeXiDy/liep7gpW/W/51aNTPu651tq60ZlCzGa7Fl46KhF2ginSrOhAxMHm
# aGrQgkGdXWTnXlV9Awh3nJDdGw==
# =1aW6
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 07 Aug 2025 06:09:03 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  ui/curses: Fix infinite loop on windows

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoui/curses: Fix infinite loop on windows
William Hu [Thu, 3 Apr 2025 01:07:56 +0000 (01:07 +0000)] 
ui/curses: Fix infinite loop on windows

Replace -1 comparisons for wint_t with WEOF to fix infinite loop caused by a
65535 == -1 comparison.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2905
Signed-off-by: William Hu <purplearmadillo77@proton.me>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[ Marc-André - Add missing similar code change, remove a comment ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <tSO5to8--iex6QMThG3Z8ElfnNOUahK_yitw2G2tEVRPoMKV936CBdrpyfbeNpVEpziKqeQ1ShBwPOoDkofgApM8YWwnPKJR_JrPDThV8Bc=@proton.me>

2 months agoMerge tag 'migration-20250805-pull-request' of https://gitlab.com/farosas/qemu into...
Stefan Hajnoczi [Wed, 6 Aug 2025 20:56:26 +0000 (16:56 -0400)] 
Merge tag 'migration-20250805-pull-request' of https://gitlab.com/farosas/qemu into staging

Migration pull request

- Disable GNUTLS bug workaround

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmiSaOQQHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnakhD/4tpM3NvFiz0h+nDfkTU0ha5wzWz0eWAw1+
# utmaxuqta6hvKN34ZvfrAYXpnUhbvaGb5KT1sSo9+v81kSom2lnAjBxZl/jIQzPp
# zKnJaR8pnqBg9z9Gx22bZ68lekcnyez3gMRHOm8xtT7knwde9/7dEXl1dsWpE7Jw
# xewuJQg3YR3uuHBH7FWXY/6i8htOlw+kSmlkFEVMcH7qXqj5+QVaELo8M0SH4UNO
# eohmJv5nK9Z2B3lBUm0hj45EmjGWyuGUMdcVIVceNvsBDkdfmut3V8+h3qb2vPcn
# YJOaLZFu5JJevE+sy9fgVfgNVbIBxWF3Va4Sm3z7dBisZtsHmQl46If2ehXGJPN0
# n1qYDwW8QPepNfpnHmxh9lEXoBljLU2XfjLYdq0t5U0fIrYuI7R4a+c8Cs6h2oCn
# IdKXMMjGFMbw7uDPwTzUhgYqhwwaJ+RWA8h08Hv6/QwRrpF4dmaUi6b7uU6aFwQr
# OgtSM6S+0+/fKaLzHAZ3WypnrwhZXOlGodRDfYJFp5Q+84+R34nx0CRO9nZh5OYn
# 5wvQIMfUwZ6NbprG/4qwjzYhtAqZrE/yBV38XzFe3ajJI46LbHnNkMcbb70hviZH
# PiLTQX66u4ZWWeZZLJCrnaZW2NBr2STDzp0gqfVwPcZEdjP7drthoPCNkf85zF87
# zcRW1yzDYQ==
# =UPOe
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 05 Aug 2025 16:26:12 EDT
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'migration-20250805-pull-request' of https://gitlab.com/farosas/qemu:
  meson: remove 'gnutls-bug1717-workaround' for migration TLS crashes

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agomeson: remove 'gnutls-bug1717-workaround' for migration TLS crashes
Daniel P. Berrangé [Tue, 5 Aug 2025 18:24:31 +0000 (19:24 +0100)] 
meson: remove 'gnutls-bug1717-workaround' for migration TLS crashes

The implementation of this workaround does not currently work, so
remove the option entirely to avoid exposing it to users. The code
will remain (temporarily dormant) to be fixed in the next release
cycle.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20250805182431.504158-1-berrange@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agoUpdate version for the v10.1.0-rc2 release v10.1.0-rc2
Stefan Hajnoczi [Tue, 5 Aug 2025 19:05:57 +0000 (15:05 -0400)] 
Update version for the v10.1.0-rc2 release

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'hw-misc-20250805' of https://github.com/philmd/qemu into staging
Stefan Hajnoczi [Tue, 5 Aug 2025 19:05:28 +0000 (15:05 -0400)] 
Merge tag 'hw-misc-20250805' of https://github.com/philmd/qemu into staging

Misc HW patches

- Fix SD cards wired in SPI mode
- Fix microvm-only build by selecting Kconfig ACPI_PCI
- Fix legacy Intel SMT info removing 'x-vendor-cpuid-only-v2' property check

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmiSP8sACgkQ4+MsLN6t
# wN52pw//R2z+DDdtezzOGIsCS8lmcI+sp0rM2UXA0LLuqH4++/SNgSOuH/yr0k9g
# 3DxvYxQ+zgx2gxrxG9T/KlGYdl6lE3mb9cWBah8+4UUeKuji2Zt3dh0LrZoIt9A0
# EfHfPihpmVxf0OWXzDUsu3WdUyso3QHHJWVqiUCqnhvNsx1ZSAA7gOUOURL8YUEt
# BsCJ4ufRJA6SRqLgiOQHSn1zRVwEmXZWRt6lqWx45ynzxkquaA+pvGY3UlzUsw4b
# 5XyBL5Wyq1K7/FTXVXiMCYSNhgSUEbKy7Agnrr1i5s+/XfBjXMuzGFwjAWdCdwVW
# /Kqqndlu6COla9APndqjfMhCHU6Ql8KyKqb9HImvZyMks4QNiX3c18CjAuCVoIzE
# GxoXaTQ/y+Dv4tarI4EEP5m4P3gka7QVekhbSLQZJAdNDrt0QlOgmyvDLin4tQho
# ot/jXYTnbPZBfyZyecFnY/6Uszr5dcrI1bXdEYhiy3LZUWkzM2xNq9BJ6Y2495Ad
# ryqZ09UzVK8Rn6KaXTXx926eFWxFVN2VOolmLJ50D8MQfwrmMAsHtHl+qoa6T6Ta
# ezgnuHwONjNYAgGQgVz483/nKu4TvQ6q9bATYrZIumBITXLgVqS7GRFZ9Q17Y+V4
# UHlIJ/Ay32KkMAKD+cNj01s7g6nK3YS2tP7tt16IOQHhVmsNvGE=
# =Rq7l
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 05 Aug 2025 13:30:51 EDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'hw-misc-20250805' of https://github.com/philmd/qemu:
  hw/i386/microvm: Explicitly select ACPI_PCI
  target/i386/cpu: Move addressable ID encoding out of compat property in CPUID[0x1]
  tests/functional: Test SD cards in SPI mode (using sifive_u machine)
  hw/sd/sdcard: Remove SDState::mode field
  hw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CID
  hw/sd/sdcard: Factor spi_cmd_SEND_CxD() out
  hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states
  hw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI mode
  hw/sd/sdcard: Implement SPI R2 return value
  hw/sd/sdcard: Fill SPI response bits in card code
  hw/sd/sdbus: Provide buffer size to sdbus_do_command()
  hw/sd/sdcard: Factor sd_response_size() out
  hw/sd/sdcard: Do not ignore errors in sd_cmd_to_sendingdata()

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported
Michael Tokarev [Tue, 5 Aug 2025 18:17:30 +0000 (21:17 +0300)] 
tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

This test uses cache.direct=true, but does not check if O_DIRECT
is supported by the underlying filesystem, and fails, for example,
on a tmpfs (which is rather common on various auto-builders, in CI,
etc).

Fix this by using `_supported_cache_modes none directsync`.

Fixes: c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches"
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20250805181731.282677-1-mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoqga: correctly write to /sys/power/state on linux
Michael Tokarev [Fri, 1 Aug 2025 11:53:14 +0000 (14:53 +0300)] 
qga: correctly write to /sys/power/state on linux

Commit v9.0.0-343-g2048129625 introduced usage of
g_file_set_contents() function to write to /sys/power/state.
This function uses G_FILE_SET_CONTENTS_CONSISTENT flag to
g_file_set_contents_full(), which is implemented by creating
a temp file in the same directory and renaming it to the final
destination.  Which is not how sysfs works.

Here, there's not a big deal to do open/write/close - it becomes
almost the same as using g_file_set_contents[_full]().  But it
does not have surprises like this.

Also, since this is linux code, it should be ok to use %m in
the error reporting function.

Fixes: 2048129625 "qga/commands-posix: don't do fork()/exec() when suspending via sysfs"
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3057
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20250801115316.6845-1-mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agohw/i386/microvm: Explicitly select ACPI_PCI
Eric Auger [Mon, 4 Aug 2025 15:20:07 +0000 (17:20 +0200)] 
hw/i386/microvm: Explicitly select ACPI_PCI

With a microvm-only build based on a custom device config,
we get a link failure due to undefined reference to
build_pci_host_bridge_osc_method() which is defined in hw/acpi/pci.c and
whose compilation depends on CONFIG_ACPI_PCI. Although CONFIG_ACPI
and CONFIG_PCI are set with such configuration, implied CONFIG_ACPI_PCI
in config PCI_EXPRESS_GENERIC_BRIDGE is not selected as expected.

It Looks like CONFIG_ACPI_PCI must be enforced and this patch selects
CONFIG_ACPI_PCI in MICROVM config directly as done for PC config.

Reproducer:

../configure \
 --without-default-features \
 --target-list=x86_64-softmmu \
 --enable-kvm --disable-tcg \
 --enable-pixman \
 --enable-vnc \
 --audio-drv-list="" \
 --without-default-devices \
 --with-devices-x86_64=microvm \
 --enable-vhost-user

with configs/devices/x86_64-softmmu/microvm.mak:
CONFIG_PCI_DEVICES=n

CONFIG_MICROVM=y

CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_SERIAL=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_INPUT_HOST=y
CONFIG_VHOST_USER_INPUT=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_SCSI=y
CONFIG_VIRTIO_RNG=y
CONFIG_VIRTIO_CRYPTO=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_GPU=y
CONFIG_VHOST_USER_GPU=y

FAILED: qemu-system-x86_64
cc -m64 @qemu-system-x86_64.rsp
/usr/bin/ld: libsystem.a.p/hw_pci-host_gpex-acpi.c.o: in function `acpi_dsdt_add_host_bridge_methods':
hw/pci-host/gpex-acpi.c:83:(.text+0x274): undefined reference to `build_pci_host_bridge_osc_method'
collect2: error: ld returned 1 exit status

Fixes: af151d50eac24 "hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method"
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Message-ID: <20250804152008.247673-1-eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agotarget/i386/cpu: Move addressable ID encoding out of compat property in CPUID[0x1]
Zhao Liu [Mon, 4 Aug 2025 05:35:48 +0000 (13:35 +0800)] 
target/i386/cpu: Move addressable ID encoding out of compat property in CPUID[0x1]

Currently, the addressable ID encoding for CPUID[0x1].EBX[bits 16-23]
(Maximum number of addressable IDs for logical processors in this
physical package) is covered by vendor_cpuid_only_v2 compat property.
The previous consideration was to avoid breaking migration and this
compat property makes it unfriendly to backport the commit f985a1195ba2
("i386/cpu: Fix number of addressable IDs field for CPUID.01H.EBX
[23:16]").

However, NetBSD booting is broken since the commit 88dd4ca06c83
("i386/cpu: Use APIC ID info to encode cache topo in CPUID[4]"),
because NetBSD calculates smt information via `lp_max` / `core_max` for
legacy Intel CPUs which doesn't support 0xb leaf, where `lp_max` is from
CPUID[0x1].EBX.bits[16-23] and `core_max` is from CPUID[0x4].0x0.bits[26
-31].

The commit 88dd4ca0 changed the encoding rule of `core_max` but didn't
update `lp_max`, so that NetBSD would get the wrong smt information,
which leads to the module loading failure.

Luckily, the commit f985a1195ba2 ("i386/cpu: Fix number of addressable
IDs field for CPUID.01H.EBX[23:16]") updated the encoding rule for
`lp_max` and accidentally fixed the NetBSD issue too. This also shows
that using CPUID[0x1] and CPUID[0x4].0x0 to calculate HT/SMT information
is a common practice to detect CPU topology on legacy Intel CPUs.

Therefore, it's necessary to backport the commit f985a1195ba2 to
previous stable QEMU to help address the similar issues as well. Then
the compat property is not needed any more since all stable QEMUs will
follow the same encoding way.

So, in CPUID[0x1], move addressable ID encoding out of compat property.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Inspired-by: Chuang Xu <xuchuangxclwt@bytedance.com>
Fixes: commit f985a1195ba2 ("i386/cpu: Fix number of addressable IDs field for CPUID.01H.EBX[23:16]")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3061
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Message-ID: <20250804053548.1808629-1-zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoMerge tag 'pull-10.1-rc2-maintainer-040825-2' of https://gitlab.com/stsquad/qemu...
Stefan Hajnoczi [Tue, 5 Aug 2025 14:11:32 +0000 (10:11 -0400)] 
Merge tag 'pull-10.1-rc2-maintainer-040825-2' of https://gitlab.com/stsquad/qemu into staging

Testing and doc fixes

  - add information about patch submission with b4
  - fix make-release script to include all EDK submodules
  - fix debian-all-test-cross docker image

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmiQzlAACgkQ+9DbCVqe
# KkScxAf/dMJeC1SWwyXK/To44W0IMRNTKSisAksEVg5MeDAwxZkGjwh2einCyGne
# +Ac3KetXunswne3OOxBF24TyYwk6ITX1WSs2ViYI6qOKAehvKuweiTZSZiNUg9KB
# fSP4NTMrkk6sbD1fGjLWBOb/E84qoVOdoxW6Th0cnQxCX5WpaIcL84xvR4yOl37i
# nRisB36ZiO7ntMKRLU/yYffLq8gnRLQaYt/S17k6SlNTCQkL/rlYwpNwfvEaCwIX
# B3Nb6QveeNiyRdIP5TnmqSzu/OtIoJHe62pKcbHXpuDqynycnh/I+ML7nTbOHjWA
# tTDHjoLKo8be2jfYT14lkQbS11loHg==
# =lQIU
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 04 Aug 2025 11:14:24 EDT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-10.1-rc2-maintainer-040825-2' of https://gitlab.com/stsquad/qemu:
  tests/docker: fix debian-all-test-cross
  scripts/make-release: Go back to cloning all the EDK2 submodules
  docs/devel/submitting-a-patch.rst: add b4 section

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotests/functional: Test SD cards in SPI mode (using sifive_u machine)
Philippe Mathieu-Daudé [Wed, 30 Jul 2025 15:10:24 +0000 (17:10 +0200)] 
tests/functional: Test SD cards in SPI mode (using sifive_u machine)

Add a test which uses the sifive_u machine to boot a Linux
kernel from a SD card connected via a SPI interface.

Inspired from the command provided in:
- https://lore.kernel.org/qemu-devel/94b2c5bf-53d0-4c74-8264-f3021916f38c@roeck-us.net/
- https://lore.kernel.org/qemu-devel/840016d0-0d49-4ef4-8372-b62b3bcd0ac6@codethink.co.uk/

Inspired-by: Guenter Roeck <linux@roeck-us.net>
Inspired-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-12-philmd@linaro.org>

2 months agohw/sd/sdcard: Remove SDState::mode field
Philippe Mathieu-Daudé [Thu, 31 Jul 2025 09:44:28 +0000 (11:44 +0200)] 
hw/sd/sdcard: Remove SDState::mode field

SD card mode is a superset of its state (SDState::state),
no need to migrate it.

Use sd_mode() to get the SDCardModes from the SDCardStates.

Fixes: 50a5be6c3d5 ("hw/sd.c: add SD card save/load support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-11-philmd@linaro.org>

2 months agohw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CID
Philippe Mathieu-Daudé [Thu, 31 Jul 2025 13:58:31 +0000 (15:58 +0200)] 
hw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CID

The card should be in STANDBY mode to process SEND_CSD or SEND_CID,
but is still in IDLE mode.

Unfortunately I don't have enough time to keep debugging this issue,
so disable the check for the time being and the next release, as it
blocks Linux. I'll keep looking.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-10-philmd@linaro.org>

2 months agohw/sd/sdcard: Factor spi_cmd_SEND_CxD() out
Philippe Mathieu-Daudé [Thu, 31 Jul 2025 13:38:18 +0000 (15:38 +0200)] 
hw/sd/sdcard: Factor spi_cmd_SEND_CxD() out

spi_cmd_SEND_CSD() and spi_cmd_SEND_CID() are very
similar. Factor the common code as spi_cmd_SEND_CxD().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-9-philmd@linaro.org>

2 months agohw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states
Philippe Mathieu-Daudé [Thu, 31 Jul 2025 09:17:52 +0000 (11:17 +0200)] 
hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states

In SPI mode, SWITCH_FUNCTION is valid in all mode
(except the IDLE one).

Fixes: 775616c3ae8 ("Partial SD card SPI mode support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-8-philmd@linaro.org>

2 months agohw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI mode
Philippe Mathieu-Daudé [Wed, 30 Jul 2025 15:35:06 +0000 (17:35 +0200)] 
hw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI mode

While spi_cmd_SEND_OP_COND() is incomplete, sd_cmd_SEND_OP_COND()
is, except it doesn't return the correct value in SPI mode.
Correct and use, removing the need for spi_cmd_SEND_OP_COND().

Fixes: 775616c3ae8 ("Partial SD card SPI mode support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-7-philmd@linaro.org>

2 months agohw/sd/sdcard: Implement SPI R2 return value
Philippe Mathieu-Daudé [Tue, 29 Jul 2025 12:05:09 +0000 (14:05 +0200)] 
hw/sd/sdcard: Implement SPI R2 return value

In SPI mode, R2 is a 2-byte value.
Implement in spi_response_r2_make() and
return SPI R2 in the SEND_STATUS commands.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 775616c3ae8 ("Partial SD card SPI mode support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-6-philmd@linaro.org>