Commit Graph

127967 Commits

Author SHA1 Message Date
Philippe Mathieu-Daudé
4a425e5f13 fsdev: Build stubs once
Move stubs to the global stub_ss[] source set. These files
are now built once for all binaries, instead of one time
per system binary.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260225035739.42848-11-philmd@linaro.org>
2026-03-17 19:50:05 +01:00
Peter Maydell
6667668e0c Merge tag 'pr-plugins-20260316' of https://gitlab.com/pbo-linaro/qemu into staging
Changes:
- [PATCH] contrib/plugins/uftrace.c: fix depth for exit events (Pierrick Bouvier <pierrick.bouvier@linaro.org>)
  Link: https://lore.kernel.org/qemu-devel/20260313063441.2048882-1-pierrick.bouvier@linaro.org

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEZrmU7KFPfy5auggff5BUDQoc0A8FAmm4kCsACgkQf5BUDQoc
# 0A8gRQv+LZIiG75VL5cy+tpdD+kcwu+hsQ5Y6qGA6zs9TrdARxKtQ2Ozg9VjrMGE
# bTzhxo7ldwEjcki8bvi4yYN3uXtJzg/PODYcN7KWdqihunS97Iqr64Fd5aqkmNkV
# LNBbeLh+9qqtLY/k0YyR5yNJZ+9XuPatG+x/gG7WE0Ij3rMI2y1RIW7oq0MeBVuH
# gY9fsH80CL8wJC+LHkJDwpDXZyFLTh2+Q7kUGk51E3FYDQzHzV8Zewrmy3Vu+1RD
# 1+3EIBbC8e0fjYZEG6FFn0cBjx+TH11y2eN8JRvnmsMqoYRONSd2rUBQG5KFYcvO
# tJzDMCm7rfDWS+URs9SAb0a9mW0QNPBtZhhW5amHVFBQwIxpnznzC+xMCl51GUQe
# 1cNCzUCMhjSkFFUhvbWpB5IjQhDT6vKQ2y+telUDQ3VG1k914slEi2bIBECIEFeu
# u3X/4fCSU25rsXrjadbUKrnahRf9kGWmw1vZoZzGkb95HUpG3mgOXt7n8Ej9q1kt
# RBB/+NwN
# =q1H1
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar 16 23:20:11 2026 GMT
# gpg:                using RSA key 66B994ECA14F7F2E5ABA081F7F90540D0A1CD00F
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@linaro.org>" [undefined]
# 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-plugins-20260316' of https://gitlab.com/pbo-linaro/qemu:
  contrib/plugins/uftrace.c: fix depth for exit events

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-17 10:20:30 +00:00
Pierrick Bouvier
48221e3716 contrib/plugins/uftrace.c: fix depth for exit events
Uftrace plugin was recording wrong depth for exit events, resulting in
incoherent traces, especially for partial ones.

Thanks to Honggyu Kim, one of the original author of uftrace, who
spotted the issue.
https://github.com/namhyung/uftrace/pull/2031#issuecomment-4051762627

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260313063441.2048882-1-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-03-16 16:19:18 -07:00
Peter Maydell
559919ce54 Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
trivial patches for 2026-03-16

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmm34HIACgkQgqpKJDse
# lHjIwA/9G+XvpJHAXsK8QdPQAlrcCstV9GYJ/+wprclWM6rsWf+zQQ4RvQqxj4ue
# YzYmK37LVp2QyxNHACN5BYR/k7VUxjgdDZgu2bj3gw2A9XFkwnUHZuzvNaWPllit
# ugeeDP9dA+gM+YrUhPSwmDSX03KZrF1hipaQqPdFpCRaN1guvtNfnveqgGgE4eRm
# svwv40z0+kQW7pg/7cpPCp0ATdeYoLV84jOcEpR7gVdheektrIC2rQSUNl4Eqg1b
# VrvvoGZ+M4sJOyzz/jFEauWEYOjRT/3t0B1fy4jyUVOAKaDsPRBS1R3XvYGmgfEG
# OusGvluoLXdQ53xcdE448wTO9pQFnMjmrWsqtVyevyD3Rd0x1Rl2sQwZ4qoq5rgr
# Ck6ruvSnBM8tthSHktpYLdI1pcjAp3xS7LsVK+bQk9sJuIYiDczgDpsnkg/YgbtA
# Gqbbh1/2WIufpRd9HhhFo5yEzWfoHvGgSI1AytIkG4/VRKS5vXQ+sbGV2j4oVBte
# Wpx87zWaZytqdkA5i3EzOY/3JT63tpyEbzpZc35psGo6z/khUrdzqpLUwmt8MNNH
# oxadGK3B/r6rfaXOo9zN1ACCp1tY9D/OCow7MTPdnU5ySMkIzKO59akpw9SoShzC
# O8Ok0j/onHZbZwIt7rYAWODbeIN4zyoVsKbk1xFV2+CGoHWeOK8=
# =KGOq
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar 16 10:50:26 2026 GMT
# gpg:                using RSA key 64AA2AB531D56903366BFEF982AA4A243B1E9478
# gpg: Good signature from "Michael Tokarev <mjt@debian.org>" [full]
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>" [full]
# gpg:                 aka "Michael Tokarev <mjt@tls.msk.ru>" [full]
# Primary key fingerprint: 9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
#      Subkey fingerprint: 64AA 2AB5 31D5 6903 366B  FEF9 82AA 4A24 3B1E 9478

* tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu:
  rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build
  meson.build: do not check for epoll.h (CONFIG_EPOLL)
  linux-user: assume epoll is always present
  meson.build: stop checking for inotify_init()
  linux-user: assume inotify sycalls are always present
  meson.build: stop checking for splice()
  linux-user/syscall.c: assume splice is always present
  docs: Move xbzrle.txt into the migration folder and convert to rst
  target/i386: fix NULL pointer dereference in legacy-cache=off handling
  hw/usb/core.c: reorder usage and assertion of p->ep
  system/physmem.c: remove useless assertion of block
  dump/dump.c: reorder usage and assertion of block
  migration/savevm.c: reorder usage and assertion of mis->from_src_file

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-16 13:07:33 +00:00
Peter Maydell
bce666efa9 Merge tag 'pull-target-arm-20260316' of https://gitlab.com/pm215/qemu into staging
target-arm queue:
 * hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug
 * semihosting: Correctly byteswap data when CPU is in big-endian mode
 * hw/dma/pl080: Fix various minor bugs
 * MAINTAINERS: Remove some no-longer active maintainers
 * tests/qtest: Use g_strdup_printf() in various arm tests

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmm33l8ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3ssREACHRyPRM/BdgjxLcQ+mZDYl
# WLSJzytrgdBmUsALt1T6hKMAfAdtdNVbLO/4r9r1zSDhXWcHOd+hsiq0IF+F6CZd
# qKIB++aVrNDWA5v0tlz+j4kQNCeFOX/u53CB9nZtaV/dMrAZbiuOulxDzd9grKJi
# m3ZT7YfIAV6nNLp/J7Q7P8rvM5quN/1ohTGqKSmMgLAZgqa0ac8cV3NYqVpnd4Jc
# +pqoQQb54uKpMKRacAUX2OMk6XuxDI3szdciVQLLhhrglwMo3xoAwpX600lAcvYv
# 2D+8nb5A90u7pfIY4xGajIBqiBP5PQC2RiTUd0qRmOklnVx7gRHaI9N1LOA/DtX1
# YKCPuH3CZEuZ+s4bWH9+ahaHbu5eHmqhxlp+CdICWbf+MBa1bCig2gT6su26AeHs
# hEcLt9QQwKAfjegs4S9J90ph13LADau8VkSIP6WMfTuDmNesQY6/JlaGq8/qWrfL
# WfJF8i9fHpEX7OSy+/CwUS02HTDrn2MRTmAt2ihee5oYRuEdmSfYCjMvt5Nhbej3
# nzNWBw/BpgdNsdIPfJSoNWP/VQTTX6rYvUQh4+Z90SVqFyfGSCb9JOVg6Ab39Q8p
# gfjkIU2NwhZmDCjh4CqJLihKCPCUiFKlYrvOpAHkuDXcLqzLvF03A7WIHs4cA5+T
# PwUs4qJF8kpBsJOdshbQAQ==
# =V7Lm
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar 16 10:41:35 2026 GMT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20260316' of https://gitlab.com/pm215/qemu:
  tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays
  tests/qtest/ast2700-gpio-test: Use g_strdup_printf() instead of char arrays
  tests/qtest/arm-cpu-features: Use g_strdup_printf() instead of char arrays
  tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays
  MAINTAINERS: Remove Chris Browy
  MAINTAINERS: Remove Andrey Smirnov
  MAINTAINERS: Remove Radoslaw Biernacki
  MAINTAINERS: Remove Eduardo Habkost
  MAINTAINERS: Remove Cameron Esfahani
  MAINTAINERS: Remove Hannes Reinecke
  hw/dma/pl080: Ignore bottom 2 bits of LLI register
  hw/dma/pl080: Update interrupts after pl080_run()
  hw/dma/pl080: Handle bogus swidth and dwidth in transfers
  semihosting/uaccess: Use the cpu_internal_tswap() functions
  include/exec: Provide the cpu_internal_tswap() functions
  include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian
  hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-16 13:07:17 +00:00
