]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
12 hours agoMerge tag 'accel-20260618' of https://github.com/philmd/qemu into staging master staging
Stefan Hajnoczi [Thu, 18 Jun 2026 20:28:12 +0000 (16:28 -0400)] 
Merge tag 'accel-20260618' of https://github.com/philmd/qemu into staging

Accelerators patches queue

- Avoid double hv_vcpu_destroy() call during teardown on HVF ARM
- Constify various AddressSpace/MemoryRegionCache arguments
- Clarify physical_memory_*() API in "system/physmem.h"
- Extract "accel/tcg/cpu-loop.h" out of "exec/cpu-common.h"
- Restrict few TCG-specific code
- Remove pre-C11 check
- Various header cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmoz5EIACgkQ4+MsLN6t
# wN4pJhAAtQ+qMRS49PoXnyBkPnuTZlnIjhy0gpXp7wRAiZiOQFjgIkX7F8YKz/aQ
# Hu15PIsbvH7mjzTiSfW48Km/3qzzCx0F0U9KsNaZLCJ+/HVctaN94slewgAfA6qc
# sEuVq6u70oaeGjYVM1wmUXhK3h2vfpWPnE81qjUJBnjsfC99T24TMmtY0CGw8f9J
# UJ6SpkwlES9B6YeJ0GFACCZMTMD0QiXuAtKzfL/2aD1Ts31qY9DG/bdlmDJJ3R0Y
# y/ZcWjvPQE4NDdcMfuW4/ywz7sAX/h0XreMIb2OL5ppE0qYDBqpB6SFGWjg4uQ5r
# yDhzVhdrPT2HxXl9LTYOjlAQEHrs3Pm0170G7OwCVs+gtlloZqV08sJ+61J2jv73
# OH2YsQh/sIy9QUPZxI+LloBRLApMg5mjY9KP5DPH2qmsOpvE4fj07hq+EXS3OCuz
# L+3TMD0fhxI+RHg8/zaqidc3+Xb4zN/H069Qkjx0wyQI7QMmfK4rU4CJV6MP6d9r
# r9qngtxVfbGfXpaDqan73TjKHx/ZnOgNQqrfaeypiAkiyIoOPRzeG3H6T17HlOBX
# S2Pz4vllzs0SS1vC4OKnS1BI2eEf6ge14ozKGQqh5qOvfKlTy4s8fXX/2MKIaqMG
# cVE4lkL2suLoxmOu2zsEvDBCVUaRLWZLJZib1J4B/UIvvC3rpQs=
# =Jj+Z
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 18 Jun 2026 08:27:46 EDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'accel-20260618' of https://github.com/philmd/qemu: (48 commits)
  accel/tcg: Restrict headers being TCG specific
  accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'
  accel/tcg: Have cpu_loop_exit_requested() take const @cpu argument
  accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_unwind_state_data() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_exec_step_atomic() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_exec() out of 'exec/cpu-common.h'
  accel/tcg: Remove cpu_loop_exit() stub
  hw/s390x/ipl: Remove TCG dependency in handle_diag_308()
  system/memory: Rename cpu_exec_init_all() -> machine_memory_init()
  system/memory: Remove unnecessary CONFIG_USER_ONLY guards
  exec/cpu-common.h: Avoid including unused exec/page-protection.h header
  exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header
  exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header
  exec/cpu-common.h: Include missing 'qemu/thread.h' header
  ui/cocoa: Use qemu_input_map_osx_to_linux
  util/cutils: drop qemu_strnlen() in favor of strnlen()
  configure: honor --extra-ldflags when forced to use objc_LINKER
  meson: build macOS signed binary as part of the default target
  accel/tcg: Restrict IOMMU declarations
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19 hours agoMerge tag 'pull-9p-20260617' of https://github.com/cschoenebeck/qemu into staging
Stefan Hajnoczi [Thu, 18 Jun 2026 13:47:35 +0000 (09:47 -0400)] 
Merge tag 'pull-9p-20260617' of https://github.com/cschoenebeck/qemu into staging

9pfs changes:

- Fix guest-triggerable assertion fault (DoS) with the legacy Twstat
  rename handler.

- Code deduplication.

# -----BEGIN PGP SIGNATURE-----
#
# iQJLBAABCgA1FiEEltjREM96+AhPiFkBNMK1h2Wkc5UFAmoyv68XHHFlbXVfb3Nz
# QGNydWRlYnl0ZS5jb20ACgkQNMK1h2Wkc5V2iA/+JtfP5LZPp+UNPKtXquaJl+8P
# FPqU9Y6Vh8cbC/SetjCsVQGW0yhhsyJiGgd56qiz0WEQC5rm4katMJm7iqLR+GzA
# +S6IubuFifKTudiRCgu1rWuOhYWaHd7F9SeiMHXj5vq0bRNkI78DbjA6O6O81rvM
# o8IhTR7IoySK9wOZ57H/va6Kp/t7OeoZEVMjAqCBXPgIUBCnpJCecpvwgkIqK4qU
# MirRmgD94gSGJXrXUO+rx5hJUgcs1jwRuOvjptipLuRElCrd2L4bMXnhLSbyhT0C
# G25aUDy1VwnPmJZLuROPnsxdr+PCWDwLW5QdVM9kT4AWS9p1Y8A6v/FSdwt84D+5
# jlV0XpYGcfXUCoIqKEm0i7FXxr/FiZCh1ZUiAD85SI4PGbM770AgRZt3JA+1xoFT
# 0Ao+9jAtRCFQ1sjB9PTiudzCYNoNeal929ey7r8kkkquMfOUZvHqtAJnPSxFGvmj
# 5kUKGV198xbwbntetJVup/iiBMG4+9fnpFg4tHmcibCUHKfYtnFCnzjcd0DpvJRl
# BS1+0b4OLz5Mxt5N6jU0WZaHDDSgWA/W3GvAhNRTsIBMOPtqtVMejGs3l0LDR8+M
# PD3i3hiA/rmRUWlYqhy1PhJzpZ0TH66Dblv9F2Ve87h6QsEa1HhESjcBY9e7TI8t
# hu5c7lGx3D3uaiXU2xQ=
# =2xaR
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 11:39:27 EDT
# gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
# gpg:                issuer "qemu_oss@crudebyte.com"
# gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" [unknown]
# gpg: Note: This key has expired!
# Primary key fingerprint: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
#      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395

* tag 'pull-9p-20260617' of https://github.com/cschoenebeck/qemu:
  hw/9pfs: consolidate name validation with check_name()
  hw/9pfs: reject . and .. in Twstat rename
  hw/9pfs: fix abort due to illegal name with Twstat rename

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19 hours agoMerge tag 'ui-input-pr-v1' of https://gitlab.com/marcandre.lureau/qemu into staging
Stefan Hajnoczi [Thu, 18 Jun 2026 13:47:17 +0000 (09:47 -0400)] 
Merge tag 'ui-input-pr-v1' of https://gitlab.com/marcandre.lureau/qemu into staging

UI patches for 2026-06-17

- retire input-legacy.c
- sdl2 fixes

