Commit Graph
3071 Commits
Author SHA1 Message Date
Zephyr Li 57b484e2d2 target/riscv: fix RV32 fixed counter accesses
Since commit cfc96df65e, riscv_pmu_ctr_get_fixed_counters_val()
returns the complete 64-bit fixed-counter value. The RV32 counter
access paths, however, still perform parts of the offset calculation
on separately extracted 32-bit halves.

In particular, riscv_pmu_write_ctrh() deposits the low 32 bits of the
complete fixed-counter value into the high half of mhpmcounter_prev.
riscv_pmu_read_ctr() also subtracts a 32-bit half of the previous value
from the complete 64-bit fixed-counter value. Consequently, writes to
mcycleh can be lost and carries between the low and high halves are not
handled correctly.

Keep the fixed-counter offset calculation entirely in 64 bits. Before
a running counter is partially written, materialize its current
architectural value and reset the fixed-counter baseline. On reads,
calculate the complete 64-bit counter value before extracting the half
requested by RV32.

Register RV32 system TCG tests with the Meson build. Add a test for
high-half writes, low-to-high carry, and preserving the carried high
half across a subsequent low-half write.

Fixes: cfc96df65e ("target/riscv: Remove upper_half from riscv_pmu_ctr_get_fixed_counters_val")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4219
Signed-off-by: Zephyr Li <fritchleybohrer@gmail.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Chao Liu <chao.liu@processmission.com>
Message-ID: <20261008035150.2223-1-fritchleybohrer@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-10-16 10:40:39 +10:00
Cédric Le Goater 910e1d41be scripts/checkpatch: validate Fixes: tag format and commit ancestry
Adapt the kernel's checkpatch Fixes: tag validation for QEMU.

Add a git_commit_info() helper to resolve commit hashes and validate
the Fixes: tag in commit messages. The canonical form is:

  Fixes: <12+ chars of sha1> ("<title line>")

The check validates capitalization, spacing, hash length, lowercase
hex, and quoted title. When the format is wrong and the commit can
be resolved, suggest the corrected Fixes: line.

When running inside a git repository, also verify that the referenced
commit is an ancestor of master.

Lines matching "Fixes: CVE-*" are skipped. The check can be disabled
with --no-fixes-tag.

Link: https://lore.kernel.org/qemu-devel/20260806171333.328864-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-10-15 13:15:24 +02:00
Andrey Drobyshev f13762e035 scripts/qemugdb: coroutine: Don't touch the coredump for a plain backtrace
init_coredump() creates a Coredump object for every coredump session.  That
implies opening and scanning the actual coredump file.   For non-detailed
'qemu bt' invocation we don't really need it.

Les't only create the object when the core is about to be patched, i.e.
for '--detailed'.

Fixes: 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-10-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:20 +02:00
Andrey Drobyshev 974fd683f3 scripts/qemugdb: coroutine: Speed up coroutine lookup in a coredump
'qemu bt' on a coredump takes significant time before the first
coroutine frame is even printed.  The bulk of the delay is resolving a
name.

co_tls_current is a file static variable, and CoroutineUContext is defined
in the same compilation unit, so resolving either of them by name makes gdb
expand every symtab in the binary.

Look the static up with gdb.lookup_static_symbol(), which is served from
the gdb's in-memory index, and scope the type lookup to the symtab that
comes with it.  This significantly speeds up 'qemu bt' processing.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-9-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:20 +02:00
Andrey Drobyshev b05b363df4 scripts/qemugdb: coroutine: Handle target absence gracefully
init_coredump() picks the core dump and the executable out of fixed lines
of 'info files' output.  With no target loaded that output is empty, and
'qemu bt' dies with:

    IndexError: list index out of range

Search the whole output for the core dump file instead, and take the
executable from gdb.current_progspace(), which doesn't need parsing at
all.  Neither can raise if the pattern isn't there, so an unexpected
output format now just means "not a coredump" rather than a traceback.