Michael Tokarev
7cc61f922f rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build
Since CONFIG_EPOLL is now unused, it's okay to
perform this rename, to make it less ugly.

Since epoll is linux-specific and is always present on linux,
define CONFIG_EPOLL to 1 on linux, without compile-time test.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:18 +03:00
Michael Tokarev
18f1cf1cfc meson.build: do not check for epoll.h (CONFIG_EPOLL)
The only place where we used CONFIG_EPOLL was linux-user,
which now enables it unconditionally.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Michael Tokarev
ecec2bd8f3 linux-user: assume epoll is always present
epoll is in linux since 2.6 (glibc 2.3.2).
epoll_init1 has been added in 2.6.27 (glibc 2.9).
There's no need to check for its presence, including all other
epoll-related syscalls.

Modern architectures don't have epoll_create(), only
epoll_create1(), so keep conditional around the former.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Michael Tokarev
7276d72802 meson.build: stop checking for inotify_init()
the only place in qemu which used the check for inotify_init()
was linux-user, which now assumes inotify_init() is always
present.  There's no need to check for this function anymore.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Michael Tokarev
11de247707 linux-user: assume inotify sycalls are always present
inotify_init() and other syscalls appeared in linux 2.6.13,
inotify_init1() - in linux 2.6.27.

There's no need to check their presence on linux anymore.

Keep condition on TARGET_NR_inotify_init because modern
architectures have only more generic inotify_init1().

Other, not linux-specific, places of the code checks for
inotify_init1() syscall only.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Michael Tokarev
44c49d9b0d meson.build: stop checking for splice()
CONFIG_SPLICE was only needed for linux-user/, where it is not
used anymore (assuming splice &Co is always present)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Michael Tokarev
bf6ec283c5 linux-user/syscall.c: assume splice is always present
splice() &Co are defined since linux 2.6.17 (glibc 2.5).
Assume it is always present.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Thomas Huth
271e2a38a2 docs: Move xbzrle.txt into the migration folder and convert to rst
xbzrle is a feature of migration and thus this file should go
into the docs/devel/migration/ folder. While we're at it, turn
it into proper .rst format, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Sergei Heifetz
2741d2cc39 target/i386: fix NULL pointer dereference in legacy-cache=off handling
The check that xcc->model is not NULL occurs after it is dereferenced
inside x86_cpu_get_versioned_cache_info(), so something like
`-cpu host,legacy-cache=off` leads to a segfault rather than an error.
This patch fixes that.

Fixes: cca0a000d0 ("target/i386: allow versioned CPUs to specify new cache_info")
Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
[Mjt: simplify the following condition too]
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Sergei Heifetz
e49f46d5c4 hw/usb/core.c: reorder usage and assertion of p->ep
Reorder the code so the assertion of p->ep occurs before it is
used in the subsequent lines.

Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Sergei Heifetz
731abcf418 system/physmem.c: remove useless assertion of block
It is useless to assert that block is not NULL because it is
already dereferenced in the first line of the function.

The assertion is also unnecessary because the function is called
in only two places, and `block` can't be NULL in either of them:
- In `migration/ram.c`, we have already dereferenced `block` in
  the code just before the call.
- In `system/memory.c`, we assert `mr->ram_block` before passing
  it to the function.

(We could split the declaration and initialization of oldsize,
but then we would need to remove the const qualifier. As the
assertion is useless anyway, removing the const qualifier seems
worse.)

Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Sergei Heifetz
de49227611 dump/dump.c: reorder usage and assertion of block
Reorder the code so the assertion of block occurs before it is
used in the subsequent lines.

Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Sergei Heifetz
455c908278 migration/savevm.c: reorder usage and assertion of mis->from_src_file
Reorder the code so the assertion of mis->from_src_file occurs before
the call to migration_ioc_unregister_yank_from_file, which dereferences
it in qemu_file_get_ioc.

