Commit Graph

126476 Commits

Author SHA1 Message Date
Pierrick Bouvier
cab15547f1 plugins: move qemu-plugin.h to include/plugins/
This change has two benefits:
- ensure plugins can't include anything else from QEMU than plugins API
- when compiling a C++ module, solves the header conflict with iostream
  header that includes transitively the wrong ctype.h, which already
  exists in include/qemu.

By Hyrum's law, there was already one usage of other headers with mem
plugin, which has been eliminated in previous commit.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-7-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
eb3f69cac6 tests/tcg/plugins/mem.c: remove dependency on qemu headers
This plugin uses endianness conversion primitives from QEMU headers. As
next commit will strongly isolate plugins code from those headers, those
primitives can't be used anymore.

glib.h provides such primitives:
https://docs.gtk.org/glib/conversion-macros.html#byte-order-conversion

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-6-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
1f2c0bd2ff plugins: define plugin API symbols as extern "C" when compiling in C++
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-5-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
ec48ee7866 plugins: use complete filename for defining plugins sources
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-4-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
e115d55110 plugins: factorize plugin dependencies and library details
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-3-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
3b781315cc plugins: move win32_linker.c file to plugins directory
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-2-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Florian Hofhammer
c22ea55b3b plugins: return bool from register r/w API
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>
2026-01-29 09:34:14 -08:00
Ziyang Zhang
948ffdd79b tcg tests: add a test to verify the syscall filter plugin API
Register a syscall filter callback in tests/tcg/plugins/sycall.c,
returns a specific value for a magic system call number, and check
it in tests/tcg/multiarch/test-plugin-syscall-filter.c.

Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn>
Co-authored-by: Mingyuan Xia <xiamy@ultrarisc.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
[Pierrick - Changed syscall number to 4096 to make it work with mips32]
[Pierrick - Skip test when compiling without plugins enabled]
Link: https://lore.kernel.org/qemu-devel/20251214144620.179282-3-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Ziyang Zhang
5ed628d1d3 linux-user: add plugin API to filter syscalls
This commit adds a syscall filter API to the TCG plugin API set.
Plugins can register a filter callback to QEMU to decide whether
to intercept a syscall, process it and bypass the QEMU syscall
handler.

Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn>
Co-authored-by: Mingyuan Xia <xiamy@ultrarisc.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
[Pierrick - move send_through_syscall_filters to linux-user/syscall.c]
Link: https://lore.kernel.org/qemu-devel/20251214144620.179282-2-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Pierrick Bouvier
d37ce14f98 linux-user: move user/syscall-trace.h to linux-user/syscall.c
For now, only linux-user supports plugin syscall API, so restrict the
scope of these functions to linux-user/syscall.c

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260129013134.3956938-7-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
0a9754525c contrib/plugins/hotblocks: Allow limit to be set as a command line argument
Also add documentation for this argument. This allows the default of 20
to be overridden, and is helpful for using the hotblocks plugin for
analysis scripts that require collecting data on a larger number of
blocks (e.g. setting limit=0 to dump information on all blocks).

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/58281d6e54bcad1802e8d3dc8d8501d54c2a971e.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
e4ed74c9ae docs/about/emulation: Add documentation for hotblocks plugin arguments
Currently just 'inline'.

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/35128cc5a86a0c18418f9d3150fb8771c54ef7d8.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
e777f6ab91 contrib/plugins/hotblocks: Print uint64_t with PRIu64 rather than PRId64
qemu_plugin_u64_sum returns a uint64_t, so PRIu64 is the correct format
specifier.

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/5d26c9d99ee87ac4a4034ff64e3d8881253eedf3.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
1c1e45fcd6 contrib/plugins/hotblocks: Fix off by one error in iteration of sorted blocks
The logic to iterate over the hottest blocks will never reach the last
item in the list, as it checks `it->next != NULL` before entering the
loop. It's hard to trigger this off-by-one error with the default
limit=20, but it is a bug and is problematic if that default is changed
to something larger.

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f1ba2e57c6126472c0c8310774009f2455efc370.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
90fabd5dda contrib/plugins/hotblocks: Correctly free sorted counts list
g_list_free should be passed the head of the list.

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/cf5a00136738b981a12270b76572e8d502daf208.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Richard Henderson
65fb9de488 Merge tag 'pr-build_fix-20260128' of https://gitlab.com/pbo-linaro/qemu into staging
Fix build with --enable-modules

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEZrmU7KFPfy5auggff5BUDQoc0A8FAml6uYIACgkQf5BUDQoc
# 0A+1fgv/VBYR4Svtjbpq9GmAzXYSdqI5WhbDTPMH0mC9dFoFHdpZL0hOiZnXkoXs
# fXLBJkB8zJPTE+f7q9FQS6LTTJVkazSE+EmuqnewQbL4mueEgK1ZZelg2aRmIBCg
# nyQFh+X+p3z6Kt7aErLX4W1tH4OySLrGEu+QCHoSiRBpEPuK9Qeb5chvS9GmEq5o
# 7UGE4eiJ9y3Q7uXx32xo36zaLSwEkUHURp8FVUVxg44z0xDH7JyiJetUQrdxHtWT
# DoAdJR+l1hIqCP60qyd9JZFNNm1QgGBI3D7b0A7GArc/Soa96ikWTpoPid3OK0qd
# l1FxnfacoFOmNKa9kbEtupDGBzs6n3lkjzJ13EgF3pmAvTYKk/efCZ58Or1GdsK8
# IJVPzVx979XrXEIzpNs3KxVvR21TiRQvpF4dOa3GBcHYw+EgFKGoo4sKboYV21CC
# wZDUM7w2iFZKNGr73VzLI+PZUqBSFdCmXGTVddgKFcibnjxizzTJgjz+C1urew9M
# 7E7R/XrT
# =wFh0
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 29 Jan 2026 12:36:02 PM AEDT
# gpg:                using RSA key 66B994ECA14F7F2E5ABA081F7F90540D0A1CD00F
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@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: 66B9 94EC A14F 7F2E 5ABA  081F 7F90 540D 0A1C D00F