To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmoyu8oACgkQ2ujhCXWW
# nOX6RA//TQRZhYpHWGZSKsBWkC1UXPSHXfsbaMrrv9L8U66nXxN9FZgqukisw8rq
# udUNHzdhfRVlTOcEDYscgNeGTIIZ/2phFrNOE0759Q4BIg7CNaEBhvjNmzp/tAVV
# XImS3RzzVdE2RJKN8DAaFKqCAIa2NF8ZPr7NtjIK/VwUPQ0AtfY/plVGtfkChSTx
# +WZt2gTkli0WMGYFz0ZXttqtfuts1fCTxyNUwBItNQkgXzM9+lPmIHYOSF4huPa1
# ek03WVrA6k9ke+A9lNpSl1l/a6g8FBOfHSzSBBWhjT8pQN0iChLzxzkBXWKbvBOk
# PhprHBTNVzY1ogLp3WupVcXTDl/bgaHS/4cv75plR5qHrZC7Z0sDachr7MtVvrDW
# SsSV7Ni2ggiXJ8EspGPKNQ1PFV69TmwSeRVGaJUlXUDdr25k6sN59sqLpwBMZb/O
# UwxeqUI3LXmFdjzGoGHmHdB4UneENOEHoTBTqj/lkHjm+sxB504/ZIewhK7bjtlr
# efi11fRB3+XAUZVrC9BCmaeD+ZZANqQ5PXex8KfZpD5+H7VuJVEnAIIvCQqNCg4i
# UGDuqWV7qxsVP6jMdidtUYKPiKZEGChAYGsYNvoJ+mXusebkJLHY6zUyIcMEcJCL
# Bu/oFF9PaPYBBvvS45hzn5MVgR//ylWZpEFqtqRzXYrxCzruvRE=
# =VcKS
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 11:22:50 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-input-pr-v1' of https://gitlab.com/marcandre.lureau/qemu: (27 commits)
  ui/sdl2: Set GL ES profile before creating initial GL context
  ui/sdl2: Explicitly specify EGL platform
  ui/pixman: fix zero rowstride in qemu_pixman_image_new_shareable()
  ui/input: Have qemu_input_is_absolute() take a const QemuConsole
  tools/qemu-vnc: Have console_get_mouse/keyboard take const QemuConsole
  ui/input: remove old LED handler broadcast queue
  ui/dbus: switch LED handling to Notifier-based input API
  ui/spice: switch LED handling to Notifier-based input API
  ui/vnc: switch LED handling to Notifier-based input API
  hw/input/virtio-input-hid: use qemu_input_handler_set_leds_mask() for LED state
  hw/input/hid: use qemu_input_handler_set_leds_mask() for LED state
  hw/input/ps2: use qemu_input_handler_set_leds_mask() for LED state
  ui/input: qemu_input_handler_register to warn for unused result
  hw/m68k: keep QemuInputHandlerState in next-kbd
  hw/input: keep QemuInputHandlerState in stellaris
  hw/input: keep QemuInputHandlerState in adb-kbd
  hw/arm: keep QemuInputHandlerState in musicpal
  hw/input/ps2: keep QemuInputHandlerState in PS2State
  ui/input: add LED state tracking to QemuInputHandlerState
  ui/input: remove dead declaration
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19 hours agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Stefan Hajnoczi [Thu, 18 Jun 2026 13:46:49 +0000 (09:46 -0400)] 
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* GNU/Hurd support
* More patches to support qemu-ga builds with clang-cl
* gdbstub: Update x86 control register bits
* rust: fix incorrect dependency in Cargo.toml
* target/i386: apply mod to immediate count of an RCL/RCR operation

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmoynoYUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNaIgf8D6Nb0jy5hP2t43s6ZT5VEM+k889p
# 89TiRelrnzvcrZ8GhfB+JeA87LCd0pNn0nIspsMzA6butOzO/tlft2vLlNEXevli
# MNhZVdj2PNGwN3TqW4EM4zM1VmLFxMshEEtAcBtHkUCCxlkscju+zSmwnJ0zzHy/
# fQpOAXO3HtDlHEzLF1QWjjpHQd6IorjeWqRVzH8i+djlgk6YGn51mNYOwgvBOSUZ
# IET2FVabLpJkoQWlr11mt3woL+cxi5tKeVFAUzHB6q6rvkbLp85tyDx2nW4O+M8C
# G7Hb82z/nV6Rh0E6ehq3x0DDdYTxt1ARyljnx3QQIsZo5uAVP+1WtqIgkg==
# =nh+D
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 09:17:58 EDT
# 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:
  qga/vss: Drop unused define uuid(x)
  qga/vss: Remove unused undefs
  qga/vss: Use MAX_PATH instead of PATH_MAX
  qga/meson: Allow to use MSVC message compiler 'mc'
  qga/meson: Use windows.compile_resources instead of custom_target
  qga/meson: Remove unused lib stdc++
  qga/win: Use swprintf instead of snwprintf
  Make copy_file_range non-static on GNU/Hurd
  block/file-posix: Clean up sys/ioctl import
  tpm: Add conditional to not compile ioctls on GNU/Hurd
  Add GNU/Hurd host_os=gnu
  Include new arbitrary limits if not already defined
  gdbstub: Update x86 control register bits
  target/i386: add more easy cases to gen_eflags_adcox
  target/i386: apply mod to immediate count of an RCL/RCR operation
  rust: fix incorrect dependency in Cargo.toml

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
20 hours agoaccel/tcg: Restrict headers being TCG specific
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 11:58:21 +0000 (13:58 +0200)] 
accel/tcg: Restrict headers being TCG specific

Forbid including TCG-specific headers in non-TCG builds.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-12-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 17:11:15 +0000 (19:11 +0200)] 
accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'

Move the following TCG-specific cpu_loop_exit_*() declarations
out of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one, documenting them:

 - cpu_loop_exit_noexc()
 - cpu_loop_exit_atomic()
 - cpu_loop_exit_restore()
 - cpu_loop_exit()

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-11-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Have cpu_loop_exit_requested() take const @cpu argument
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 09:57:05 +0000 (11:57 +0200)] 
accel/tcg: Have cpu_loop_exit_requested() take const @cpu argument

Since the CPUState argument is simply read-only accessed, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-9-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 15:59:57 +0000 (17:59 +0200)] 
accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'

Move the TCG-specific cpu_restore_state() declaration out
of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-8-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Move cpu_unwind_state_data() out of 'exec/cpu-common.h'
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 15:55:22 +0000 (17:55 +0200)] 
accel/tcg: Move cpu_unwind_state_data() out of 'exec/cpu-common.h'

Move the TCG-specific cpu_unwind_state_data() declaration out
of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-7-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Move cpu_exec_step_atomic() out of 'exec/cpu-common.h'
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 15:53:26 +0000 (17:53 +0200)] 
accel/tcg: Move cpu_exec_step_atomic() out of 'exec/cpu-common.h'

Move the TCG-specific cpu_exec_step_atomic() declaration out
of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-6-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Move cpu_exec() out of 'exec/cpu-common.h'
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 16:23:35 +0000 (18:23 +0200)] 
accel/tcg: Move cpu_exec() out of 'exec/cpu-common.h'

In order to keep TCG-specific functions under a TCG
API namespace, add the "accel/tcg/cpu-loop.h" header
and move cpu_exec() declaration to it. Add a bit of
documentation.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-5-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: Remove cpu_loop_exit() stub
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 16:17:19 +0000 (18:17 +0200)] 
accel/tcg: Remove cpu_loop_exit() stub

Last commit removed the last non-TCG use of cpu_loop_exit().
This method is now only called within TCG files, so we can
remove its stub for non-TCG accelerators.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-4-philmd@oss.qualcomm.com>

20 hours agohw/s390x/ipl: Remove TCG dependency in handle_diag_308()
Philippe Mathieu-Daudé [Fri, 12 Jun 2026 13:51:22 +0000 (15:51 +0200)] 
hw/s390x/ipl: Remove TCG dependency in handle_diag_308()

Rather than calling a TCG specific method in s390_ipl_reset_request(),
have handle_diag_308() return whether a vCPU reset is pending, and use
that in the TCG DIAG helper to return to the main loop.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Message-Id: <20260617164035.70788-4-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Rename cpu_exec_init_all() -> machine_memory_init()
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 08:13:38 +0000 (10:13 +0200)] 
system/memory: Rename cpu_exec_init_all() -> machine_memory_init()

cpu_exec_init_all() is system specific: it initializes globals
for the memory subsystem. Rename it as machine_memory_init()
and restrict its declaration to 'system/' namespace.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616153754.93545-3-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Remove unnecessary CONFIG_USER_ONLY guards
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 08:11:40 +0000 (10:11 +0200)] 
system/memory: Remove unnecessary CONFIG_USER_ONLY guards

This header is only used when building system units,
checking for CONFIG_USER_ONLY is pointless.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616153754.93545-2-philmd@oss.qualcomm.com>

20 hours agoexec/cpu-common.h: Avoid including unused exec/page-protection.h header
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 06:16:02 +0000 (08:16 +0200)] 
exec/cpu-common.h: Avoid including unused exec/page-protection.h header

Since commit e74781c0888e ("exec/cpu: Extract page-protection
definitions to page-protection.h") the "exec/cpu-common.h" isn't
using anything defined in "exec/page-protection.h"; remove it.

Include it in few files where it is currently pulled in indirectly,
otherwise we'd get:

  linux-user/qemu.h:182:22: error: ‘PAGE_READ’ undeclared
    182 | #define VERIFY_READ  PAGE_READ
        |                      ^~~~~~~~~
  target/loongarch/cpu_helper.c:329:25: error: use of undeclared identifier 'PAGE_READ'
    329 |         context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
        |                         ^
  target/loongarch/cpu_helper.c:329:37: error: use of undeclared identifier 'PAGE_WRITE'
    329 |         context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
        |                                     ^
  target/loongarch/cpu_helper.c:329:50: error: use of undeclared identifier 'PAGE_EXEC'
    329 |         context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
        |                                                  ^
  target/ppc/mmu-hash32.h:98:20: error: use of undeclared identifier 'PAGE_READ'
     98 |             prot = PAGE_READ | PAGE_WRITE;
        |                    ^
  target/ppc/mmu-hash32.h:98:32: error: use of undeclared identifier 'PAGE_WRITE'
     98 |             prot = PAGE_READ | PAGE_WRITE;
        |                                ^
  hw/ppc/ppc_booke.c:39:17: error: use of undeclared identifier 'PAGE_RWX'
     39 |     tlb->prot = PAGE_RWX << 4 | PAGE_VALID;
        |                 ^
  hw/ppc/ppc_booke.c:39:33: error: use of undeclared identifier 'PAGE_VALID'
     39 |     tlb->prot = PAGE_RWX << 4 | PAGE_VALID;
        |                                 ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617160426.64461-6-philmd@oss.qualcomm.com>

20 hours agoexec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 06:16:02 +0000 (08:16 +0200)] 
exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header