Fixes: 39675ffffb ("migration: Move the yank unregister of channel_close out")
Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-03-16 13:50:17 +03:00
Peter Maydell
ac5ed6d278 Merge tag 'pull-request-2026-03-16' of https://gitlab.com/thuth/qemu into staging
* Fix various crashes that can occur when starting QEMU with -device xyz,help
* Update various sections in the MAINTAINERS file

# -----BEGIN PGP SIGNATURE-----
#
# iQIyBAABCgAdFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmm33eAACgkQLtnXdP5w
# LbUAnA/2NUNIRc18cIAmC5AABoLPeLd96ndPXoayMc78fdJXeM4GsFHqQ0Qqj56B
# nSZY9nHHzv8f9n+pVISoffuywP0ldR7+ThKVyps8rkmsXDuBsdNwZU829toq43lg
# V0+/UtyxrZLujV581TrmKlPf25sY5BV96YHWzXuUm2E5ikrSzqNcm+1ZNRRhWa5R
# gu0bhfAcILnmXxYYrIO/JWM38j7Kz2BHLGN2A8UepORhs5gUg5vk33RaTrzDfbwN
# rTxLKjLxYEPV2E9YTBsmMQqsiBomHjw66g5Rtq68KE26RodPeEdLsk9Yd7WbWfEf
# HGnZ/l2aZ8OoaricIvUdMQmkAVjxZE4b+a6AiZ38KsJ/3XEXQqbkvGRW3OCkAWOY
# kzRuxWJKoPIkvm4jfN39cZEtzHnXdrNgiVCwGuMn0BwqHOPIF/W+5XImOW1dqlTL
# CfR11yjUdpW33/hWmXtHkAYDlf5cP7/eL/KStrSv3DkG9/CNTAfwEvjkOyBq3C+K
# J/aiufIkbkUr8ZpfJ+eledbAkvvv1/d8/u5vlqyVa4sL7hdcaxQrUDxjojrE7EoM
# xB0eS4eFZNsRQn3YrvqyCMxwwO16HyeOOYSv/7Z2wixe/FCRQEjxl02/430ITVNS
# MB1/fKUWd4/SUY+BqtBHSo4qNPEbmxzOXKVEJHLS2bqqnDmEcg==
# =0ClG
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar 16 10:39:28 2026 GMT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [undefined]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2026-03-16' of https://gitlab.com/thuth/qemu:
  MAINTAINERS: Add another reviewer to s390x boot
  MAINTAINERS: Downgrade the functional testing section to "Odd Fixes"
  MAINTAINERS: Remove myself from various sections
  MAINTAINERS: Update the s390x maintainers
  MAINTAINERS: Update S390-ccw boot maintainers/reviewers
  hw/acpi: generic_event_device: Don't call qdev_get_machine in initfn
  hw/arm: fsl-imx6: Don't call qdev_get_machine in soc init
  hw/arm: fsl-imx8mp: Don't call qdev_get_machine in soc init
  hw/arm: fsl-imx7: Don't call qdev_get_machine in soc init
  hw/arm: xlnx-zynqmp: Don't call qdev_get_machine in soc init
  hw/riscv: microchip_pfsoc: Don't call qdev_get_machine in soc init
  hw/riscv: sifive_e: Don't call qdev_get_machine in soc init
  target/mips/cpu: Move initialization of memory region to realize function
  target/xtensa/cpu: Move initialization of memory region to realize function

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-16 10:43:15 +00:00
Peter Maydell
9378149187 Merge tag 'linux-user-for-v11-pull-request' of https://github.com/hdeller/qemu-hppa into staging
Two linux-user patches

Two linux-user patches from Razvan Ghiorghe.

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCabRXkwAKCRD3ErUQojoP
# X8E4AQDtltuCmD+RnJ5yWNAh4Rx8kOU/tChL8kE44NjMz9HdxAEA37DKINiPHCOs
# G7kmfKqwUpJWVSXeMjUp0iaNOUydbAw=
# =ahOd
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri Mar 13 18:29:39 2026 GMT
# gpg:                using EDDSA key BCE9123E1AD29F07C049BBDEF712B510A23A0F5F
# gpg: Good signature from "Helge Deller <deller@gmx.de>" [unknown]
# gpg:                 aka "Helge Deller <deller@kernel.org>" [unknown]
# gpg:                 aka "Helge Deller <deller@debian.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: 4544 8228 2CD9 10DB EF3D  25F8 3E5F 3D04 A7A2 4603
#      Subkey fingerprint: BCE9 123E 1AD2 9F07 C049  BBDE F712 B510 A23A 0F5F