* tag 'pr-build_fix-20260128' of https://gitlab.com/pbo-linaro/qemu:
  meson: fix build of qemu-system-microblaze with --enable-modules

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-29 13:29:33 +11:00
Pierrick Bouvier
8eff45dfe9 meson: fix build of qemu-system-microblaze with --enable-modules
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>
2026-01-28 17:35:52 -08:00
Richard Henderson
9ad7f544c6 Merge tag 'pull-request-2026-01-27' of https://gitlab.com/thuth/qemu into staging
* 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>
2026-01-28 10:04:17 +11:00
Richard Henderson
ea603cbe0b Merge tag 'pull-11.0-maintainer-updates-270126-1' of https://gitlab.com/stsquad/qemu into staging
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>
2026-01-28 10:03:57 +11:00
Richard Henderson
7ecd3f7107 Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* 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>
2026-01-28 10:03:37 +11:00
Thomas Huth
161ea5a634 tests/functional: Enforce sha256 as hashsum algorithm for all tests
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
f2981f9901 tests/vm: Make the haiku VM usable again
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
6f028a17a9 tests/vm: Update netbsd VM to version 10.1
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
e4f1a9b1da pc-bios/optionrom: Use 32-bit linker emulation for the optionroms
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
661a47ff1e tests/tracetool: Honor the Python interpreter that "configure" detected
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
b6c2c05a87 tests/functional/x86_64: Use the right Python interpreter & fix format string
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
ef325d0c87 tests/functional/x86_64: Limit the memlock test to Linux hosts
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>
2026-01-27 15:20:43 +01:00
Thomas Huth
b9a4553e29 tests/functional/riscv64: Silence warnings from Pylint in the boston test
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>
2026-01-27 15:20:43 +01:00
Daniel P. Berrangé
815567b4ea gitlab: preserve base rules for container template
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>
2026-01-27 15:20:35 +01:00
Pierrick Bouvier
74be6f8bc9 MAINTAINERS: add co-maintainer for TCG Plugins
I would like to help Alex to maintain TCG Plugins. We talked about it
and he will keep the priority for merging series, but I can occasionally
merge some of them when there is a special interest.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260115202511.2709767-1-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:37:35 +00:00
Alex Bennée
e813d3be36 MAINTAINERS: be realistic about *-user
Looking at the merges for the last year:

  $ git shortlog --merges --since "last year" *-user/ accel/tcg/user-exec* hw/core/cpu-user.c include/user/ scripts/qemu-binfmt-conf.sh scripts/update-syscalltbl.sh scripts/update-mips-syscall-args.sh tests/functional/arm/test_bflt.py tests/vm/*bsd

  Richard Henderson (4):
        Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
        Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
        Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
        Merge tag 'pull-tcg-20251019' of https://gitlab.com/rth7680/qemu into staging

  Stefan Hajnoczi (12):
        Merge tag 'linux-user-fix-gupnp-pull-request' of https://github.com/hdeller/qemu-hppa into staging
        Merge tag 'pull-10.0-testing-and-gdstub-updates-100225-1' of https://gitlab.com/stsquad/qemu into staging
        Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
        Merge tag 'pull-loongarch-20250424' of https://github.com/gaosong715/qemu into staging
        Merge tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru into staging
        Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
        Merge tag 'hppa-fpe-fixup-pull-request' of https://github.com/hdeller/qemu-hppa into staging
        Merge tag 'pull-target-arm-20250704' of https://gitlab.com/pm215/qemu into staging
        Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
        Merge tag 'pull-10.1-rc0-maintainer-140725-1' of https://gitlab.com/stsquad/qemu into staging
        Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging
        Merge tag 'accel-20250715' of https://github.com/philmd/qemu into staging

None of the pull requests have come through the maintainers and while
there are a fair number of commits overall they have been mostly bug
fixes, re-factoring clean-ups and the occasional new syscall/ioctl
handling.

We should reflect the current status so users don't have unrealistic
expectations of how quickly things can get reviewed and merged.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-ID: <20260123145750.1200879-9-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:37:35 +00:00
Pierrick Bouvier
ca25f18b5c MAINTAINERS: add reviewer for linux-user
I had interest in this area for some time, and would like to help
reviewing it.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260115201712.2706663-1-pierrick.bouvier@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260123145750.1200879-8-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:37:33 +00:00
Alex Bennée
8e61c618f4 MAINTAINERS: update Arm to Supported status
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>
2026-01-27 11:37:33 +00:00
Pierrick Bouvier
3889460440 MAINTAINERS: add maintainer for docs/
I would like to help maintaining qemu documentation and I've been
invited by Alex to apply as maintainer.

Files in docs/ that are already maintained will continue to be under
their respective maintainer. The goal here is to have someone that can
help on all other files that don't have an official maintainer.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260115203529.2713193-1-pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260123145750.1200879-6-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:37:30 +00:00
Mads Ynddal
2430b05fbe MAINTAINERS: remove myself as reviewer
My work has changed focus, and I do not have the time to continue.

Signed-off-by: Mads Ynddal <mads@ynddal.dk>
Message-ID: <20260121112725.40060-1-mads@ynddal.dk>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20260123145750.1200879-5-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:35:38 +00:00
Alex Bennée
a986231df0 MAINTAINERS: regularise the status fields
Orphaned isn't a state, Orphan is. Likewise all the other "Odd Fixes"
are capitalised so fix the ones that are not.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260123145750.1200879-4-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:35:38 +00:00
Alex Bennée
aca1cc9973 MAINTAINERS: fix libvirt entry
We have a particular tag for lists so lets use it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Message-Id: <20180716073226.21127-3-armbru@redhat.com>
Message-ID: <20260123145750.1200879-3-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:35:38 +00:00
Alex Bennée
2106da94dc MAINTAINERS: fix missing names
The form is Name <email> so lets fix that up before we enforce it.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20260123145750.1200879-2-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-27 11:35:38 +00:00
Mohd Kashif Khan
df8dfc3b60 rust/hpet: remove stale TODO comment
The irq binding is already implemented in the following line, so the TODO comment is obsolete.

Signed-off-by: Mohd Kashif Khan <kashif04x@gmail.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20260126210910.28889-1-kashif04x@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-01-27 10:37:11 +01:00
Paolo Bonzini
2a52067b06 target/i386/tcg: cleanup #ifdef TARGET_X86_64
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
5585d072c6 target/i386/tcg: replace havesib variable with the SIB byte itself
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
a1356c5677 target/i386/tcg: merge decode_modrm and decode_modrm_address split
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
30ebb65f83 target/i386/tcg: remove dead constants
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
d66532600f target/i386/tcg: fix typo in dpps/dppd instructions
Their gen_* functions were incorrectly named gen_VDDPS and gen_VDDPD.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
2eb8d97343 target/i386/tcg: fix a few instructions that do not support VEX.L=1
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
fe367cbe39 qdev: add hw/core/gpio.c to libhwcore
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
1713498c0d rust: move hwcore::sysbus to system crate
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>
2026-01-27 08:57:52 +01:00
Marc-André Lureau
c899071b5a rust: move binding generation to bindings/
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
f9bbbde1ed rust: move class_init to an extension trait
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>
2026-01-27 08:57:52 +01:00
Paolo Bonzini
e079272604 rust: hwcore: add chardev symbols to integration tests
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>
2026-01-27 08:57:52 +01:00