That alone only moves the problem to gdb.execute("bt"), whose gdb.error
escapes invoke() and still gets reported as a python traceback.  At the
same time plain 'bt' just prints 'No stack.'.  Let's mimick this
behaviour and simply report an error if there's no selected thread.

Fixes: 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-8-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:20 +02:00
Andrey Drobyshev 3bcb08bc1c scripts/qemugdb: coroutine: Fix '--detailed' description
Both commands claim the coredump is copied before its registers get
patched, but patch_regs() writes to the coredump itself.  Describe what
actually happens, so that nobody expects their coredump to be left alone.
Fix a typo in "runing" while at it.

Fixes: 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-7-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Andrey Drobyshev 9834785d56 scripts/qemugdb: coroutine: Fix patching pt_regs in the coredump
patch_regs() and restore_regs() open the coredump with 'ab', i.e. with
O_APPEND.  This repositions the file offset to the end of the file before
every write.  The seek() to pt_regs therefore has no effect: instead of
patching the saved registers, we just append the binary blob with patched
regs at the end of the file.

Nothing fails, and the gdb subprocess still prints a plausible backtrace.
However it's a backtrace of the crashed thread rather than of the
requested coroutine.  The .ptregs blob kept for recovery is dead for the
same reason as there's never anything to restore.

Open the file with 'r+b' so that the writes actually land where seek()
points.