* tag 'linux-user-for-v11-pull-request' of https://github.com/hdeller/qemu-hppa:
  linux-user: fix mremap with old_size=0 for shared mappings
  linux-user: Fix zero_bss for RX PT_LOAD segments

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-16 10:42:41 +00:00
Eric Farman
bc4ee6025a MAINTAINERS: Add another reviewer to s390x boot
Jason offered to help review this area of code;
let's make sure he's notified of changes.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Message-ID: <20260313194810.1844241-2-farman@linux.ibm.com>
Acked-by: Jason J. Herne <jjherne@linux.ibm.com>
Acked-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:32 +01:00
Thomas Huth
3aaa367c15 MAINTAINERS: Downgrade the functional testing section to "Odd Fixes"
I won't have that much time for QEMU anymore in the future, so downgrade
the status of the "functional testing framework" section to "Odd Fixes"
to avoid wrong expectations. While we're at it, also switch to my other
e-mail address here that I'm already using for the other sections where
I am still listed as maintainer / reviewer.

Message-ID: <20260313113424.15583-5-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:32 +01:00
Thomas Huth
d217eebe15 MAINTAINERS: Remove myself from various sections
I likely won't have much time in the future for QEMU anymore, so
remove myself from various sections that have already enough other
maintainers / reviewers.

Message-ID: <20260313113424.15583-4-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:32 +01:00
Thomas Huth
a76014b193 MAINTAINERS: Update the s390x maintainers
I'm going to move to another project next month, so I will not have
enough time to take care of s390x patches anymore. Fortunately,
Cornelia volunteered to take over the job of collecting s390x patches,
and Eric and Matthew offered help to back her up, so we can keep
the "S390 general architecture support" section in the "supported"
state. Thanks for your help, Cornelia, Eric and Matthew!

Message-ID: <20260313113424.15583-3-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Eric Farman <farman@linux.ibm.com>
Acked-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Jared Rossi
7ae0f49287 MAINTAINERS: Update S390-ccw boot maintainers/reviewers
Christian Borntraeger is no longer active in this space.  Promote myself to
maintainer and demote Christian to reviewer.

Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
Acked-by: Eric Farman <farman@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260310142118.1120291-1-jrossi@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260313113424.15583-2-thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
3b0f7a0834 hw/acpi: generic_event_device: Don't call qdev_get_machine in initfn
Calling qdev_get_machine() in the acpi_ged_initfn function would result
in the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-aarch64 -S -display none -M virt -device acpi-ged,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the ram slots of the machine. So instead of initialising the GED in
the init let's instead do it in the realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-8-alistair.francis@wdc.com>
[thuth: Replaced soc_init with acpi_ged_initfn in the patch description]
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
148dec4486 hw/arm: fsl-imx6: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-aarch64 -S -display none -M virt -device fsl-imx6,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of initialising the CPUs in
the SoC init let's instead do it in the realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-7-alistair.francis@wdc.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
b67d0bcdd4 hw/arm: fsl-imx8mp: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-aarch64 -S -display none -M virt -device fsl-imx8mp,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of initialising the CPUs in
the SoC init let's instead do it in the realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-6-alistair.francis@wdc.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
99757d5574 hw/arm: fsl-imx7: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-aarch64 -S -display none -M virt -device fsl-imx7,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of initialising the CPUs in
the SoC init let's instead do it in the realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-5-alistair.francis@wdc.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
f70ee77f3c hw/arm: xlnx-zynqmp: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-aarch64 -S -display none -M virt -device xlnx-zynqmp,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of initialising the CPUs in
the SoC init let's instead do it in the realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-4-alistair.francis@wdc.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:31 +01:00
Alistair Francis
aa12d98d02 hw/riscv: microchip_pfsoc: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-riscv64 -S -display none -M virt -device microchip.pfsoc,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of setting the CPU
num-harts in the init function let's set it in realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-3-alistair.francis@wdc.com>
[thuth: Fix a complaint from checkpatch.pl with regards to multi-line comment]
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:36:19 +01:00
Alistair Francis
b0c9d8c126 hw/riscv: sifive_e: Don't call qdev_get_machine in soc init
Calling qdev_get_machine() in the soc_init function would result in
the following assert

    ../hw/core/qdev.c:858: qdev_get_machine: Assertion `dev' failed.

when trying to run

    ./qemu-system-riscv64 -S -display none -M virt -device riscv.sifive.e.soc,help

as the machine wasn't created yet. We call qdev_get_machine() to obtain
the number of CPUs in the machine. So instead of setting the CPU
num-harts in the init function let's set it in realise where the machine
will exist.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260312043158.4191378-2-alistair.francis@wdc.com>
[thuth: Fix a complaint from checkpatch.pl with regards to multi-line comment]
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-03-16 11:35:45 +01:00
Thomas Huth
0dcaa42694 target/mips/cpu: Move initialization of memory region to realize function
When introspecting the Loongson-3A4000 CPUs from the command line, QEMU
currently crashes:

 $ ./qemu-system-mips64el -device Loongson-3A4000-mips64-cpu,help
 qemu-system-mips64el: ../../devel/qemu/system/physmem.c:1401:
  register_multipage: Assertion `num_pages' failed.
 Aborted (core dumped)