Since commit efe25c260cd ("include/exec: Split out
accel/tcg/cpu-mmu-index.h") the "exec/cpu-common.h" isn't using
anything defined in "tcg/debug-assert.h".

Include it in target/loongarch/tcg/tcg_cpu.c however, where it
is required but included indirectly, otherwise we'd get:

  target/loongarch/tcg/tcg_cpu.c:291:5: error: call to undeclared function 'tcg_debug_assert'
  291 |     tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
      |     ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617160426.64461-5-philmd@oss.qualcomm.com>

20 hours agoexec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 06:16:02 +0000 (08:16 +0200)] 
exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header

We neglected to remove the "exec/vaddr.h" header when moving
cpu_memory_rw_debug() around in commit e9048f099b3 ("exec/cpu:
Declare cpu_memory_rw_debug() in 'hw/core/cpu.h' and document").

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617160426.64461-4-philmd@oss.qualcomm.com>

20 hours agoexec/cpu-common.h: Include missing 'qemu/thread.h' header
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 11:10:22 +0000 (13:10 +0200)] 
exec/cpu-common.h: Include missing 'qemu/thread.h' header

Unfortunately we need to include "qemu/thread.h" -- which is
currently indirectly pulled in -- to get the QemuMutex type
definition:

  extern QemuMutex qemu_cpu_list_lock;

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617160426.64461-3-philmd@oss.qualcomm.com>

20 hours agoui/cocoa: Use qemu_input_map_osx_to_linux
Akihiko Odaki [Thu, 4 Jun 2026 06:39:32 +0000 (15:39 +0900)] 
ui/cocoa: Use qemu_input_map_osx_to_linux

ui/cocoa used to have a conversion table from macOS keycode to Linux
key code. It is an unnecessary redundancy as ui/input-keymap.c already
has such a table. Worse, I added an incorrect mapping of kVK_JIS_Eisu and
kVK_JIS_Kana with commit 708b72557ff5 ("ui/cocoa: Support unique keys of
JIS keyboards").

According to the following documentations, the definitions in
ui/keycodemapdb/keymaps.csv, which ui/input-keymap.c uses, are correct:
https://developer.apple.com/documentation/uikit/uikeyboardhidusage/uikeyboardhidusagekeyboardlang1?language=objc
https://developer.apple.com/documentation/uikit/uikeyboardhidusage/uikeyboardhidusagekeyboardlang2?language=objc
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/keyboard-japan-ime

Use qemu_input_map_osx_to_linux to eliminate the redundancy and
incorrect mappings.

Fixes: 708b72557ff5 ("ui/cocoa: Support unique keys of JIS keyboards")
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Philippe Mathieu-Daudé <philmd@mailo.com>
Message-ID: <20260604-osx-v3-1-453b4ee0e072@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agoutil/cutils: drop qemu_strnlen() in favor of strnlen()
Bin Guo [Sat, 30 May 2026 06:28:16 +0000 (14:28 +0800)] 
util/cutils: drop qemu_strnlen() in favor of strnlen()

There are only three call sites, and strnlen() is available on all
supported platforms (POSIX.1-2008, Windows via UCRT, MinGW).  Remove
the hand-rolled wrapper and use the standard function directly.

While here, align bsd-user/uaccess.c to use size_t for max_len/len,
matching linux-user/uaccess.c and eliminating a signed/unsigned mismatch.

Also remove the stale qemu_strnlen() entry from docs/devel/style.rst.

Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Bin Guo <guobin@linux.alibaba.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-ID: <20260530062816.59206-1-guobin@linux.alibaba.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agoconfigure: honor --extra-ldflags when forced to use objc_LINKER
Matt Jacobson [Mon, 15 Jun 2026 04:55:47 +0000 (00:55 -0400)] 
configure: honor --extra-ldflags when forced to use objc_LINKER

3220b38a8d had the side effect of making the individual target link steps
use objc_LINKER on macOS, because `coreaudio.m` became visible to Meson as
a source file.  (The preexisting presence of `cocoa.m` is masked by the
fact that it gets built into libsystem and then extracted back out as an
object file.)

`configure` correctly passes `$EXTRA_LDFLAGS` to the "C linker" and "C++
linker", but it neglected to do so for the "Objective-C linker".  Fix that.

Signed-off-by: Matt Jacobson <mhjacobson@me.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260615045547.23422-1-mhjacobson@me.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agomeson: build macOS signed binary as part of the default target
Emmanuel Blot [Tue, 9 Jun 2026 09:13:24 +0000 (11:13 +0200)] 
meson: build macOS signed binary as part of the default target

Signed-off-by: Emmanuel Blot <eblot@meta.com>
Tested-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260609-macos-default-signed-bin-v1-1-e013ccb5ccb7@meta.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agoaccel/tcg: Restrict IOMMU declarations
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 18:23:37 +0000 (20:23 +0200)] 
accel/tcg: Restrict IOMMU declarations

Move the two TCG-specific IOMMU method declarations from the
generic "exec/cpu-common.h" header to "accel/tcg/iommu.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616153633.93267-1-philmd@oss.qualcomm.com>

20 hours agoaccel/tcg: remove duplicate include
Osama Abdelkader [Wed, 26 Nov 2025 21:43:22 +0000 (23:43 +0200)] 
accel/tcg: remove duplicate include

tb-internal.h is included twice

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20251126214322.64855-1-osama.abdelkader@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agoaccel/hvf: Reduce hvf_kernel_irqchip_override scope
Philippe Mathieu-Daudé [Sat, 13 Jun 2026 14:12:58 +0000 (16:12 +0200)] 
accel/hvf: Reduce hvf_kernel_irqchip_override scope

hvf_kernel_irqchip_override is only used within the
accel/hvf/hvf-all.c file, no need to expose the symbol.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Message-Id: <20260613145356.88410-1-philmd@oss.qualcomm.com>

20 hours agoaccel/hvf: fix double hv_vcpu_destroy() causing teardown error on ARM
Matheus Tavares Bernardino [Tue, 14 Apr 2026 13:11:25 +0000 (06:11 -0700)] 
accel/hvf: fix double hv_vcpu_destroy() causing teardown error on ARM

The following callstack causes hv_vcpu_destroy() to be called twice,
producing HV_BAD_ARGUMENT on the already-destroyed handler:

hvf_vcpu_destroy
 |
 |_ hv_vcpu_destroy
 |
 |_ hvf_arch_vcpu_destroy
     |
     |_ hv_vcpu_destroy

The first hv_vcpu_destroy call covers both x86 and arm. Let's remove the
second one, as it is redundant.

This reverts commit feee55d36a1c5d494ee73812d279b439bb05137c.

Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <ee6f642af1dab29aaf99f86ac9254ddd25765bf8.1776172276.git.matheus.bernardino@oss.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotarget/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c
Philippe Mathieu-Daudé [Wed, 17 Jun 2026 15:56:01 +0000 (17:56 +0200)] 
target/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c

target/sparc/cpu.c implement a TCGCPUOps structure, which is
defined in "accel/tcg/cpu-ops.h":

  1040 static const TCGCPUOps sparc_tcg_ops = {
  ...

While this header is currently included indirectly, make the
inclusion explicit to avoid issue when refactoring unrelated
headers.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617160426.64461-2-philmd@oss.qualcomm.com>

20 hours agotarget/loongarch: Remove unused 'accel/accel-cpu-target.h' header
Philippe Mathieu-Daudé [Fri, 29 May 2026 14:15:01 +0000 (16:15 +0200)] 
target/loongarch: Remove unused 'accel/accel-cpu-target.h' header

"accel/accel-cpu-target.h" is to register accelerator target
specific hooks via TypeInfo::ACCEL_CPU_NAME(), which LoongArch
TCG frontend does not. Remove as unused header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-Id: <20260529194940.97143-2-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotarget/ppc: Restrict TCGTBCPUState to TCG
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 15:29:41 +0000 (17:29 +0200)] 
target/ppc: Restrict TCGTBCPUState to TCG

TCGTBCPUState is a structure used during TCG translation,
therefore not needed when TCG is not available.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616153432.92939-4-philmd@oss.qualcomm.com>