Fixes: 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-6-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Andrey Drobyshev 0ab8e52a2a scripts/qemugdb: coroutine: Don't unwind past the outermost frame
dump_backtrace() walks the frame pointer chain until rbp is NULL.
However, when glibc is built with no frame pointers, rbp is never NULL
during unwind.  Instead, we see garbage in the outermost frame.  This
results into:

  #17  0x5610b6e9f2d9 in main<+1720> () at ../qemu-io.c:674
  #18  0x7f26cc10230e in __libc_start_call_main<+125> () at
      ../sysdeps/nptl/libc_start_call_main.h:58
  Traceback (most recent call last):
    File "/.../scripts/qemugdb/coroutine.py", line 409, in invoke
      bt_jmpbuf(coroutine_to_jmpbuf(co_ptr), is_coredump,
    File "/.../scripts/qemugdb/coroutine.py", line 296, in bt_jmpbuf
      dump_backtrace(regs)
    File "/.../scripts/qemugdb/coroutine.py", line 247, in dump_backtrace
      while rbp:
            ^^^
  gdb.MemoryError: Cannot access memory at address 0x4
  Error occurred in Python: Cannot access memory at address 0x4

As a fix, stop on the first link that can't be read.  Since
gdb.parse_and_eval() returns a lazy value, force the actual memory read
by wrapping it in int() and immediately catching potential gdb.MemoryError.

Fixes: 772f86839f ("scripts/qemu-gdb: Support coroutine dumps in coredumps")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-5-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Andrey Drobyshev a388c93cf1 scripts/qemugdb: coroutine: Only attempt to restore regs in coredump
When calling 'qemu bt' / 'qemu coroutine' in a live process, we get:

    AttributeError: 'NoneType' object has no attribute 'restore_regs'

That's because for both commands finally: blocks attempt to restore
patched regs unconditionally.  Fix this by guarding regs restoration by
'if is_coredump'.

Fixes: 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-4-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Andrey Drobyshev 774de38b0b scripts/qemugdb: coroutine: Get rid of fallback pattern when dumping backtrace
Currently upon invocation of 'qemu bt' / 'qemu coroutine' we try live
process backtrace dump first, and if it fails - fallback to coredump.
That causes us needless work and catching an exception.  In my previous
commit 42f3c143c3 ("scripts/qemugdb: coroutine: Add option for obtaining
detailed trace in coredump") class Coredump was introduced, and each
invocation already calls init_coredump().  Let's just pass the result of
this call further as a bool param and make a decision based upon it.
Apply the same pattern to obtaining coroutine pointer.

Note that we deliberately lose a safety net here: the bare except used to
swallow any failure of the live dump, not just the absence of a live
process, and silently fall back to the raw unwind.  Such a failure is now
reported to the user instead.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-3-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Andrey Drobyshev 8141ceb36a scripts/qemugdb: coroutine: Fix selected frame leak on error path
Currently, whenever gdb.execute() fails and throws an exception,
previously selected frame gets leaked.  I.e.:

  (gdb) frame N
  (gdb) qemu bt # throws exception
  (gdb) frame   # shows 0, not N

As a fix, wrap gdb.execute() commands in try/finally, so that selected
frame gets restored no matter what.

Fixes: 4cbf8efc5b ("scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260804151743.937694-2-andrey.drobyshev@virtuozzo.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2026-10-07 17:36:19 +02:00
Richard Henderson 2a0ac9c8ac Merge tag 'pbouvier/pr/tcg_tests-20261001' of https://gitlab.com/p-b-o/qemu into staging
Changes:
- [PATCH v3 00/24] tcg/tests: integrate rest of mips tests (Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>)
  Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-1-pierrick.bouvier@oss.qualcomm.com
- [PATCH 0/3] tests/tcg: add missing tests after meson transition (Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>)
  Link: https://lore.kernel.org/qemu-devel/20261001163751.172720-1-pierrick.bouvier@oss.qualcomm.com

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEN8FWlNi6l2Sxlz/btEQ30ZwoYt8FAmq+nb0ACgkQtEQ30Zwo
# Yt8Yvwv/WOms+wxT9oit5o82ySP6j1Phn3CDgb8kLulJhR570FzbwmWOI6udK8Kb
# Gt7AEiWSCloaPYex2sd7eGCc2rXobFGO0dLg6blKJbo92LGSwmBHBw2OQZAP2Wof
# 7ElHC/ssKZ4+wUmVXYYi7JCGaTnuoP8wYDYKnX4P2JY4cQMRaq3f2gSSMq2iVHnT
# 5F3bAXxj5ZkjwlDFkPk3gwB/rrr2Umb5tPFETGrINLaHqiO5daehXDNivShErtWV
# dPfMNrmhpvi3XuNTtVyWwBi09MxIqh37xHEPamOUxUE2yJIie5x6SYliTtLvWjLm
# FZh0MgKCUENGPIaMtWR/2d2KrAI/SFQlEvz8ifNwVLOIfYbwqzHT40wfKtS/hg4r
# NDq5yDer1kMn8jXjTdd/yop4bHyXY14u+hEhhObL+yWQODb9qpAtXlbDBz+GkqwK
# xNpY+piDxdjpJrNVWjSJCYCUXLsLIm3+QlK63jJQ4wocD4MqyDoEcDiWLv9FxprZ
# 4ke70Tcd
# =tSWP
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 01 Oct 2026 07:51:57 PM CEST
# gpg:                using RSA key 37C15694D8BA9764B1973FDBB44437D19C2862DF
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.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: 37C1 5694 D8BA 9764 B197  3FDB B444 37D1 9C28 62DF

* tag 'pbouvier/pr/tcg_tests-20261001' of https://gitlab.com/p-b-o/qemu: (27 commits)
  tests/tcg/multiarch: add missing test_pnew_jump_loads.c test
  tests/tcg/i386: Build test-i386-opt-shr
  tests/tcg/multiarch: add missing vma-pthread test
  tests/tcg/mips/user/ase/msa: remove compilation/run scripts
  tests/tcg/mipsel/mips32r5el: add msa tests
  tests/docker/debian-all-test: add mips32r5 toolchain
  tests/tcg/mips64/mips64r6: add msa tests
  tests/tcg/mips: declare msa tests sources
  tests/tcg/mips64: add mips64r6(el) tests
  tests/tcg/mips64/mips64r6: update references
  target/mips: Sign-extend the SRAV operand
  tests/tcg/mips64/mips64r6: update failing tests to use check_binary_op_64
  tests/tcg/mips/include/test_utils_64.h: add check_binary_op_64
  tests/tcg/mips64/test_mips64r6: fix call to check_results_64
  tests/tcg/mips/include/wrappers_mips64r6.h: use proper types for parameters
  tests/tcg/mips/include/wrappers_mips64r6.h: add missing wrappers for and, nor, or, xor insn
  tests/docker/dockerfiles/debian-all-test: add mips64r6 toolchains
  tests/tcg/mips64/test_mips64r6: fix include path
  tests/tcg/mips64: move mips64r6 sources
  tests/tcg/mips64*/meson.build: remove unused cc_feat
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-03 09:53:15 +02:00
Pierrick Bouvier c7b1a7bc9d tests/tcg/mipsel/mips32r5el: add msa tests
Due to missing toolchain, we don't add those tests for tests/tcg/mips.
Considering this variant is not widely used, it makes sense.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-24-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2026-10-01 17:51:07 +00:00
Pierrick Bouvier 22b35941f0 tests/tcg/mips64: add mips64r6(el) tests
We need to define two new test suites mips64r6-linux-user and
mips64r6el-linux-user to be able to use a different compiler from
mips64-linux-user, as cc is setup only once per suite.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-20-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2026-10-01 17:51:07 +00:00
Pierrick Bouvier d76be73268 tests/tcg/mipsel: add dsp tests
Most of tests have unused or unused but set variables. Instead of fixing
all of them, simply silentify those (unconsequential) warnings.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Acked-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-4-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2026-10-01 17:51:07 +00:00
John Snow 22155c01dd qapi/parser: fix intermediate "intro" detection
In 43e7ad1a3f, I adjusted the insertion algorithm for inserting
something after the "introduction" to cope with both the old and new
syntax while we converted QAPI to the new syntax. There's a bug in
that code that only shows up in a handful of cases and only when using
the new syntax while this affordance/flex code is still enabled.

In the case that we do actually have a real bona-fide intro section,
we want to insert directly after that real-deal intro section, not
after any plaintext sections that may follow it. This code adjusts the
temporary code to strongly prefer inserting after the actual intro
section if it exists.

Once again: once conversion is done, you will be delighted by how much
of this ugly code goes away.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20260917194614.549584-6-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2026-09-28 08:34:04 +02:00
Alex Bennée 3ce50b4879 gitlab: update the @user id mapping file
I needed to fix a POSIX-ism in the script as well.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Message-ID: <20260917165602.3405537-15-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-09-18 14:03:32 +01:00
Alex Bennée 3d7cb5106e tests/docker: add specific command to parser
A future change will want to use additional flags which clash with
docker/podman command lines. Currently they would get snarfed up by
argparser. Make the pass-through commands explicit to avoid this.

Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260917165602.3405537-13-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-09-18 14:03:23 +01:00
Alex Bennée 6942472b29 tests/docker: add container registry to configure and use
Previously we had the default baked into Makefile.include but as the
meson container logic will also benefit from it we update the configure
machinery.

For now we allow direct make invocations to override but for the
normal case it is in one place now.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260917165602.3405537-10-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-09-18 14:02:51 +01:00
Alex Bennée f334f76903 scripts: update meson-buildoptions.sh
This wasn't run because the automatic trigger is fickle. We don't want
to expose all the tcg-test-cross-cc options to help as we already have
processing via --cross-cc-ARCH so we tweak the CONFIGURE_HELP filter
in the update script.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260917185322.3457036-1-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-09-18 14:02:09 +01:00
Richard Henderson 09614ebee1 Merge tag 'pull-request-2026-09-10' of https://gitlab.com/huth/qemu into staging
- Fix minor issues in next-cube machine and mark it as deprecated
- Add a configure option to disable tests
- Remove stamp files when deleting assets from the functional cache
- Make sure that pyling version is not too old
- Keep USB autoscan enabled for bus+addr selector

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmqilnUSHHRoLmh1dGhA
# cG9zdGVvLmV1AAoJEC7Z13T+cC21GtYP/2JRtwlyJdiyl5TVRtiWE38Ezu0pzXDi
# Snz+/KK3nIDIs6EJvg2rSHyfpE+0+iHT9brzAks4g/jEbsywOeTtn/HPP1PzCB58
# Sjy68IyVFh7TaEg9R5dEuHQYE1D4sJnQlCinMMMXWfxw/rArsdkMWxl1onwQKOOt
# Te1NsvCb16dC7ItT/VcpQB71TChIEYoJXHC/FZ2jhzDc+Th8l4rkWKAR1x8QljtR
# h8Z+7xuE00cRxTUALEnmxqP7oYk/2tE2ZOe/wSByvm2umBUR4/DQD6iKKmX4Qew+
# rHQbAaWBqVDK2L69f/1B9v43XPhRykZRe3E58LNfCvM39xG6VaRd1UHdg1X1IiiL
# aHV20Y27oaOVub3zPsiJKiOAghQsq6Dg3dgWQQRStJv5XZEyeMiFjjk+oOoQ3UBd
# +0pyzrOhobNQcYOvz6RJMehby/Oc8qzQinShrQnh6CjPtAObxx5Mq48PZicbAEGj
# xrgH4vSfchm4p7YhVJ1zj4aIEx4r23XChhhszzDnchjuWcl/1r7Khw0ZTlITupXL
# yj/v9sJKRghoG3Ie7WlYXocbdmOn8WE53Cb13XHwwFPryB6gMlG4IR5Jf5eMM8w4
# Tdp1hMw4WXLZ4AEE+XM44932lkrfgcssG0Odt5ECQjhlBWuSwe9mXIia5++X6H8w
# +b0Ed+6xrP8q
# =jcK+
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 10 Sep 2026 01:37:25 AM HST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "th.huth@posteo.eu"
# 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:                 aka "Thomas Huth <th.huth@posteo.eu>" [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-09-10' of https://gitlab.com/huth/qemu:
  hw/usb/host-libusb: keep autoscan enabled for bus+addr selector
  Add option to disable building tests
  tests: install pylint for functional linters
  scripts/clean_functional_cache: Remove also .stamp files
  MAINTAINERS: Mark the next-cube machine as "Orphan"
  docs/about: Deprecate the 'next-cube' m68k machine
  hw/m68k/next-cube: Replace assert()s and abort()s with logging functions

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-09-10 20:58:42 -10:00
Florian Schmidt 186c223802 Add option to disable building tests
There are situations in which you might want to build QEMU without
building the full test suite, which in some configurations can take a
considerable amount of time to build. This is especially true when using
LTO with clang. For example:

$ ../configure --cc=clang '--extra-ldflags=-flto=thin -ffat-lto-objects' '--extra-cflags=-flto=thin -ffat-lto-objects' --target-list=x86_64-softmmu
[...]
$ time make -j8
[...]
[3078/3078] Linking target tests/qtest/qos-test
real    6m43.250s
user    101m15.967s
sys     4m3.813s

$ ../configure --cc=clang '--extra-ldflags=-flto=thin -ffat-lto-objects' '--extra-cflags=-flto=thin -ffat-lto-objects' --target-list=x86_64-softmmu --disable-tests
[...]
$ time make -j8
[...]
[2024/2024] Linking target qemu-system-x86_64

real    3m14.277s
user    33m13.174s
sys     1m36.642s

Add a toggle to optionally disable building tests.

Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Tested-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260724135413.1716872-1-flosch@nutanix.com>
Signed-off-by: Thomas Huth <th.huth@posteo.eu>
2026-09-10 13:34:30 +02:00
Thomas Huth c1bb594fe4 scripts/clean_functional_cache: Remove also .stamp files
The cache cleanup script already successfully removes the assets
that are unused since more than 6 months, but it forgot to delete
the corresponding timestamp files, too.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260814122643.312129-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <th.huth@posteo.eu>
2026-09-10 12:40:45 +02:00
Peter Maydell 257bf4f160 Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* AGENTS.md: basic bare minimal guide
* target/i386: TCG fixes
* scripts/checkpatch: warn on duplicate trailers, self-review, crediting AI
* docs: link to website for IRC and mailing list
* rust: qemu-macros: remove redundant clone()
* rust: qemu-macros: silence more warnings for bindgen crates

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmqhgPcUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroMHGgf9HhS9YkSidGB00Xg843Duhms1GwCy
# hXP1G+wZisFk63ypd7k9ZSMh6jCJrHA+A4LoRiVP2W+mfWgWRMh1c3oUf9u7fjzO
# CsBV/JejM6GruSPjcCtFIBvKZbdZxlGoPWLpedvLDFQdoWZk2TLqIHFw+XJjK8uI
# ESYQuiWUqEaj+Vk0NerGL8nvMwOkYL8X7L89GJirXfZio2U+VmtSRrIhQ5W0SpK8
# jV7Oi5PJiKCm7gss4z0psaIXW/4ep6QGmWtx3lA6+uh1G2DCTkNoeo2JU10BQEZU
# fZsNy6B/mqG66jPwHHXziaC/omXf1XZ/p+0zER3m2VtWi7Zg4W0fDrQGVA==
# =04kq
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Sep  9 16:53:27 2026 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# 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: bindings: disable more clippy warnings
  rust: qemu-macros: remove redundant clone()
  AGENTS.md: basic bare minimal guide
  scripts/checkpatch: warn on duplicate trailers and self-review
  checkpatch: reject trailers that credit an AI agent
  docs: link to website for IRC and mailing list
  target/i386: Mark MOVNTI as not valid with prefixes 0x66, 0xF2, 0xF3
  target/i386: Update FPU tag word for FXCH
  target/i386: Update FPU tag word for FSTP
  target/i386: Update FPU tag word for FXTRACT's old ST(0)
  target/i386: clear C1 for all x87 compare instructions
  target/i386: Fix FXCH to unconditionally clear C1

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-09-10 11:08:04 +01:00
Marc-André Lureau c3db8e7045 scripts/checkpatch: warn on duplicate trailers and self-review
Detect two common trailer mistakes:

- Duplicate trailers: any trailer (Signed-off-by, Fixes, Resolves,
  Cc, etc.) appearing more than once with the same value in a commit
  message.

- Self-review: a Reviewed-by, Tested-by, or Acked-by tag from the
  same person as the patch author, which provides no independent
  review value.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260727161157.2112984-1-marcandre.lureau@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-09-07 19:26:35 +02:00
Paolo Bonzini f6979efa61 checkpatch: reject trailers that credit an AI agent
The QEMU community has broad consensus to not accept assisted-by and similar
trailers, and much less fake co-authored-bys, independent of any AI policy.
Implement this in checkpatch.pl already, so that there is another way for
contributors to discover the AI policy.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-09-07 19:26:35 +02:00
Pierrick Bouvier 3ca4c75a17 scripts/probe-gdb-support.py: add mapping for mips architecture
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260827221506.91574-62-pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-09-04 15:06:02 +01:00
John Snow ab2de86588 qapi: update type hint for objects_seen
In preparation for upgrading Python to 3.12+, adjust the type hint on
objects_seen to prevent mypy from chirping about an unknown type for
this variable.

Why didn't this trigger earlier? A mystery for the ages.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260825215851.1780608-9-jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
2026-09-02 15:02:58 -04:00
John Snow 0ba1e07376 tests: re-add opencv2 and numpy dependencies
Fixes: 2a428c8541

Some of the dependencies identified as avocado dependencies were in
fact still being used, and should be re-added to our lcitool
configuration to ensure that these tests are being executed in the CI
environment.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260825215851.1780608-6-jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
2026-09-02 15:02:58 -04:00
John Snow 6f55b7149f tests: update libvirt-ci, lcitool
Update libvirt-ci to current origin/master for the primary sake of
grabbing new mappings for FreeBSD, which has upgraded from Python 3.11
to 3.12 and along with it changed the name of their python ecosystem
packages.

Refresh the lcitool generated files to fix our FreeBSD tests.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260825215851.1780608-3-jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
2026-09-02 15:02:58 -04:00
Marc-André Lureau d0d3060658 build-sys: add 'hmp' option
Add an option to enable/disable HMP support, default to true. The
following commits are going to make --disable-hmp gradually work.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260828-qemu-no-hmp-v5-49-9227de146347@redhat.com>
2026-08-29 12:07:45 +04:00
Paolo Bonzini 7bca0ea74a scripts/feature_to_c: avoid SyntaxWarning
The backslash must be escaped.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-26 16:12:51 +02:00
Paolo Bonzini 22b1759a4b scripts: rename get-wraps-from-cargo-registry.py
It does more than that now.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-26 16:12:37 +02:00
Paolo Bonzini eb01b388ea scripts: add the possibility of a quick update of the pacakge
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:27 +02:00
Paolo Bonzini c0228b5293 scripts: add functionality to update wrap files from Cargo.lock
.wrap files and Cargo.lock contain pretty much the same information.
QEMU uses the former to make it easier for distros to use a local
registry, and also because Meson <1.13 does not use Cargo.lock for
the "meson subprojects" command.  This however introduces an
inconvenience when running "cargo update", in that the wrap
files have to be updated by hand.

Add the possibility to get new versions from Cargo.lock and not
just from a local registry, thus automating the update.

For now, only existing wrap files are modified.  This means
that semver-breaking updates need to be done (at least partly)
by hand; it is enough to rename the wrap file prior to running
the script.

While the need for this script is a lot smaller with Meson 1.13, it
would still remain useful for packages that have a patch directory.
Perhaps a bit overengineered, but since we have it...

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:27 +02:00
Paolo Bonzini 4c70b2e539 scripts: introduce CrateSource abstract class
Prepare for making the script able to update .wrap files with
versions from Cargo.lock.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:10 +02:00
Paolo Bonzini 784f78a987 scripts: prepare for introduction of CrateSource class
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:10 +02:00
Paolo Bonzini 68b042953b scripts: do not assume the new version of the crate is present
Until now, the new version of the crate was always there in
the registry.  This will be different when crates are downloaded
from Cargo.lock, so delay the comparison of build.rs until a
point at which both source directories have been extracted.

Since the .wrap file at this point points to the new directory,
delete the old one "by hand" with shutil.rmtree instead of asking
Meson to do it before the .wrap file is changed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:10 +02:00
Paolo Bonzini b2a94481fe scripts: rename variable in scripts/get-wraps-from-cargo-registry.py
Do first the change that makes the diff larger than it should be.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:10 +02:00
Paolo Bonzini 1f8176b196 scripts: print build.rs diff
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:16:10 +02:00
Paolo Bonzini 506af15d44 scripts: remove dead variable assignments
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-21 10:06:39 +02:00
Paolo Bonzini 3ac34c6d25 rust: remove bilge crate
It has just been replaced with bitfield-struct.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-20 09:24:57 +02:00
Paolo Bonzini 64574f1c51 rust: pl011: switch from bilge to bitfield-struct
The bilge crate is heavily reliant on traits and, because trait functions
are never const, bilge and const mix about as well as water and oil.
In addition, it has support for the zerocopy crate that only works for an
older version, and is hard to update because the implementation doesn't
like that zerocopy::FromBits and bilge::FromBits are the same name.
zerocopy is definitely something that QEMU could use in the future.

The bitfield-struct crate, instead, is built from the ground up to
support const.  Its use is pretty much the same (device code does not
change at all, only register declarations do), with some things being
more verbose and others being simpler.  The code for the crate itself
is much smaller, too.

It does have two disadvantages: it does not let you annotate enums
as bitfields, and it does not integrate with arbitrary-int.  Thus, it
requires manual size annotations for anything that is not a bool, iNN
or uNN.  Lack of support for arbitrary-int is a very small deal, while
enums are a bit more annoying because they require some repetition
and an implementation of two functions from_bits() and into_bits().
However, the latter is already provided by the "bits!"  and
"#[derive(common::TryInto)]" utilities, and thus is not manual
in QEMU's case.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-20 09:24:57 +02:00
Paolo Bonzini 0836a79ada scripts: remove now dead parts of rustc_args.py
The logic to parse the [lints] section has been integrated
into Meson and can be removed.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-20 09:24:57 +02:00
Paolo Bonzini 530a9eb2c6 rust: switch to autogenerated meson rules
Meson can automatically generate most of the build rules for
subprojects, based on the contents of their Cargo.toml.  Handwritten
snippets can be placed in meson/meson.build to replace build.rs.

Disable Meson's use of the nightly-only option "--env-set".  It is
buggy and anyway it should not be there in future version.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-20 09:24:57 +02:00
Paolo Bonzini 2a428c8541 dockerfiles: remove packages required by Avocado
Make our CI containers smaller, by removing a handful of packages that
were only included as dependencies of Avocado.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-20 09:06:43 +02:00
Daniel P. Berrangé 84a6c5f94b get_maintainer: add ability to report Git Lab handle
With the GitLab mapping files from the previous commit, the
get_manitainer.pl script is now able to report the gitlab
handle for each maintainer/reviewer when displaying output.

For example:

  $ ./scripts/get_maintainer.pl -f hw/scsi/lsi53c895a.c
  Paolo Bonzini <pbonzini@redhat.com> (supporter:SCSI, gitlab:@bonzini)
  Fam Zheng <fam@euphon.net> (reviewer:SCSI, gitlab:@famzheng)
  qemu-devel@nongnu.org (open list:All patches CC here)

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-07-21 16:53:12 +01:00
Daniel P. Berrangé 4f7615789b gitlab: introduce files mapping GitLab accounts to real names
It is desirable to be able to discover the GitLab account handle
assocaited with a real name in the MAINTAINERS file.

Rather that duplicating the same account handle multiple times,
inline with the MAINTAINERS file entries, this introduces mapping
files:

  * .gitlab-map-auto - data automatically queried from GitLab
    using the 'glab' tool and REST API
  * .gitlab-map-manual - manual overrides/augmentation for
    cases where the MAINTAINERS real name does not match the
    GitLab account real name

The former would need refreshing when we add new MAINTAINERS
entries, if the person had to be added as a GitLab account
member. For this purpose scripts/gitlab-map-update can be
used, assuming the user has the 'glab' client tool present
and configured with an access token.

To audit how many maintainers have GitLab handles present/missing
scripts/gitlab-map-check can run a report.

  $ ./scripts/gitlab-map-check
  Missing GitLab handle for maintainer 'Akihiko Odaki'
  Missing GitLab handle for maintainer 'Albert Esteve'
  ....
  Missing GitLab handle for maintainer 'Zhenzhong Duan'
  Missing GitLab handle for maintainer 'Zhuoying Cai'
  GitLab handles missing: 158 / present: 68

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-07-21 16:52:25 +01:00
Alex Bennée 651c451c8e scripts/gitdm: migrate from contrib
As discussed previously it was suggested scripts might be a better
location for this meta data.

Link: https://lore.kernel.org/all/CAFEAcA_5HvGriDsWnb1ALuA_dgG320eKv7yuM2kThv=rfOSZQA@mail.gmail.com/
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260709080040.4157324-10-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-07-13 17:13:11 +01:00
Marc-André Lureau 73ae0be3f1 ui/spice: add cleanup on shutdown
SPICE resources were never freed on shutdown. Add per-subsystem
cleanup (display, input, core) and call it from qemu_cleanup().

Move spice-module.c into libui so the qemu_spice ops table links
with the rest of the UI code. Add an LSan suppression for a known
spice-server leak.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-14-4656aec3398d@redhat.com>
2026-06-24 15:41:14 +04:00