Move the initialization of the memory regions to the realize function
to fix this problem.

Reported-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <87y0jxzdrk.fsf@pond.sub.org>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260311211629.118608-1-thuth@redhat.com>
2026-03-16 10:16:25 +01:00
Thomas Huth
7b743d01c3 target/xtensa/cpu: Move initialization of memory region to realize function
When introspecting the xtensa CPUs from the command line, QEMU currently
crashes:

 $ ./qemu-system-xtensa -device dc233c-xtensa-cpu,help
 qemu-system-xtensa: ../../devel/qemu/system/physmem.c:1401:
  register_multipage: Assertion `num_pages' failed.
 Aborted (core dumped)

Move the initialization of the memory regions to the realize function
to fix this problem.

Reported-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260311202503.107026-1-thuth@redhat.com>
2026-03-16 10:16:25 +01:00
Peter Maydell
ed44618b8e tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays
Older versions of gcc with -Wformat-overflow=2 don't like the usage of
fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/aspeed_gpio-test.c: In function ‘test_set_input_pins’:
../tests/qtest/aspeed_gpio-test.c:149:36: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/aspeed_gpio-test.c:149:13: note: ‘sprintf’ output between 7 and 17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This can't actually happen because of the limited size of the values
being substituted in.  However rather than require readers to check
whether the arrays really have been declared large enough, we prefer
to use g_strdup_printf() for this kind of string work.

Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310153334.3063224-3-peter.maydell@linaro.org
2026-03-13 13:27:57 +00:00
Peter Maydell
1d3926e271 tests/qtest/ast2700-gpio-test: Use g_strdup_printf() instead of char arrays
Older versions of gcc with -Wformat-overflow=2 don't like the usage of
fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/ast2700-gpio-test.c: In function ‘test_input_pins’:
../tests/qtest/ast2700-gpio-test.c:54:36: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/ast2700-gpio-test.c:54:13: note: ‘sprintf’ output between 7 and 17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This can't actually happen because of the limited size of the values
being substituted in.  However rather than require readers to check
whether the arrays really have been declared large enough, we prefer
to use g_strdup_printf() for this kind of string work.

Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310153334.3063224-2-peter.maydell@linaro.org
2026-03-13 13:27:57 +00:00
Peter Maydell
62272f9f88 tests/qtest/arm-cpu-features: Use g_strdup_printf() instead of char arrays
Older versions of gcc with -Wformat-overflow=2 don't like the usage of
fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/arm-cpu-features.c: In function ‘test_query_cpu_model_expansion_kvm’:
../tests/qtest/arm-cpu-features.c:578:35: error: ‘%u’ directive writing
between 1 and 10 bytes into a region of size 5
[-Werror=format-overflow=]

These can't actually happen because of the limited size of the values
being substituted in.  However rather than require readers to check
whether the arrays really have been declared large enough, we prefer
to use g_strdup_printf() for this kind of string work.

Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310151507.2973843-3-peter.maydell@linaro.org
2026-03-13 13:27:50 +00:00
Peter Maydell
632d7bc0ec tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays
Older versions of gcc with -Wformat-overflow=2 don't like the usage of
fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/ast2700-sgpio-test.c: In function ‘test_output_pins’:
../tests/qtest/ast2700-sgpio-test.c:27:33: error: ‘sprintf’ may write a
terminating nul past the end of the destination
[-Werror=format-overflow=]

../tests/qtest/ast2700-sgpio-test.c: In function ‘test_irq_level_high’:
../tests/qtest/ast2700-sgpio-test.c:85:33: error: ‘sprintf’ may write a
terminating nul past the end of the destination
[-Werror=format-overflow=]

These can't actually happen because of the limited size of the values
being substituted in.  However rather than require readers to check
whether the arrays really have been declared large enough, we prefer
to use g_strdup_printf() for this kind of string work.

Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-id: 20260310151507.2973843-2-peter.maydell@linaro.org
2026-03-13 13:27:50 +00:00
Peter Maydell
4e188a1daa MAINTAINERS: Remove Chris Browy
Chris Browy's listed email address is undeliverable:

The recipient server did not accept our requests to connect; it
times out on attempts to connect by my sending mail server (gmail):
  [avery-design.com 99.83.249.127: timed out]
  [avery-design.com 75.2.78.167: timed out]

Remove his name from the file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-7-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Peter Maydell
931f8e6457 MAINTAINERS: Remove Andrey Smirnov
Andrey Smirnov doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-6-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Peter Maydell
c32149464f MAINTAINERS: Remove Radoslaw Biernacki
Radoslaw Biernacki doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-5-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Peter Maydell
838b10dab3 MAINTAINERS: Remove Eduardo Habkost
Eduardo Habkost doesn't wish to be listed in MAINTAINERS any more;
remove his email, and also the git trees he used to use.

Move the QOM boilerplate conversion script scripts/codeconverter
to "Orphan" status, as it no longer has any listed maintainers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-4-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Peter Maydell
acb2517441 MAINTAINERS: Remove Cameron Esfahani
Cameron Esfahani doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-3-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Peter Maydell
fdb23230ee MAINTAINERS: Remove Hannes Reinecke
Hannes Reinecke doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.

As 'megasas' no longer has any listed maintainers, move it to
"Orphan" status.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-2-peter.maydell@linaro.org
2026-03-13 13:26:21 +00:00
Tao Ding
f9b16f7915 hw/dma/pl080: Ignore bottom 2 bits of LLI register
The PL080 channel LLI (linked list item) register has bits [31:2] of
the address of the next LLI in bits [31:2], with bit [1] reserved
and bits [0] the AHB master select. We were incorrectly using the
whole register value as the address, which meant that if the guest
programmed something into the AHB master select bit we would use
an incorrect address, and read incorrect data from memory.

The following reproducer creates a setup which has bit 0 set in
an LLI value:

Configuration
    ../configure --target-list=arm-softmmu --enable-debug
Reproducer
    ./qemu-system-arm -M versatilepb -m 128M -nographic -S \
     -device loader,addr=0x00002000,data=0x00000004,data-len=4 \
     -device loader,addr=0x00002004,data=0x00001004,data-len=4 \
     -device loader,addr=0x00002008,data=0x00000000,data-len=4 \
     -device loader,addr=0x0000200c,data=0x9e4bf001,data-len=4 \
     -device loader,addr=0x00000000,data=0x44332211,data-len=4 \
     -device loader,addr=0x00000004,data=0x88776655,data-len=4 \
     -device loader,addr=0x00001000,data=0x00000000,data-len=4 \
     -device loader,addr=0x00001004,data=0x00000000,data-len=4 \
     -device loader,addr=0x10130030,data=0x00000001,data-len=4 \
     -device loader,addr=0x10130100,data=0x00000000,data-len=4 \
     -device loader,addr=0x10130104,data=0x00001000,data-len=4 \
     -device loader,addr=0x10130108,data=0x00002001,data-len=4 \
     -device loader,addr=0x1013010C,data=0x1e4bf001,data-len=4 \
     -device loader,addr=0x10130110,data=0x0000c001,data-len=4

The correct result with this bug fix:
    (qemu) xp /1wx 0x00001000
     00001000: 0x44332211
    (qemu) xp /1wx 0x00001004
     00001004: 0x88776655

Cc: qemu-stable@nongnu.org
Signed-off-by: Tao Ding <dingtao0430@163.com>
[PMM: Adjusted commit message]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: cb35c1b622674da7a2b70691402132f691933f2c.1773301927.git.dingtao0430@163.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-13 12:27:24 +00:00
Tao Ding
b6e61d1cc3 hw/dma/pl080: Update interrupts after pl080_run()
In the codepath in pl080_write() where we run the DMA engine
after a change in the channel configuration register, we were
missing a pl080_update() call, which meant that we weren't
raising any interrupts generated by that DMA transfer.

A repro case for this is to program the PL080 and then
check the interrupt status by looking at the PL190 status
register, since the PL080 interrupt output is connected
to input 17 of the PL190. We look at the register value via
the QEMU monitor:

Reproducer
    ./qemu-system-arm -M versatilepb -m 128M -nographic -S \
    -device loader,addr=0x00000000,data=0x11223344,data-len=4 \
    -device loader,addr=0x00001000,data=0x00000000,data-len=4 \
    -device loader,addr=0x10130030,data=0x00000001,data-len=4 \
    -device loader,addr=0x10130100,data=0x00000000,data-len=4 \
    -device loader,addr=0x10130104,data=0x00001000,data-len=4 \
    -device loader,addr=0x10130108,data=0x00000000,data-len=4 \
    -device loader,addr=0x1013010C,data=0x9e4bf001,data-len=4 \
    -device loader,addr=0x10130110,data=0x0000c001,data-len=4

Qemu monitor
    (qemu) xp /1wx 0x10140008
    10140008: 0x00000000

The correct result after this fix:
    (qemu) xp /1wx 0x10140008
    10140008: 0x00020000

Cc: qemu-stable@nongnu.org
Signed-off-by: Tao Ding <dingtao0430@163.com>
Message-id: 7584486ba62bc6d767c0d132dc843067f8c5efff.1773301927.git.dingtao0430@163.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: Adjusted commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-13 12:20:46 +00:00
Peter Maydell
37c9f6fce5 hw/dma/pl080: Handle bogus swidth and dwidth in transfers
The PL080 TRM states that the DWidth and SWidth fields of the channel
control registers can only validly specify widths up to 32 bits (i.e.
values from 0 to 2) and all other values are reserved.

Currently we don't check this, so if the guest specifies an invalid
value we will transfer more data into our local 'buff[]' array than
it can hold.

Check the widths; since the TRM doesn't clearly specify any behaviour
for what to do on invalid values, we choose to log them and then
ignore the channel for transfers.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3203
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306152140.2191653-1-peter.maydell@linaro.org
2026-03-13 11:19:57 +00:00
Razvan Ghiorghe
5e5b278d2b linux-user: fix mremap with old_size=0 for shared mappings
When old_size is zero and old_address refers to a shareable mapping,
mremap() should create a new mapping of the same pages according to the
mremap(2) man page. The MREMAP_MAYMOVE flag must be specified in this case.

Previously, QEMU's target_mremap() rejected this valid case with EFAULT
during the initial validation, before checking for the special
old_size == 0 behaviour.

This patch adds proper handling for old_size == 0:
- Validates that MREMAP_MAYMOVE flag is set (required by man spec)
- Passes the call through to the host mremap()
- Creates a new mapping without invalidating the original, with both
  being valid and sharing the same physical memory frames.
- Ensures the new mapping address falls within the valid guest address
  region before returning it to the guest.

Tested with the reproducer from the issue on qemu-riscv64, qemu-hppa,
and qemu-aarch64.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3105
Signed-off-by: Razvan Ghiorghe <razvanghiorghe16@gmail.com>
Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-12 21:03:48 +01:00
Razvan Ghiorghe
2ff529c6f6 linux-user: Fix zero_bss for RX PT_LOAD segments
zero_bss() incorrectly assumed that any PT_LOAD containing .bss must be
writable, rejecting valid ELF binaries where .bss overlaps the tail of
an RX file-backed page.

Instead of failing, temporarily enable write access on the overlapping
page to zero the fractional bss range, then restore the original page
permissions once initialization is complete.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3179
Signed-off-by: Razvan Ghiorghe <razvanghiorghe16@gmail.com>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-12 21:03:48 +01:00
Martin Kröning
c400bd4058 semihosting/uaccess: Use the cpu_internal_tswap() functions
The semihosting ABI [1] states:
> Multi-byte values in memory must be formatted as pure little-endian or pure
> big-endian to match the endianness mapping configuration of the processor.

This commits ensures that semihosting data is properly byte-swapped if
the guest's CPU is currently in a different runtime-configurable
endianness than the host's CPU.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3258
Buglink: https://github.com/taiki-e/semihosting/issues/18

[1]: https://github.com/ARM-software/abi-aa/blob/2025Q1/semihosting/semihosting.rst#the-semihosting-interface

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260311-semihosting-cpu-tswap-v3-3-8e239575ec08@eonerc.rwth-aachen.de
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-03-12 19:24:24 +00:00