20 hours agotarget/arm: Restrict TCG specific headers
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 10:22:18 +0000 (12:22 +0200)] 
target/arm: Restrict TCG specific headers

Avoid including TCG-specific headers in non-TCG builds.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-2-philmd@oss.qualcomm.com>

20 hours agotarget/arm/ptw: Restrict PMSAv8 code to TCG
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 10:22:09 +0000 (12:22 +0200)] 
target/arm/ptw: Restrict PMSAv8 code to TCG

Armv8-M Protected Memory System Architecture can only be emulated,
therefore restrict it to TCG to avoid compiling it on hardware
accelerators.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20260616153432.92939-3-philmd@oss.qualcomm.com>

20 hours agotarget/arm: Better describe PMU depends on TCG or HVF
Philippe Mathieu-Daudé [Wed, 25 Jun 2025 21:54:23 +0000 (23:54 +0200)] 
target/arm: Better describe PMU depends on TCG or HVF

PMU is supported by TCG / HVF but not KVM. Make it
explicit rewriting '!KVM' as 'TCG || HVF' (ignoring
QTest, because vCPUs are not available there).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20251028054238.14949-57-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotarget/arm: Remove vcpu_dirty=true assigments in hvf_handle_exception()
Philippe Mathieu-Daudé [Wed, 22 Apr 2026 13:45:50 +0000 (15:45 +0200)] 
target/arm: Remove vcpu_dirty=true assigments in hvf_handle_exception()

Commit  2a425aae0b5 ("target/arm: ensure PSCI register updates
are flushed") manually sets %vcpu_dirty in hvf_handle_exception(),
but these calls follow calls to cpu_synchronize_state() which
itself sets %vcpu_dirty. Better have the generic CPU API handle
this, but add a pair of assertions when serializing the accelerator
state to be safe.

Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260423170229.64655-13-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotarget/arm: Only set CPU_INTERRUPT_EXITTB for TCG
Philippe Mathieu-Daudé [Wed, 25 Jun 2025 15:56:39 +0000 (17:56 +0200)] 
target/arm: Only set CPU_INTERRUPT_EXITTB for TCG

Commit 34c45d53026 ("target-arm: kvm - re-inject guest debug
exceptions") removed CPU_INTERRUPT_EXITTB from KVM, but it
also appears on HVF. Better to restrict it to TCG.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-Id: <20250630130937.3487-2-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotarget/i386: Report TPR accesses to HVF
Philippe Mathieu-Daudé [Mon, 16 Jun 2025 08:38:48 +0000 (10:38 +0200)] 
target/i386: Report TPR accesses to HVF

HVF should be able to handle task priority register accesses.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250616090632.55214-1-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
20 hours agotcg: Include missing 'qemu/bitops.h' header in tcg-gvec-desc.h
Philippe Mathieu-Daudé [Tue, 16 Jun 2026 10:23:18 +0000 (12:23 +0200)] 
tcg: Include missing 'qemu/bitops.h' header in tcg-gvec-desc.h

Include the missing 'qemu/bitops.h' header to avoid when refactoring
unrelated headers:

  In file included from target/arm/internals.h:34:
  include/tcg/tcg-gvec-desc.h:48:12: error: call to undeclared function 'extract32'
     48 |     return extract32(desc, SIMD_MAXSZ_SHIFT, SIMD_MAXSZ_BITS) * 8 + 8;
        |            ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616153432.92939-2-philmd@oss.qualcomm.com>

20 hours agoqom/object: Remove pre-C11 check
Philippe Mathieu-Daudé [Fri, 12 Jun 2026 13:05:33 +0000 (15:05 +0200)] 
qom/object: Remove pre-C11 check

We mandate a compiler supporting C11 since 2021-06-15 in
commit d22797ce36a ("configure: Use -std=gnu11"), thus the
max_align_t type definition exists. Remove what is now dead
code.

Note, C11 provides aligned_alloc(). Using it is left as a
future cleanup step.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260615091308.4458-3-philmd@oss.qualcomm.com>

20 hours agohw/xen/interface: Remove pre-C99 checks
Philippe Mathieu-Daudé [Fri, 12 Jun 2026 13:00:49 +0000 (15:00 +0200)] 
hw/xen/interface: Remove pre-C99 checks

We mandate a compiler supporting C99 since 2019-01-17 in
commit 7be41675f7c ("configure: Force the C standard to gnu99"),
thus supporting flexible array members [*]. Remove what is now
dead code.

[*] https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Flexible-Array-Fields.html
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260615091308.4458-2-philmd@oss.qualcomm.com>

20 hours agosystem: Move cpu_physical_memory_*() declarations to 'system/physmem.h'
Philippe Mathieu-Daudé [Tue, 9 Jun 2026 15:07:29 +0000 (17:07 +0200)] 
system: Move cpu_physical_memory_*() declarations to 'system/physmem.h'

The following cpu_physical_memory_*() methods do not involve any
vCPU but only access physical memory:

 - cpu_physical_memory_read()
 - cpu_physical_memory_write()
 - cpu_physical_memory_map()
 - cpu_physical_memory_unmap()

Rename them removing the 'cpu_' prefix, and move then to the
"system/physmem.h" header with the other methods involved in
global physical address space.

Mechanical change using sed, then adding missing headers manually.

No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-7-philmd@oss.qualcomm.com>

20 hours agotarget/s390x: Replace legacy cpu_physical_memory_read/write() calls
Philippe Mathieu-Daudé [Wed, 1 Oct 2025 11:21:50 +0000 (13:21 +0200)] 
target/s390x: Replace legacy cpu_physical_memory_read/write() calls

cpu_physical_memory_read() and cpu_physical_memory_write() are
legacy (see commit b7ecba0f6f6), replace by address_space_read()
and address_space_write() respectively, accessing the per-vCPU
address space instead of the global &address_space_memory one.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Message-Id: <20260616020839.19104-6-philmd@oss.qualcomm.com>

20 hours agotarget/s390x: Factor common s390_ipl_read/write() helpers
Philippe Mathieu-Daudé [Wed, 1 Oct 2025 11:17:15 +0000 (13:17 +0200)] 
target/s390x: Factor common s390_ipl_read/write() helpers

Prevent duplication factoring common helpers.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Message-Id: <20260616020839.19104-5-philmd@oss.qualcomm.com>

20 hours agogdbstub/system: Replace legacy cpu_physical_memory_read/write() calls
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 08:46:39 +0000 (10:46 +0200)] 
gdbstub/system: Replace legacy cpu_physical_memory_read/write() calls

cpu_physical_memory_read() and cpu_physical_memory_write() are
legacy (see commit b7ecba0f6f6), replace the two calls by a single
one to address_space_rw(). So far there is no logical change, but
stop ignoring these functions returned value and propagate it,
respecting the *memory_rw_debug() family error path. Thus this is
effectively a logical change.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-4-philmd@oss.qualcomm.com>

20 hours agoaccel/kvm: Replace legacy cpu_physical_memory_write() call
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 08:35:23 +0000 (10:35 +0200)] 
accel/kvm: Replace legacy cpu_physical_memory_write() call

cpu_physical_memory_write() is legacy (see commit b7ecba0f6f6),
replace it by address_space_write(). Both if() ladders only
differ in the address space argument: rework to have a single
address_space_write() call. No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-3-philmd@oss.qualcomm.com>

20 hours agosystem: Document cpu_physical_memory_*() declarations
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 07:36:57 +0000 (09:36 +0200)] 
system: Document cpu_physical_memory_*() declarations

Document the following methods use the global address space
and discard success/failure access information:

     - cpu_physical_memory_read()
     - cpu_physical_memory_write()
     - cpu_physical_memory_map()
     - cpu_physical_memory_unmap()

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-2-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various MemoryRegionCache arguments
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:38:52 +0000 (13:38 +0100)] 
system/memory: Constify various MemoryRegionCache arguments

Mark the MemoryRegionCache structure const when it is only
accessed read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-7-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various AddressSpace arguments (access)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:31:56 +0000 (13:31 +0100)] 
system/memory: Constify various AddressSpace arguments (access)

Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-6-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various AddressSpace arguments (cache)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:31:40 +0000 (13:31 +0100)] 
system/memory: Constify various AddressSpace arguments (cache)

Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-5-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various AddressSpace arguments (notify)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:29:01 +0000 (13:29 +0100)] 
system/memory: Constify various AddressSpace arguments (notify)

Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-4-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various AddressSpace arguments (flat-range)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:29:35 +0000 (13:29 +0100)] 
system/memory: Constify various AddressSpace arguments (flat-range)

Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-3-philmd@oss.qualcomm.com>

