The qemu_plugin_{read,write} register API previously was inconsistent
with regard to its docstring (where a return value of both -1 and 0
would indicate an error) and to the memory read/write APIs, which
already return a boolean value to indicate success or failure.
Returning the number of bytes read or written is superfluous, as the
GByteArray* passed to the API functions already encodes the length.
See the linked thread for more details.
This patch moves from returning an int (number of bytes read/written) to
returning a bool from the register read/write API, bumps the plugin API
version, and adjusts plugins and tests accordingly.
Signed-off-by: Florian Hofhammer <florian.hofhammer@fhofhammer.de>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f877dd79-1285-4752-811e-f0d430ff27fe@fhofhammer.de
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
A previous commit wrongly skipped including the generated modinfo in
case hw_arch dictionary ends up being empty.
Fix that by adding an empty source set in dictionary in this case.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3280
Fixes: e8efe5ff4 (meson: Do not try to build module for empty per-target hw/ directory)
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
* gitlab: preserve base rules for container template
* Fix some issues to make QEMU compilable on non-mainstream distros again
* Enforce sha256 as hashsum algorithm for all functional tests
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCgAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAml4ytMRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbX8LQ//dceTUIF2Ynakhce4MZjsHzM9YZz86knw
# 3MK8172k05Vcb/e4vlsqLv/gJYAu1XlZRGsEjSfFBi11FSQMORV3c3QLm0MkSIzR
# 7L3Zt9YnwBMEdMjJ/3moLPegRvE1kE/Kaa5t/wWP/eh34jgsubcnALktw9K5vkBP
# B/gYMKP5ZgYM+3UyNvy3FmtNGz4+U8IeURzqmgYvZ87BkCfT4DAR8WWBgjasGRSZ
# MjOYsJwtVLnm1eSzZRiJKAwzLgsQMJOp3UJFvGSTYFgalM+YP/MoV4aia3ZyKr5H
# iZQfqTdvRnp2KIJKsOJIYop3do/xUylKDYCXxESF61QyFugrA9igZ9i4tTtLBTJf
# M6ZDqdJIZj2auU4Pps6DXDjcpZcOpnhTI3exg4aCLDdUZt9DsZrdjGYnM6rf0TeK
# g7Cr+TXHEt8nMTymH3NXZLPCOyzpBbOH7a6ZbblLkOhV/KSZaazBBzpoC3FHKdfu
# l61+wbre3JCNSLUyNRh2eH112N2JR/J3Yg/8CLcAgQjsJfko701nfnb+kC8eoVtP
# YTCZmPPrbaSzzNrEamDC3YafyX3/92Y9NLiS6oEeoOog2Fy69V5tF4HzOkA4riBx
# LVk6aLkScJYYM/MI4vUYhYnK3yu9u9ioDDQJfPYgPOj5ariON7AA6ftU/WZkW7xL
# EP7xytLZBUE=
# =vTKP
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 28 Jan 2026 01:25:23 AM AEDT
# 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-2026-01-27' of https://gitlab.com/thuth/qemu:
tests/functional: Enforce sha256 as hashsum algorithm for all tests
tests/vm: Make the haiku VM usable again
tests/vm: Update netbsd VM to version 10.1
pc-bios/optionrom: Use 32-bit linker emulation for the optionroms
tests/tracetool: Honor the Python interpreter that "configure" detected
tests/functional/x86_64: Use the right Python interpreter & fix format string
tests/functional/x86_64: Limit the memlock test to Linux hosts
tests/functional/riscv64: Silence warnings from Pylint in the boston test
gitlab: preserve base rules for container template
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
MAINTAINER updates
- fix some malformed entries (names, lists, status)
- drop Mads from HVF and Tracing reviews
- add Pierrick for overall docs catcher
- add Pierrick as a linux-user reviewer
- add Pierrick as a co-maintainer for plugins
- set linux-user to Odd Fixes
- update core Arm to "Supported"
# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAml4pGcACgkQ+9DbCVqe
# KkQA6wgAkkXh8ZfPmtqYurG75nAPT37t70OUyFxxf0/MmbvERzIuBrnl7AOxsKWt
# NGo0CnP/jD3hiC9f8ciUgp7XqS8xUMdbflkt7h/opoiD+72I6G1K7Z8IS6vIF++o
# xhGj6fOVQlVfib/wMFFSGbJ+W+Uii1zuX4N1dTT1xVMFs833aj6dQ3x2qHKXBO1S
# K2Hlj6kfcIOW0l85LK6SmpNnSlmK3seolXDcceQ6cqZtofjmrApLqIGuM4lyA6uG
# qNjKH3J2omFI7eUAvxu+xa/UT1zKJQFmH9f7qUKcXhHd5z7unIj/RrUEMRu/moge
# 3F7r7LCOJ5tJxZ86DdO52b2yf1nMEA==
# =CyCY
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 27 Jan 2026 10:41:27 PM AEDT
# 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-11.0-maintainer-updates-270126-1' of https://gitlab.com/stsquad/qemu:
MAINTAINERS: add co-maintainer for TCG Plugins
MAINTAINERS: be realistic about *-user
MAINTAINERS: add reviewer for linux-user
MAINTAINERS: update Arm to Supported status
MAINTAINERS: add maintainer for docs/
MAINTAINERS: remove myself as reviewer
MAINTAINERS: regularise the status fields
MAINTAINERS: fix libvirt entry
MAINTAINERS: fix missing names
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* rust: move binding generation to bindings/
* rust: fixes for Windows
* target/i386/tcg: fix a few instructions that do not support VEX.L=1
* target/i386/tcg: various cleanups
# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAml4h1QUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroP56Qf/cqjdwUO8GUNP5Og2s/D2wjiTeSTq
# 9oer3Jq2OUyh5zqt6oVXLjWIV6GOjaak9aSa8b23Ej4jC+Zjc0RRN9s6qXkCfvM7
# yrfQWnbIkkSmCWIp5stsqtXtE11wMWh25gjVNzj0tuPxNEzgYG8lyZT3/vgZ3B/o
# OO6s8HxNdgGrP5zeIMNeaF0OkdyF/JADv5NrKH57HYRyYE0ZMmn0G/RPxecyS7se
# W0KW7H6F6RqFPNf7W0Y9+uQjDttrinQ9Ni2+IIgZ9GaoIRloqslclmof9fxMizK9
# aqxuC8XmJkgF13V/9mLy+iZKO9fhlaCJ0CsxZqscmrzPNs7QWlJ3L9nDng==
# =4pTP
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 27 Jan 2026 08:37:24 PM AEDT
# gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [unknown]
# gpg: aka "Paolo Bonzini <pbonzini@redhat.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: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
rust/hpet: remove stale TODO comment
target/i386/tcg: cleanup #ifdef TARGET_X86_64
target/i386/tcg: replace havesib variable with the SIB byte itself
target/i386/tcg: merge decode_modrm and decode_modrm_address split
target/i386/tcg: remove dead constants
target/i386/tcg: fix typo in dpps/dppd instructions
target/i386/tcg: fix a few instructions that do not support VEX.L=1
qdev: add hw/core/gpio.c to libhwcore
rust: move hwcore::sysbus to system crate
rust: move binding generation to bindings/
rust: move class_init to an extension trait
rust: hwcore: add chardev symbols to integration tests
rust: trace: libc does not have syslog on windows
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
The functional testing framework currently supports both, sha256
and sha512 as hashsums for the assets. However, all but one test
currently only use sha256, which should also be sufficient according
to the current security standards. Having two algorithms around already
caused some confusion (e.g. the clean_functional_cache.py script only
supports sha256 right now), so standardize now on enforcing sha256
before more tests use a mix of the two algorithms.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260121101957.82477-1-thuth@redhat.com>
The haiku VM bitrotted in the course of time. Make sure to use the
latest version of the repositories here and install missing pieces
like "pip" and "tomli" now.
Since we nowadays also install our own version of meson in our venv,
this also requires a change to our configure script: On Haiku, the
meson binary shows up as pyvenv/non-packaged/bin/meson here, and not
in the expected location pyvenv/bin/meson. Adjust the "meson" variable
to point to that Haiku-specific location to fix this issue. See also:
https://github.com/haiku/haiku/blob/r1beta5/docs/user/storage/storageintro.dox
And finally, with the new toolchain from the beta 5, we also have to
compile with "-pie", otherwise the linker complains about bad relocations
in the object files, so allow compiling with PIE in the configure script
now.
Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260123184429.5278-1-thuth@redhat.com>
NetBSD 10.1 has been released since more than a year, so it's time to
update our VM to that version.
Apart from the usual changes in the installation process, we also have
to disable the installation of the "jpeg" package now, otherwise the
package installation fails with an error message like this:
pkg_add: jpeg-9fnb1: conflicts with `libjpeg-turbo-[0-9]*', and
`libjpeg-turbo-3.1.3' is installed.
We also have to drop the executable bits from scripts/qemu-plugin-symbols.py
to force meson to use the detected Python interpreter instead of executing
the file directly (which tries to use the Python interpreter from the file's
shebang line).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260113193554.123082-1-thuth@redhat.com>
Without this linker flag, the linking fails on NetBSD v10.1 with:
ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `multiboot_dma.o' is incompatible with i386:x86-64 output
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260121074819.29396-1-thuth@redhat.com>
The tracetool tests currently fail if the host installation does not
have a "python3" binary (and you compiled QEMU by selecting a different
one during the "configure" step). This happens because tracetool-test.py
executes scripts/tracetool.py directly, so that this script is run via
its shebang line. To fix the issue, use the same Python interpreter to
run scripts/tracetool.py as we are using to run the tracetool-test.py
script.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260115155318.37823-1-thuth@redhat.com>
The bad_vmstate test currently fails if the host does not have a "python3"
binary in $PATH because the vmstate-static-checker.py script is executed
directly, so that it gets run via its shebang line. Use the right Python
interpreter from sys.executable to fix this problem.
Additionally, there was another bug with the formatting of the error
message in case of failures: The "+" operator can only concatenate strings,
but not strings with integers. Use a proper format string here instead.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260114101101.36225-1-thuth@redhat.com>
The memlock test analyzes /proc/*/status files and expects the layout
from Linux in there. However, these files also exist on NetBSD hosts
with a completely different layout, causing this test to fail. Thus
limit the test to Linux hosts now. We already have a decorator to
skip a test if it is running on a certain host system, but in this
case, we rather want to skip if we are not running on a specific
host system, so introduce a new @skipUnlessOperatingSystem decorator
for this job.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260121111140.99482-1-thuth@redhat.com>
Pylint complains:
tests/functional/riscv64/test_boston.py:1:0: C0114:
Missing module docstring (missing-module-docstring)
tests/functional/riscv64/test_boston.py:95:8: C0415:
Import outside toplevel (subprocess.run, subprocess.PIPE) (import-outside-toplevel)
tests/functional/riscv64/test_boston.py:112:17: W1510:
'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
tests/functional/riscv64/test_boston.py:95:8: W0611:
Unused PIPE imported from subprocess (unused-import)
Rework the code a little bit to make the linter happy.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Chao Liu <chao.liu.zevorn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260116095615.269199-1-thuth@redhat.com>
When extending the container template to allow scheduled pipelines in
upstream context, we must ensure that all the existing rules defined
by .base_job_template are preserved.
Fortunately since the new rule for scheduled pipelines can come at
the head of all other rules, not in the middle, we can just the obscure
'!reference' syntax to pull in all the pre-existing rules as a single
block.
This fixes
* stable branches using the wrong tag name in container images
* pushes to forks unconditionally running container builds
Fixes: 8bec7b9874
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Fixes: 8bec7b9874 ("gitlab: add a weekly container building job")
Message-ID: <20260119135528.2738108-1-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
We are involved in lots of areas of the QEMU code base but as I'm sure
most developers will realise we are actively funded to support the Arm
ecosystem for both emulation and virtualisation use-cases. Lets make
that clear in MAINTAINERS to keep parity with the other Supported
architectures.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260123145750.1200879-7-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
32-bit TCG opcodes produced for the i386 target usually looks the same
as 64-bit TCG opcodes produced for the x86_64. The special one that
needs extensions is 32-bit TCG opcodes produced for the x86_64 target.
Make all #ifdefs look the same, like this:
case MO_32:
#ifdef TARGET_X86_64
/* code using 32-bit opcodes */
case MO_64:
#endif
/* code using target_long opcodes */
default:
g_assert_not_reached();
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Unlike the older code in translate.c, mod=11b *is* filtered out earlier
by decode_modrm, and it would have returned bogus code. Since the register
case is so simple, just inline decode_modrm_address into its caller instead
of removing the "if".
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
NB_OP_SIZES has been dead since the conversion to TCG, REG_L_OFFSET
since 2015, the others somewhere in the middle.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Match the contents of table 2-17 ("#UD Exception and VEX.L Field Encoding")
in the SDM, for instruction in exception class 5. They were incorrectly
accepting 256-bit versions that do not exist.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
While GPIO functionality is not used by user-mode emulation, it is
conceptually part of qdev - GPIO pins are included in DeviceState
independent of whether this is system or user-mode emulation.
For the Rust bindings, having GPIO functionality in system_ss causes
a problem because, for simplicity, all methods of DeviceState are
included in the Rust hwcore crate. On Windows, rustc is not able
to do dead code elimination as well as on other OSes and this causes
an undefined symbol error, because gpio.c is not linked into the
rust/hw/core/rust-hwcore-rs-integration test binary.
To fix it, move gpio.c out of system_ss and into libhwcore.
Alternatively, it would be possible to define some DeviceState
methods also in the system crate, using for example a separate trace
SystemDeviceMethods. For now, keep all the methods in one crate and
link 200 unused lines of code into user-mode emulators.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This inverts the dependency from hwcore to system, replacing it with
a dependency from system to hwcore. It also matches how hw/core/sysbus.h
is part of the system-sys crate, and hw/core/sysbus.c is part of system_ss
on the C side.
This fixes a linker error in hwcore integration tests on msys2.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Move raw FFI bindings generation to separate crates. This makes it
possible to reuse bindgen declarations for a header file in its
dependencies (this was not the case before this change), while keeping
multiple -sys crates to avoid rebuilding all the code whenever
something changes.
Because the -sys crates are generated in dependency order, this also
enforces that the crates are organized in something that resembles
the dependencies between C headers.
The meson.build for rust-safe crates becomes simpler, and it should be
possible in the future to let Meson's cargo support handle most of it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[General cleanup and Python script. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Prepare for having ObjectClass, DeviceClass and SysbusDeviceClass
defined outside the hwcore and qom crates. It then becomes
impossible to add a method to them.
Extracted from a patch by Marc-André Lureau.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Even though they are not used, rustc does not elide its symbols on msys2.
This causes a linker error.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>