20 hours agosystem/memory: Constify various AddressSpace arguments (checks)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 12:28:13 +0000 (13:28 +0100)] 
system/memory: Constify various AddressSpace arguments (checks)

Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-2-philmd@oss.qualcomm.com>

20 hours agosystem/cpu: Reset vCPU %exception_index before resuming it
Philippe Mathieu-Daudé [Fri, 3 Oct 2025 14:27:46 +0000 (16:27 +0200)] 
system/cpu: Reset vCPU %exception_index before resuming it

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260423170229.64655-8-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
42 hours agoui/sdl2: Set GL ES profile before creating initial GL context
Ryan Zhang [Fri, 15 May 2026 11:21:55 +0000 (19:21 +0800)] 
ui/sdl2: Set GL ES profile before creating initial GL context

When the user selects GLES via '-display sdl,gl=es', we need to set
SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_ES before
calling SDL_GL_CreateContext(). This ensures SDL_GL_LoadLibrary()
loads the correct GLES driver instead of the desktop OpenGL driver.

Fix the below issue: qemu-system-aarch64: /usr/src/debug/libepoxy
/1.5.10/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion
`0 && "Couldn't find current GLX or EGL context.\n"' failed.

sdl2_gl_create_context() already sets the profile mask correctly for
ES mode, but the initial context created in sdl2_window_create() is
missing the same treatment.

Fixes:da3f7a3ab9ea0091955b58f8909dfcee01f4043e ("ui/sdl: try to instantiate the matching opengl renderer")

Signed-off-by: ryan.zhang@nxp.com
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <DU2PR04MB9018BB3650BA218438C01F2A83042@DU2PR04MB9018.eurprd04.prod.outlook.com>

42 hours agoui/sdl2: Explicitly specify EGL platform
Akihiko Odaki [Thu, 11 Jun 2026 11:58:03 +0000 (20:58 +0900)] 
ui/sdl2: Explicitly specify EGL platform

Mesa's eglGetDisplay() chooses the native EGL platform from
EGL_PLATFORM, limited autodetection, or the build-time default. If that
selects Wayland while SDL is using the X11 video backend, Mesa can treat
the X11 Display pointer as a wl_display and crash during eglInitialize().

Probe EGL with the X11 platform explicitly before enabling
SDL_HINT_VIDEO_X11_FORCE_EGL.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3540
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260611-sdl-v1-1-93d4a51684bb@rsg.ci.i.u-tokyo.ac.jp>

42 hours agoui/pixman: fix zero rowstride in qemu_pixman_image_new_shareable()
Marc-André Lureau [Thu, 11 Jun 2026 11:36:14 +0000 (15:36 +0400)] 
ui/pixman: fix zero rowstride in qemu_pixman_image_new_shareable()

qemu_create_displaysurface_from() callers such as xlnx_dp.c pass
linesize=0 with data=NULL, relying on pixman to compute the stride.
Since 1ff788db978 ("ui: use a shareable type"), the data=NULL path
goes through qemu_pixman_image_new_shareable() which computes
size = height * rowstride_bytes, resulting in a zero-size allocation
and an abort in qemu_memfd_alloc().

Introduce qemu-pixman-helpers.h with overflow-safe stride and buffer
size computation (matching pixman's create_bits() formula), and use it
from both qemu_pixman_image_new_shareable() and pixman-minimal's
create_bits().

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 1ff788db9781 ("ui: use a shareable type")
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260611113614.1935094-1-marcandre.lureau@redhat.com>

42 hours agoui/input: Have qemu_input_is_absolute() take a const QemuConsole
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 11:42:12 +0000 (13:42 +0200)] 
ui/input: Have qemu_input_is_absolute() take a const QemuConsole

qemu_input_is_absolute() does not update the content of the
QemuConsole structure. Make the argument const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260611114212.27472-3-philmd@oss.qualcomm.com>

42 hours agotools/qemu-vnc: Have console_get_mouse/keyboard take const QemuConsole
Philippe Mathieu-Daudé [Thu, 11 Jun 2026 11:42:11 +0000 (13:42 +0200)] 
tools/qemu-vnc: Have console_get_mouse/keyboard take const QemuConsole

Both console_get_mouse() and console_get_keyboard() only
access @con in read-only mode. Make that argument const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260611114212.27472-2-philmd@oss.qualcomm.com>

42 hours agoui/input: remove old LED handler broadcast queue
Marc-André Lureau [Mon, 8 Jun 2026 21:30:12 +0000 (01:30 +0400)] 
ui/input: remove old LED handler broadcast queue

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/dbus: switch LED handling to Notifier-based input API
Marc-André Lureau [Mon, 8 Jun 2026 21:20:45 +0000 (01:20 +0400)] 
ui/dbus: switch LED handling to Notifier-based input API

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/spice: switch LED handling to Notifier-based input API
Marc-André Lureau [Mon, 8 Jun 2026 21:19:10 +0000 (01:19 +0400)] 
ui/spice: switch LED handling to Notifier-based input API

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/vnc: switch LED handling to Notifier-based input API
Marc-André Lureau [Mon, 8 Jun 2026 21:17:52 +0000 (01:17 +0400)] 
ui/vnc: switch LED handling to Notifier-based input API

Replace QEMUPutLEDEntry with an embedded Notifier in VncDisplay.
Use qemu_input_led_notifier_add/remove instead of the old
qemu_add/remove_led_event_handler.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input/virtio-input-hid: use qemu_input_handler_set_leds_mask() for LED state
Marc-André Lureau [Mon, 8 Jun 2026 21:16:13 +0000 (01:16 +0400)] 
hw/input/virtio-input-hid: use qemu_input_handler_set_leds_mask() for LED state

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input/hid: use qemu_input_handler_set_leds_mask() for LED state
Marc-André Lureau [Mon, 8 Jun 2026 21:11:08 +0000 (01:11 +0400)] 
hw/input/hid: use qemu_input_handler_set_leds_mask() for LED state

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input/ps2: use qemu_input_handler_set_leds_mask() for LED state
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/input/ps2: use qemu_input_handler_set_leds_mask() for LED state

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/input: qemu_input_handler_register to warn for unused result
Marc-André Lureau [Wed, 10 Jun 2026 10:14:26 +0000 (14:14 +0400)] 
ui/input: qemu_input_handler_register to warn for unused result

Suggested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/m68k: keep QemuInputHandlerState in next-kbd
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/m68k: keep QemuInputHandlerState in next-kbd

Track the input handled state, and dispose it on unrealize.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input: keep QemuInputHandlerState in stellaris
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/input: keep QemuInputHandlerState in stellaris

Track the input handled state, and dispose it on unrealize.

Also free some allocated fields during unrealize.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input: keep QemuInputHandlerState in adb-kbd
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/input: keep QemuInputHandlerState in adb-kbd

Track the input handled state, and dispose it on unrealize.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/arm: keep QemuInputHandlerState in musicpal
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/arm: keep QemuInputHandlerState in musicpal

Track the input handled state, and dispose it on unrealize.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input/ps2: keep QemuInputHandlerState in PS2State
Marc-André Lureau [Mon, 8 Jun 2026 21:10:33 +0000 (01:10 +0400)] 
hw/input/ps2: keep QemuInputHandlerState in PS2State

Track the input handled state, and dispose it on unrealize.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/input: add LED state tracking to QemuInputHandlerState
Marc-André Lureau [Mon, 8 Jun 2026 21:05:22 +0000 (01:05 +0400)] 
ui/input: add LED state tracking to QemuInputHandlerState

Add per-handler LED state and a NotifierList for UI backends to
subscribe to LED changes.

Devices call qemu_input_handler_set_led() to store their LED state and
notify backends. Notify also on focus change, or list update.

Note: I considered conflating mouse-mode & led-state changes, but those
are quite different events (from different source kinds etc) and we may
want to improve the internal implementation.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/input: remove dead declaration
Marc-André Lureau [Tue, 9 Jun 2026 07:00:57 +0000 (11:00 +0400)] 
ui/input: remove dead declaration

Fixes: 0337e4123e6 ("input: Allow to choose console with qemu_input_is_absolute")
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui/input: remove double-notification on qemu_mouse_set()
Marc-André Lureau [Tue, 9 Jun 2026 06:54:12 +0000 (10:54 +0400)] 
ui/input: remove double-notification on qemu_mouse_set()

qemu_input_handler_activate() already notifies.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/input: replace fprint with LOG_GUEST_ERROR
Marc-André Lureau [Mon, 8 Jun 2026 13:20:40 +0000 (17:20 +0400)] 
hw/input: replace fprint with LOG_GUEST_ERROR

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agoui: move LED and key utilities to input.c, delete input-legacy.c
Marc-André Lureau [Mon, 8 Jun 2026 09:29:37 +0000 (13:29 +0400)] 
ui: move LED and key utilities to input.c, delete input-legacy.c

With both legacy mouse API consumers converted, the remaining
code in input-legacy.c (LED broadcast, index_from_key, qmp_send_key)
is not legacy-specific. Move it to ui/input.c and delete the file.

Clean up include/ui/console.h by removing the now-unused legacy
mouse API declarations (QEMUPutMouseEvent, QEMUPutMouseEntry,
QEMUPutKBDEvent, QEMUPutKbdEntry) and MOUSE_EVENT_* constants.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/usb/dev-wacom: convert to modern QemuInputHandler API
Marc-André Lureau [Mon, 8 Jun 2026 09:21:26 +0000 (13:21 +0400)] 
hw/usb/dev-wacom: convert to modern QemuInputHandler API

Replace the legacy QEMUPutMouseEvent callbacks with a proper
QemuInputHandler registration. The device now receives typed
input events (BTN/ABS/REL) directly.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
42 hours agohw/i386/vmmouse: convert to QemuInputHandler API
Marc-André Lureau [Mon, 8 Jun 2026 09:05:48 +0000 (13:05 +0400)] 
hw/i386/vmmouse: convert to QemuInputHandler API

Replace the legacy QEMUPutMouseEvent callback with a proper
QemuInputHandler registration. This eliminates one of the two
remaining users of the legacy input adapter in ui/input-legacy.c.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
42 hours agoui/hmp: move index_from_key() where it is used
Marc-André Lureau [Mon, 8 Jun 2026 13:09:39 +0000 (17:09 +0400)] 
ui/hmp: move index_from_key() where it is used

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohmp-commands.hx: fix button_state doc
Marc-André Lureau [Mon, 8 Jun 2026 12:41:42 +0000 (16:41 +0400)] 
hmp-commands.hx: fix button_state doc

Right & middle buttons are inverted (see hmp_mouse_button)

Acked-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
42 hours agohw/9pfs: consolidate name validation with check_name()
Christian Schoenebeck [Fri, 29 May 2026 16:29:44 +0000 (18:29 +0200)] 
hw/9pfs: consolidate name validation with check_name()

Add a new, shared helper function check_name() that consolidates the name
validation logic (illegal name check and "." / ".." rejection) currently
spread over multiple 9p handlers, unnecessarily duplicating code.

This is pure refactoring with no behavior change. The existing error code
semantics are preserved: rename operations return -EISDIR, create
operations return -EEXIST.

Note: These current error codes actually differ from native Linux system
calls (e.g. rename() returns -EBUSY, open(O_CREAT) returns -EISDIR). The 9P
protocol does not mandate specific error codes for these validation errors.
Hence consolidating to a single error code (e.g., -EINVAL) for all cases
could be considered in the future for simplicity reason.

This change reduces code duplication across 9 functions:

- v9fs_lcreate
- v9fs_create
- v9fs_symlink
- v9fs_link
- v9fs_rename
- v9fs_renameat
- v9fs_wstat
- v9fs_mknod
- v9fs_mkdir

Link: https://lore.kernel.org/qemu-devel/0573103880129eb543f07b68c77e86f2f572f6bf.1780072238.git.qemu_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
42 hours agohw/9pfs: reject . and .. in Twstat rename
Christian Schoenebeck [Fri, 29 May 2026 16:29:40 +0000 (18:29 +0200)] 
hw/9pfs: reject . and .. in Twstat rename

The other Trename and Trenameat handlers already reject "." and ".."
as new name on rename requests by returning -EISDIR in this case.

The legacy Twstat rename handler is missing this validation. While passing
"." or ".." does not trigger a crash as fixed by the previous patch (since
the fs backend driver's system calls handle these gracefully), it creates
a behavioral inconsistency, as it is semantically meaningless to rename a
file to a directory reference in the first place.

Fix this by rejecting "." and ".." in Twstat rename handler with -EISDIR
to match behavior of Trename and Trenameat handlers.

Fixes: 8cf89e007a ("virtio-9p: Add P9_TWSTAT support")
Link: https://lore.kernel.org/qemu-devel/662333331d371c6c343c8091161de8eaa121880e.1780072238.git.qemu_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
42 hours agohw/9pfs: fix abort due to illegal name with Twstat rename
Christian Schoenebeck [Fri, 29 May 2026 16:29:26 +0000 (18:29 +0200)] 
hw/9pfs: fix abort due to illegal name with Twstat rename

The legacy Twstat 9p request can be used to rename files and directories.
Unlike the other, more recent rename requests like Trename and Trenameat,
Twstat does not validate the submitted new name before passing it to
v9fs_complete_rename().

A priviliged guest user with direct communication access to 9p server
could pass a string containing '/' as new name, which causes an assertion
fault (DoS) in local_name_to_path().

Fix this by rejecting such strings by checking the client supplied new
name with name_is_illegal(), similar to how Trename and Trenameat handlers
do already.

Reported-by: Feifan Qian <bea1e@proton.me>
Fixes: 8cf89e007a ("virtio-9p: Add P9_TWSTAT support")
Link: https://lore.kernel.org/qemu-devel/ba09716828e82992f9d8cac7f00eee0bc1c43c61.1780072238.git.qemu_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
43 hours agoMerge tag 'firmware-20260617-pull-request' of https://gitlab.com/kraxel/qemu into...
Stefan Hajnoczi [Wed, 17 Jun 2026 14:17:29 +0000 (10:17 -0400)] 
Merge tag 'firmware-20260617-pull-request' of https://gitlab.com/kraxel/qemu into staging

bugfixes and cleanups for igvm and uefi-vars

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmoycjYACgkQTLbY7tPo
# cTgqcBAAxwTUiDHUSlhv11NG0cbfwPwKT8kcp5okw7My4Mja++d2b6+BMuhh993a
# eoaKhu5WhhMMfgQVRZN5Utfi+kGBt/TBE0lT36KMNhPAaMEeXhdMNq+ukuF5ffTQ
# XKDIxet+ty5oPGN4N8xnyzW4FPr8oowmcNoNqwyxOi/jZrXKQG55rr1BXD9xfMeW
# teqwxL5YBHZwDhhpGHTpcGvuyE9rYZfZYKGrXWyKQAsde0yucr4Fp8dId8pnyD+X
# 82n6GpbWJ22XUvxamcMSEFRXcYDkydi56WkxIz9WU+4aEtW0h42tsCe6tyDK5puG
# o25nhxc+TEFJLD/G17tgqhsrUqj4UTZbFSZl2pexPT2jTrzpfA7uGe86gGelTOV3
# tWMyeh+ES0fJomq7e+Wp3OE3oXI3weDxgef0z6V5s1kym+P4qn9uux4YAFB1QPfx
# 8aRZyYs89CSeX9EBsbu+0CEKqjBXPBBLFL/qXPMJZPtlTKtoHiIvm2EL5XuzfsUz
# U6qjcdXdJH6WnsmsOLq8CYN7NxOUGGlV7TRT1aBBX6TvYJxOkGGPVA9sd77+odPV
# BNNLzPJa/V89AKZZSKt8YBk5CiVGXPv6ORSIDNKGN5mXu11cypepx9WN+5nsq8ed
# q0UvyoEv5C3264zbB92J7oK1xDtUeJFvzB0t/9RLCqk5zh8mAaI=
# =UArT
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 06:08:54 EDT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'firmware-20260617-pull-request' of https://gitlab.com/kraxel/qemu:
  igvm: fix handling of optional variable header types
  igvm: replace raw uint32_t with igvm library types
  hw/uefi: fix parse_hexstr

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
43 hours agoMerge tag 'pull-target-arm-20260616' of https://gitlab.com/pm215/qemu into staging
Stefan Hajnoczi [Wed, 17 Jun 2026 14:17:03 +0000 (10:17 -0400)] 
Merge tag 'pull-target-arm-20260616' of https://gitlab.com/pm215/qemu into staging

target-arm queue:
 * Implementation of various insns preparatory to FEAT_SVE2p2
 * hw/arm/smmuv3: Make smmuv3 ATS, RIL, SSIDSIZE, and OAS 'auto' properties work
 * hw/pci/pci: Enforce pci_setup_iommu_per_bus() is called only once per bus
 * hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
 * target/arm: honour CCR.BFHFNMIGN for probed data BusFaults
 * hw/arm/bcm2838: Route I2C interrupts to GIC

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmoxnm0ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3pkwEACvFoqnwXHW7hrRI8LneG38
# uAhRJmyUmuzCFFDL7AF9//eJFL37GuFWekifyzoaQdq3Agwh0rhjH1DXWK1jLCaV
# jyidDrdZt7dn7VIgxUbfq9618kHtN16wvCJ1Dvi8YVqShpAKeXWTEj006qujiEth
# oRqcHVzu2OeYNEw2wlf9jBWjk8j4Pq9PIho2qC2hALB95zFYjOu4aTcPO0sKnFu/
# DwBQyKPTuO+u7uiv4f12CoRQ1PxsSbpObLARmkaQXlwbKVddgHC0PyZDGKN4jRIy
# 7w6A4JTEAnkk5btyPkNSm+iRonBnqrVbWOS7s4sOqQB6T6vCKtFIPh4jpL6Lt0ub
# BExwssYLGc/YXkHPUEbxwiV8/8lKkJy89JRUN33HEyDU4N5SiMDElUF5tpXIWK58
# hT25QdARNILK0zahGaVhgzmX3tlBuFn/HeHZAJcRL1xLbbvvGNoNJaGHVU5jlbet
# 07191qquh6oVW43vWbg+LuspIYgvdzJWoZ32zVn1ZGH+9+Au3+6K60dMDRA/JLXW
# bpdF3ClvQHx34dHw8aVPbkh8Vbnz2C0R7jYTlvvQL5ibHX2jCeCdi6bt3gsZLGMB
# j1AX+1MkYKttmfp7HubPkwR/p4VxHJB/MP8XL/oQNTjJGR4/C5qF7xdY3UO0JiaM
# Eg0Fyw94SNW7nzziYAYF+A==
# =rqLU
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 16 Jun 2026 15:05:17 EDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20260616' of https://gitlab.com/pm215/qemu: (61 commits)
  target/arm: Implement floating-point log and convert to integer (zeroing)
  target/arm: Implement SVE floating-point convert (top, predicated, zeroing)
  target/arm: Enable zeroing in DO_FCVT{N, L}T macros in sve_helper.c
  target/arm: Implement FRINT{32,64}{X,Z}
  target/arm: Implement SCVTF, UCVTF (predicated, zeroing)
  target/arm: Implement Floating-point square root (predicated, zeroing)
  target/arm: Implement Floating-point convert (predicated, zeroing)
  target/arm: Implement Floating-point round to integral value (predicated, zeroing)
  target/arm: Add data argument to do_frint_mode
  target/arm: Implement SVE2 integer unary operations (predicated, zeroing)
  target/arm: Implement SVE reverse doublewords (zeroing)
  target/arm: Implement SVE reverse within elements (zeroing)
  target/arm: Implement SVE bitwise unary operations (predicated, zeroing)
  target/arm: Implement SVE integer unary operations (predicated, zeroing)
  target/arm: Expand DO_ZPZ in translate-sve.c
  target/arm: Enable zeroing in DO_ZPZ macros in sve_helper.c
  target/arm: Rename sve unary predicated patterns
  target/arm: Add feature predicates for SVE2.2 and SME2.2
  hw/arm/bcm2838: Route I2C interrupts to GIC
  target/arm: honour CCR.BFHFNMIGN for probed data BusFaults
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
43 hours agoMerge tag 'pbouvier/pr/plugins-20260616' of https://gitlab.com/p-b-o/qemu into staging
Stefan Hajnoczi [Wed, 17 Jun 2026 14:16:23 +0000 (10:16 -0400)] 
Merge tag 'pbouvier/pr/plugins-20260616' of https://gitlab.com/p-b-o/qemu into staging

Changes:
- [PATCH v2 00/26] plugins: refactor API to maintain state through (Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>)
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-1-pierrick.bouvier@oss.qualcomm.com
# -----BEGIN PGP SIGNATURE-----
#
# iQHWBAABCgBAFiEEN8FWlNi6l2Sxlz/btEQ30ZwoYt8FAmoxmRAiHHBpZXJyaWNr
# LmJvdXZpZXJAb3NzLnF1YWxjb21tLmNvbQAKCRC0RDfRnChi3ztKC/45bQ+YlttE
# d2Zdt/N57raaZ8cumzTfpsmnN3Yd+ilIzJizW2OUgdrKrsXsZ73nEwsy9oV2XAGN
# XEaXBlVmLrIXnWRcVYyeKeTr0pJpjhglbLMwXHotgCpCZn77wOkIhTsJlEL83G0/
# F0Vt0o1FbvOepwZXr0jCU9JT/kewT0BptXClfQpyJcGeggj6x/rUsk32Lj7c5kZH
# 6T64T5tJZ5hxndJ/MQCHbsPkUksZT2WD44EYNb3QpVIvPBeoD/02WBfqC+U0fXQ3
# +O/JSfNacgjLWskaPiykft8t9GsRX3DgR5IJJ/WG4y3h9rxpbQKVdn5aKhmNavYK
# QplhS47OashPPbRWBYmKPipQO30sga5dPBt43mU0y1OfKBJR240r5CnFDNtU+XPM
# fwrcdmogleAKAU5rMqvP7fp2usBX0VAzTwtHF6PtswYX46uon/qIQ7E4VYh8mOeV
# DULhi38wKXUKHDwv00pXOvk2n6SOUdoro6XYaJoyArSK+vVFptV6nd4=
# =gcF/
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 16 Jun 2026 14:42:24 EDT
# gpg:                using RSA key 37C15694D8BA9764B1973FDBB44437D19C2862DF
# gpg:                issuer "pierrick.bouvier@oss.qualcomm.com"
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.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: 37C1 5694 D8BA 9764 B197  3FDB B444 37D1 9C28 62DF

* tag 'pbouvier/pr/plugins-20260616' of https://gitlab.com/p-b-o/qemu: (26 commits)
  plugins/cpp: register callbacks using captureless lambda
  scripts/checkpatch: remove check on forbidden space before '[' in C++
  scripts/checkpatch: ignore spaces required around some operators in C++
  plugins: use consistent parameter documentation for userdata
  plugins: add userdata to qemu_plugin_register_vcpu_syscall_ret_cb
  plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_ret_cb_t
  plugins: add userdata to qemu_plugin_register_vcpu_syscall_filter_cb
  plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_filter_cb_t
  plugins: add userdata to qemu_plugin_register_vcpu_syscall_cb
  plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_cb_t
  plugins: add userdata to qemu_plugin_vcpu_tb_trans_cb_t
  plugins: remove qemu_plugin_id from qemu_plugin_vcpu_tb_trans_cb_t
  plugins: remove qemu_plugin_id from qemu_plugin_vcpu_discon_cb_t
  plugins: add userdata to qemu_plugin_register_vcpu_discon_cb
  plugins: remove type qemu_plugin_vcpu_simple_cb_t
  plugins: add userdata to qemu_plugin_vcpu_for_each
  plugins: add userdata to qemu_plugin_register_vcpu_resume_cb
  plugins: add userdata to qemu_plugin_register_vcpu_idle_cb
  plugins: add userdata to qemu_plugin_register_vcpu_exit_cb
  plugins: add userdata to qemu_plugin_register_vcpu_init_cb
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
43 hours agoMerge tag 'pbouvier/pr/docs-20260616' of https://gitlab.com/p-b-o/qemu into staging
Stefan Hajnoczi [Wed, 17 Jun 2026 14:15:54 +0000 (10:15 -0400)] 
Merge tag 'pbouvier/pr/docs-20260616' of https://gitlab.com/p-b-o/qemu into staging

Changes:
- [PATCH v2] add a note on -shim to direct kernel boot docs (Gerd Hoffmann <kraxel@redhat.com>)
Link: https://lore.kernel.org/qemu-devel/20260612161707.158029-1-kraxel@redhat.com
# -----BEGIN PGP SIGNATURE-----
#
# iQHWBAABCgBAFiEEN8FWlNi6l2Sxlz/btEQ30ZwoYt8FAmoxjhEiHHBpZXJyaWNr
# LmJvdXZpZXJAb3NzLnF1YWxjb21tLmNvbQAKCRC0RDfRnChi376LC/9tQmAT4ebc
# c8aJ3cai880lZzN8/Q7k9ZWZFfyAz44G5jNLaA+A7AZOE4LQSnMrVgixBF8q4MbQ
# NnTaDMPY/CbI6qO1Jzt0RycCJq36KiKfB/XllayGnLMTW9KNE6rK/uq88bAKSeUu
# 9yAD2Uc9Hbx828xcGuuE1WqxzSRRVe0pVR0k8X90NbDOVXGRjX1FDP8P1sOra2tU
# eUWzXFy1hzBnY+0uZ2GqqGGhuEv8Kj59kl04QhxwBy+F//Oy+b5j51g5xeaQJNXW
# vuEzh/88VD8yqUDE6V1JjAclCzPTTH1+vBUp5FTeqyWIJRW3ZqmY+LPm2a9b7a5b
# g0WUbxcP8ajhw5mRqeY7Owi/wKX7Mhjy28HiZVQSslJXhn/Zd5fkDpGFdSwPCcCs
# iXbTPjwaPWYlQfietzbiu0BqSaS9lyDFhi2C+SkR3Vp/AsP6rnkdqd2SOSC9eecH
# tKpQAhO8wgOWWStsPyNasr1i58tA8Ndqai8VgY+R4mCmRC+E5qyAzNY=
# =4rhM
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 16 Jun 2026 13:55:29 EDT
# gpg:                using RSA key 37C15694D8BA9764B1973FDBB44437D19C2862DF
# gpg:                issuer "pierrick.bouvier@oss.qualcomm.com"
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.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: 37C1 5694 D8BA 9764 B197  3FDB B444 37D1 9C28 62DF

* tag 'pbouvier/pr/docs-20260616' of https://gitlab.com/p-b-o/qemu:
  add a note on -shim to direct kernel boot docs

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
43 hours agoMerge tag 'pull-qapi-2026-06-16' of https://repo.or.cz/qemu/armbru into staging
Stefan Hajnoczi [Wed, 17 Jun 2026 14:15:32 +0000 (10:15 -0400)] 
Merge tag 'pull-qapi-2026-06-16' of https://repo.or.cz/qemu/armbru into staging

QAPI patches for 2026-06-16

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCgAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmoxUaISHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTLRYQAJ5AybnBtEdNWya4HQTnLIj2EwHieYI2
# 6nmE1AOwgJ1Ba6EV0LtQqxHq4AxYCDGfrs7zWY3Og5YfO5dF57IZICS5Hn1nGPoJ
# 7Xw78BzjdFZ2977w8NI8oZmRoryIpV1KOXwExkycEvAF1TNBYQoraQYAjgUQq/Of
# 6orIqdvSZ1Jjqz8H8hHkwNdv0In7FpP7hGimGtvKkaVOy9GWrZayFQSvHeI5Q0gj
# lOdck/Qjq4rTZZ8t646nTSB1nYvEaysD6qtMsScBiK9lWDd65cj/lUfz1nVFLhdz
# ak2ayqODb/W+SujLjlNr/PsphcvnE74cpRgKtz0ilAWJ6CGW4/a0sKnXexVsgN7p
# 247yCdlDiAqPyUeptBtiToAqPFoH1aVVV6HGhuMg+zc192nhQ1C2zZT5ytqqnCQ/
# NTZM7x8usrXfetyz36V2iYq8XzWAPFAAGYy4ylJWSv4+Npeoq9LYwEaDsMoLgbLL
# tghlo7Z7aYw7r+6FyWg1BogEF7Sc3DZAK9S1lWmfiIzZ8BZZ/P1gJJEbfUHxKLqb
# dE0WydRRmg7NX1r6MmjftkzKndTvztp+TpHEPyIkm2BzSKkJuc8Tw8mgvt4j3p3i
# rNBOnCT/DM/1HpUqWSIAM43JNPop9nB9LAfwhwezKjdcPDiZTrCNFA+5qIL5Mocb
# O4zl+DZDx6rm
# =vmyS
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 16 Jun 2026 09:37:38 EDT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-qapi-2026-06-16' of https://repo.or.cz/qemu/armbru:
  qapi: add doc comment "Intro" section parsing
  qapi/qapidoc: add rendering for INTRO sections
  qapi: remove implicit doc comment Plain section
  qapi: adjust doc comment stub member insertion algorithm
  qapi/parser: add mea culpa comment for ensure_returns
  qapi/parser: move _insert_near_kind() method
  qapi: new doc comment "Intro" section
  qapi/parser: fix comment phrasing
  qapi/parser: make remaining subsection members "private"
  qapi/parser: add has_features property
  qapi/parser: remove unused QAPIDoc subsection members
  tests/qapi: generate output in source order
  python: temporarily restrict max mypy version
  qapi: drop "must exist" from ID descriptions for consistency

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
44 hours agoqga/vss: Drop unused define uuid(x)
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:06 +0000 (14:39 +0300)] 
qga/vss: Drop unused define uuid(x)

There is no place in code where we use uuid(x), at the same time
MSVC vss.h use it and this define broke compilation.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-8-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/vss: Remove unused undefs
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:05 +0000 (14:39 +0300)] 
qga/vss: Remove unused undefs

We don't include any headers that provides VSS_E*, so
no need to undefine it before including vss.h

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-7-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/vss: Use MAX_PATH instead of PATH_MAX
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:04 +0000 (14:39 +0300)] 
qga/vss: Use MAX_PATH instead of PATH_MAX

MAX_PATH defined in windows.h
This is more correct way for Windows.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-6-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/meson: Allow to use MSVC message compiler 'mc'
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:03 +0000 (14:39 +0300)] 
qga/meson: Allow to use MSVC message compiler 'mc'

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-5-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/meson: Use windows.compile_resources instead of custom_target
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:02 +0000 (14:39 +0300)] 
qga/meson: Use windows.compile_resources instead of custom_target

windows.compile_resources supports more compiles and works
in both MinGW and MSVC environment. While 'windres' is a
MinGW specific tool.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-4-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/meson: Remove unused lib stdc++
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:01 +0000 (14:39 +0300)] 
qga/meson: Remove unused lib stdc++

qga_libs are libraries for guest agent linking. Guest Agent
is a pure C-language application and doesn't need any C++ libs.
VSS linking dependencies are placed in a separate file.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-3-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoqga/win: Use swprintf instead of snwprintf
Kostiantyn Kostiuk [Mon, 30 Mar 2026 11:39:00 +0000 (14:39 +0300)] 
qga/win: Use swprintf instead of snwprintf

snwprintf is a Microsoft extension, and according to the MSVC spec,
it is called _snwprintf. MinGW defines both snwprintf and _snwprintf,
while MSVC defines only _snwprintf.

We can also use swprintf here. The only difference between
the two is the return value, and we are not using it. So change
the function to support MSVC build env.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260330113906.168002-2-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoMake copy_file_range non-static on GNU/Hurd
Damien Zammit [Sun, 8 Feb 2026 05:59:45 +0000 (05:59 +0000)] 
Make copy_file_range non-static on GNU/Hurd

glibc has a stubs mechanism: a function can be declared in the
system headers, but only implemented as a stub that always fails with
ENOSYS, for example.  Therefore when implementing this function
we cannot use static.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Link: https://lore.kernel.org/r/20260208055858.2166524-6-damien@zamaudio.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoblock/file-posix: Clean up sys/ioctl import
Damien Zammit [Sun, 8 Feb 2026 05:59:38 +0000 (05:59 +0000)] 
block/file-posix: Clean up sys/ioctl import

Since all platforms except sun include this header,
clean up the ifdefs.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260208055858.2166524-5-damien@zamaudio.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agotpm: Add conditional to not compile ioctls on GNU/Hurd
Damien Zammit [Sun, 8 Feb 2026 05:59:32 +0000 (05:59 +0000)] 
tpm: Add conditional to not compile ioctls on GNU/Hurd

The Hurd currently doesn't have any TPM driver, compilation fails
for missing _IOT__IOTBASE_* symbols unless these are left undefined.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Link: https://lore.kernel.org/r/20260208055858.2166524-4-damien@zamaudio.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoAdd GNU/Hurd host_os=gnu
Damien Zammit [Sun, 8 Feb 2026 05:59:25 +0000 (05:59 +0000)] 
Add GNU/Hurd host_os=gnu

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Link: https://lore.kernel.org/r/20260208055858.2166524-3-damien@zamaudio.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agoInclude new arbitrary limits if not already defined
Manolo de Medici [Sun, 8 Feb 2026 05:59:19 +0000 (05:59 +0000)] 
Include new arbitrary limits if not already defined

Although GNU/Hurd supports unlimited path lengths
only bounded by available memory, for now we can use
an arbitrary limit on PATH_MAX that matches what POSIX requires.
We don't have bandwidth to fix this properly right now.

Author: Manolo de Medici <manolo.demedici@gmail.com>
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Link: https://lore.kernel.org/r/20260208055858.2166524-2-damien@zamaudio.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
44 hours agogdbstub: Update x86 control register bits
Mathias Krause [Fri, 27 Mar 2026 14:34:13 +0000 (15:34 +0100)] 
gdbstub: Update x86 control register bits

The control register bits haven't been updated in a few years, making
them lack behind features QEMU ganied in these years.

Update them to the current version of the SDM and sort the 32bit version
to be in line with all the other definitions (descending order).

This should remove confusion when debugging, for example, CET-enabled
guests:

- before the change:
  (gdb) info registers cr4
  cr4            0x8000f0            [ PGE MCE PAE PSE ]

- after the change:
  (gdb) info registers cr4
  cr4            0x8000f0            [ CET PGE MCE PAE PSE ]

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20260327143413.254227-1-minipli@grsecurity.net
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>