]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
2 months agoui/vnc: fix vnc_display_init() leak on failure
Marc-André Lureau [Tue, 24 Feb 2026 15:05:58 +0000 (16:05 +0100)] 
ui/vnc: fix vnc_display_init() leak on failure

Do not add the display state to the vnc list, if the initialization
failed. Add vnc_display_free(), to free the display state and associated
data in such case. The function is meant to be public and reused in the
following changes.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/keymaps: introduce kbd_layout_free()
Marc-André Lureau [Sat, 4 Apr 2026 14:09:01 +0000 (18:09 +0400)] 
ui/keymaps: introduce kbd_layout_free()

Enable callers to properly tear down keyboard layouts.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc: VncDisplay.id is not const
Marc-André Lureau [Tue, 24 Feb 2026 14:53:57 +0000 (15:53 +0100)] 
ui/vnc: VncDisplay.id is not const

s/strdup/g_strdup to highlight the issue and be consistent with other
allocations.

The next patch is going to introduce vnc_display_free() to take care of
deallocating it.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc: simplify vnc_init_func error handling
Marc-André Lureau [Tue, 24 Feb 2026 14:43:32 +0000 (15:43 +0100)] 
ui/vnc: simplify vnc_init_func error handling

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc: assert preconditions instead of silently returning
Marc-André Lureau [Tue, 24 Feb 2026 15:40:42 +0000 (16:40 +0100)] 
ui/vnc: assert preconditions instead of silently returning

Replace defensive NULL guards with assert() in vnc_display_close()
and vnc_display_open(). These are internal functions whose callers
guarantee non-NULL arguments, so a NULL value would indicate a
programming error rather than a runtime condition.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agosystem: make qemu_del_vm_change_state_handler accept NULL
Marc-André Lureau [Wed, 25 Feb 2026 13:28:33 +0000 (14:28 +0100)] 
system: make qemu_del_vm_change_state_handler accept NULL

For convenience.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoutil: move datadir.c from system/
Marc-André Lureau [Wed, 18 Feb 2026 17:40:50 +0000 (18:40 +0100)] 
util: move datadir.c from system/

The datadir module provides general-purpose data file lookup
utilities that are not specific to system emulation. Move it
to util/ so it can be reused more broadly.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vgafont: add SPDX license header
Marc-André Lureau [Thu, 12 Mar 2026 14:37:35 +0000 (18:37 +0400)] 
ui/vgafont: add SPDX license header

The vgafont was added without source origin, but it can be traced back
to Linux kernel, which used
GPL-2 (https://github.com/mpe/linux-fullhistory/blob/master/lib/fonts/font_8x16.c).

commit c6f37d0e4feeb264a699eda289d3cc69405100b0
Author: Fabrice Bellard <fabrice@bellard.org>
Date:   Wed Jul 14 17:39:50 2004 +0000

    virtual console

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui: avoid duplicating vgafont16 in each translation unit
Marc-André Lureau [Mon, 23 Feb 2026 14:39:21 +0000 (15:39 +0100)] 
ui: avoid duplicating vgafont16 in each translation unit

vgafont.h defined vgafont16 as a static const array, so every .c file
that included it (via console-priv.h) got its own 4 KiB copy, that
the linker may or not deduplicate?

Move the array definition into a new vgafont.c compilation unit and
turn the header into a proper extern declaration with an include guard.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: unify the write path
Marc-André Lureau [Thu, 19 Feb 2026 14:07:09 +0000 (15:07 +0100)] 
ui/console-vc: unify the write path

VT100 escape responses (DSR) used qemu_chr_be_write() to write directly
to the chardev backend, bypassing the output FIFO, while keyboard input
went through the FIFO and flush path. This inconsistency could lead to
out-of-order delivery when both paths are active.

Introduce qemu_text_console_write() that pushes data into the output
FIFO and flushes it, and use it for both keyboard input and VT100
responses. Remove the now-unnecessary vc_respond_str() helper. Rename
kbd_send_chars() to qemu_text_console_flush() to better reflect its
purpose.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: move vc_put_lf() to VT100 layer as vt100_put_lf()
Marc-André Lureau [Thu, 19 Feb 2026 12:50:22 +0000 (13:50 +0100)] 
ui/console-vc: move vc_put_lf() to VT100 layer as vt100_put_lf()

Decouple the line-feed handling from VCChardev by operating on
QemuVT100 directly. The function no longer needs the chardev or
console pointers — callers pass &s->vt instead. This continues the
effort to make the VT100 terminal emulation self-contained.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: refactor text_console_resize() into vt100_set_image()
Marc-André Lureau [Sun, 22 Feb 2026 18:23:35 +0000 (19:23 +0100)] 
ui/console-vc: refactor text_console_resize() into vt100_set_image()

Decouple the resize logic from QemuTextConsole by operating on
QemuVT100 and taking a pixman_image_t directly, instead of reaching
into the console's scanout surface. The callers now pass the image
explicitly, which makes the VT100 layer independent of the console
object hierarchy.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: console_scroll() -> vt100_scroll()
Marc-André Lureau [Thu, 19 Feb 2026 11:46:57 +0000 (12:46 +0100)] 
ui/console-vc: console_scroll() -> vt100_scroll()

This decouples glyph rendering from the console object, continuing the
QemuVT100 abstraction introduced in the previous commits.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: move cursor blinking logic into VT100 layer
Marc-André Lureau [Thu, 19 Feb 2026 21:03:58 +0000 (22:03 +0100)] 
ui/console-vc: move cursor blinking logic into VT100 layer

Maintain a list of QemuVT100 instances so the cursor timer can directly
iterate over them and call vt100_refresh(), instead of going through
qemu_invalidate_text_consoles() which iterated over all consoles
(including graphic ones) and called back into the generic display layer.

This removes the qemu_invalidate_text_consoles() function from
console.c, further decoupling VT100 text rendering from the console
core.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: console_refresh() -> vt100_refresh()
Marc-André Lureau [Thu, 19 Feb 2026 11:08:13 +0000 (12:08 +0100)] 
ui/console-vc: console_refresh() -> vt100_refresh()

This decouples glyph rendering from the console object, continuing the
QemuVT100 abstraction introduced in the previous commits.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: decouple VT100 display updates via function pointer
Marc-André Lureau [Thu, 19 Feb 2026 11:39:04 +0000 (12:39 +0100)] 
ui/console-vc: decouple VT100 display updates via function pointer

Replace direct dpy_gfx_update() calls from the VT100 emulation code
with an indirect call through a new image_update function pointer in
QemuVT100. This decouples the VT100 terminal emulation from the
QEMU display layer, allowing different backends to provide their own
image update implementation.

The QemuVT100 typedef is changed to a forward-declared struct so the
function pointer signature can reference QemuVT100 itself.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: make show_cursor() take vt100
Marc-André Lureau [Thu, 19 Feb 2026 10:59:41 +0000 (11:59 +0100)] 
ui/console-vc: make show_cursor() take vt100

Decouples glyph rendering from the console object,
continuing the QemuVT100 abstraction introduced in the previous commits.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: make invalidate_xy() take vt100
Marc-André Lureau [Thu, 19 Feb 2026 10:57:14 +0000 (11:57 +0100)] 
ui/console-vc: make invalidate_xy() take vt100

This decouples glyph rendering from the console object, continuing the
QemuVT100 abstraction introduced in the previous commits.

Style fixes.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: vga_putcharxy()->vt100_putcharxy()
Marc-André Lureau [Thu, 19 Feb 2026 10:40:34 +0000 (11:40 +0100)] 
ui/console-vc: vga_putcharxy()->vt100_putcharxy()

Have the character rendering function operate on QemuVT100 directly
instead of taking a QemuConsole and extracting the VT100 state
internally. This decouples glyph rendering from the console object,
continuing the QemuVT100 abstraction introduced in the previous commits.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: set vt100 associated pixman image
Marc-André Lureau [Thu, 19 Feb 2026 10:37:59 +0000 (11:37 +0100)] 
ui/console-vc: set vt100 associated pixman image

Start removing dependency on DisplaySurface for vt100 handling.

Note that before, the rendering is done on the current DisplaySurface.
It's not obvious the QemuTextConsole associated surface isn't changed
over time, in particular if it was doing resize. But
qemu_console_resize() is only implemented for QemuGraphicConsole.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: introduce QemuVT100
Marc-André Lureau [Wed, 18 Feb 2026 22:49:46 +0000 (23:49 +0100)] 
ui/console-vc: introduce QemuVT100

Start moving VT100 emulation specific code in a different structure.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console: dispatch get_label() through QOM virtual method
Marc-André Lureau [Fri, 20 Feb 2026 10:50:50 +0000 (11:50 +0100)] 
ui/console: dispatch get_label() through QOM virtual method

Replace the type-checking chain in qemu_console_get_label() (using
QEMU_IS_GRAPHIC_CONSOLE/QEMU_IS_TEXT_CONSOLE) with a QemuConsoleClass
virtual method, allowing each console subclass to provide its own
get_label implementation.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: fix comment shift-out/in comments
Marc-André Lureau [Sun, 22 Feb 2026 22:57:41 +0000 (23:57 +0100)] 
ui/console-vc: fix comment shift-out/in comments

14 is shift-out
15 is shift-in

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: ignore string-type escape sequences
Marc-André Lureau [Thu, 12 Mar 2026 13:35:49 +0000 (17:35 +0400)] 
ui/console-vc: ignore string-type escape sequences

Modern terminals and applications emit OSC (Operating System Command),
DCS, SOS, PM, and APC escape sequences (e.g. for setting window
titles).  The text console currently does not recognise these
string-type introducers, so each byte of the payload is interpreted as
a normal character or a new escape, producing garbage on screen.

Add a TTY_STATE_OSC state that silently consumes all bytes until the
sequence is terminated by BEL or ST (ESC \).

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/console-vc: fix off-by-one in CSI J 2 (clear entire screen)
Marc-André Lureau [Sun, 22 Feb 2026 22:24:16 +0000 (23:24 +0100)] 
ui/console-vc: fix off-by-one in CSI J 2 (clear entire screen)

The loop condition used `y <= s->height` instead of `y < s->height`,
causing vc_clear_xy() to be called with y == s->height. This clears
a row in the scrollback buffer beyond the visible screen.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: drop redundant (and needless) qemu_thread_get_self()
Marc-André Lureau [Fri, 13 Mar 2026 19:48:24 +0000 (23:48 +0400)] 
ui/vnc-jobs: drop redundant (and needless) qemu_thread_get_self()

The call is unnecessary, since "thread" is already set at creation time.
Furthermore, the "thread" field is mostly useless as the thread is
created DETACHED and isn't used for anything but perhaps debugging.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: narrow taking the queue lock
Marc-André Lureau [Fri, 13 Mar 2026 19:43:39 +0000 (23:43 +0400)] 
ui/vnc-jobs: narrow taking the queue lock

It's not needed unless manipulating the queue.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: remove vnc_queue_clear()
Marc-André Lureau [Fri, 13 Mar 2026 19:33:37 +0000 (23:33 +0400)] 
ui/vnc-jobs: remove vnc_queue_clear()

The function was never called, since the worker thread was never
exiting. Also it was incomplete (not clearing pending job list) and
mixing global queue and argument. Let's remove it.

Note: maybe the worker thread could be torn down when vnc_jobs_join()
realizes there is no job left.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: remove dead VncJobQueue.exit
Marc-André Lureau [Fri, 13 Mar 2026 19:18:28 +0000 (23:18 +0400)] 
ui/vnc-jobs: remove dead VncJobQueue.exit

Since commit 09526058d0a5 ("ui/vnc: Remove vnc_stop_worker_thread()"),
it's not used anymore. It seems stopping worker thread hasn't been
supported ever.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: vnc_has_job_locked() argument cannot be NULL
Marc-André Lureau [Fri, 13 Mar 2026 19:09:08 +0000 (23:09 +0400)] 
ui/vnc-jobs: vnc_has_job_locked() argument cannot be NULL

The only caller, vnc_jobs_join() cannot take vs == NULL argument, or it
would later crash.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc: clarify intent using buffer_empty() function
Marc-André Lureau [Fri, 13 Mar 2026 19:01:39 +0000 (23:01 +0400)] 
ui/vnc: clarify intent using buffer_empty() function

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc-jobs: remove needless buffer_reset() before end
Marc-André Lureau [Fri, 13 Mar 2026 18:56:45 +0000 (22:56 +0400)] 
ui/vnc-jobs: remove needless buffer_reset() before end

vnc_async_encoding_end() does buffer_free() next.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/clipboard: clear deferred serial reset flag on resume
GuoHan Zhao [Thu, 16 Apr 2026 07:04:03 +0000 (15:04 +0800)] 
ui/clipboard: clear deferred serial reset flag on resume

cb_reset_serial_on_resume defers a clipboard serial reset until the
machine runs again. qemu_clipboard_change_state() performs that reset
on resume, but leaves the flag set.

As a result, every later transition back to RUNNING triggers another
QEMU_CLIPBOARD_RESET_SERIAL notification even when no reset is pending.
That causes unnecessary reset handling in clipboard backends such as
vdagent and dbus.

Clear the deferred flag before resetting so the reset is performed only
once for each deferred request.

Fixes: c967ff606b99 ("ui/clipboard: delay clipboard update when not running")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260416070403.1683648-1-zhaoguohan@kylinos.cn>

2 months agoserial COM: windows serial COM PollingFunc don't sleep
Werner de Carne [Mon, 7 Aug 2023 20:14:43 +0000 (22:14 +0200)] 
serial COM: windows serial COM PollingFunc don't sleep

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1802
Signed-off-by: Werner de Carne <werner@carne.de>
[ Marc-André - indentation fixes ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230807201443.2668-1-werner@carne.de>

2 months agoui/spice-app: detect runtime directory creation failures
GuoHan Zhao [Wed, 8 Apr 2026 03:17:25 +0000 (11:17 +0800)] 
ui/spice-app: detect runtime directory creation failures

spice_app_display_early_init() creates the per-VM runtime directory
with g_mkdir_with_parents() before setting up the Spice socket. The
code checks for "< -1", but g_mkdir_with_parents() returns -1 on
failure, so the error path is never taken.

This lets spice-app continue after a directory creation failure and
defers the problem to later setup steps.

Check for "< 0" instead so the failure is reported immediately and
spice-app exits before using an invalid runtime directory.

Fixes: d8aec9d9f129 ("display: add -display spice-app launching a Spice client")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260408031725.641417-1-zhaoguohan@kylinos.cn>

2 months agoui/input-linux: close evdev fd when qemu_set_blocking fails
GuoHan Zhao [Wed, 8 Apr 2026 02:40:24 +0000 (10:40 +0800)] 
ui/input-linux: close evdev fd when qemu_set_blocking fails

input_linux_complete() opens the evdev node before switching it to
non-blocking mode. If qemu_set_blocking() fails, the function returns
without closing the file descriptor.

The finalize path only closes initialized devices, so this leaks the fd
on an error path.

Jump to err_close when qemu_set_blocking() fails so the descriptor is
released before returning.

Fixes: c7b1172026a0 ("ui: replace qemu_set_nonblock()")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260408024024.606222-1-zhaoguohan@kylinos.cn>

2 months agovfio-user: fix DMA write reply
John Levon [Fri, 10 Apr 2026 08:57:16 +0000 (09:57 +0100)] 
vfio-user: fix DMA write reply

The protocol specifies that DMA write replies should include
address+count, but the client code was only doing so for read. Fix that
up.

In addition, add a protocol clarification over how short writes may be
reported in that reply. QEMU never reports a short write via the
count field.

Reported-by: Patrick Mooney <patrick@matx.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260410085716.877185-4-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agovfio-user: correct protocol for DMA reads/writes
John Levon [Fri, 10 Apr 2026 08:57:15 +0000 (09:57 +0100)] 
vfio-user: correct protocol for DMA reads/writes

The "count" parameter in the DMA write reply should be 8 bytes in size.

Reported-by: Patrick Mooney <patrick@matx.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260410085716.877185-3-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agovfio-user: support VFIO_USER_DEVICE_FEATURE
John Levon [Fri, 10 Apr 2026 08:57:14 +0000 (09:57 +0100)] 
vfio-user: support VFIO_USER_DEVICE_FEATURE

Plumb through vfio_device_get_feature to the vfio-user server. Note that
we translate EINVAL into ENOTTY, as the existing generic vfio code is
expecting the latter to mean "unsupported".

As part of adding a trace point, clean up the trace file.

Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260410085716.877185-2-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agovfio: Add VFIO I/O backend capability flags for feature support
Cédric Le Goater [Thu, 9 Apr 2026 11:43:12 +0000 (13:43 +0200)] 
vfio: Add VFIO I/O backend capability flags for feature support

Different VFIO I/O backends support different features. For example,
the kernel VFIO backend supports DMA-BUF creation, while vfio-user
does not. Currently, this is handled by attempting the operation and
checking for -ENOTTY, which can lead to misleading warnings when a
feature is simply not supported by a particular backend.

Introduce a capability flags mechanism in VFIODeviceIOOps that allows
backends to explicitly advertise which features they support. Callers
can check these capabilities before attempting operations, avoiding
spurious errors and warnings.

Cc: John Levon <john.levon@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Link: https://lore.kernel.org/qemu-devel/20260409114312.1704062-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/iommufd: Control dirty tracking for nesting parent HWPT
Shameer Kolothum [Wed, 1 Apr 2026 08:41:33 +0000 (09:41 +0100)] 
hw/vfio/iommufd: Control dirty tracking for nesting parent HWPT

QEMU smmuv3 accel does not support live migration yet, so dirty
tracking for the nesting parent HWPT is not useful.

Also, nested vIOMMU use cases can break on some platforms. For
example, SMMUv3 with HTTU may advertise dirty tracking capability,
but the kernel supports it only for stage-1. Requesting dirty
tracking for a nesting parent HWPT (stage-2) can fail.

Add a vIOMMU flag to explicitly request dirty tracking for the
nesting parent HWPT. For nested cases, dirty tracking is enabled
only when requested by the vIOMMU.

Non-nested cases and Intel vIOMMU keep the existing behavior.

Fixes: fc6dafb98cec ("hw/arm/smmuv3: Implement get_viommu_cap() callback")
Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/20260401084133.56266-1-skolothumtho@nvidia.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agoiommufd: Rename all the idev and idevc variables to hiod and hiodc
Zhenzhong Duan [Wed, 1 Apr 2026 08:03:53 +0000 (04:03 -0400)] 
iommufd: Rename all the idev and idevc variables to hiod and hiodc

We used idev and idevc naming for HostIOMMUDeviceIOMMUFD and corresponding
class variables which followed the iommufd_device naming in linux kernel.

This is mixed with the hiod naming for base type HostIOMMUDevice. Rename
HostIOMMUDeviceIOMMUFD* to hiodi* for consistency in QEMU.

No functional change intended.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260401080354.1347212-1-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio: all vfio files can now be common files
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:33 +0000 (10:47 -0700)] 
hw/vfio: all vfio files can now be common files

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-9-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to hw/vfio/kvm-spapr.c
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:32 +0000 (10:47 -0700)] 
hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to hw/vfio/kvm-spapr.c

Since this function needs kvm specific types, we need to extract in
another file and link it only for KVM builds.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-8-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/ap.c: use full path for target specific header
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:31 +0000 (10:47 -0700)] 
hw/vfio/ap.c: use full path for target specific header

In addition, we fix target/s390x/kvm/kvm_s390x.h cpu-qom include also.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-7-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/pci.c: eradicate CONFIG_KVM
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:30 +0000 (10:47 -0700)] 
hw/vfio/pci.c: eradicate CONFIG_KVM

We just need to add kvm_enabled() guard when calling concerned
functions, but no need to extract those kvm functions since they are not
using any kvm specific types that would not be visible at compilation
time.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-6-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio: eradicate CONFIG_IOMMU from sources
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:29 +0000 (10:47 -0700)] 
hw/vfio: eradicate CONFIG_IOMMU from sources

This commit removes usage of CONFIG_IOMMU in hw/vfio sources, exposing
inconditionally iommufd related properties, which are declared
statically (in const arrays). The alternative to expose them dynamically
is more complex and requires boilerplate to set properties at runtime,
with set_* callbacks and added logic to check if iommufd backend is
available, with no obvious benefit.

One possible difference is that user may see a different error message
when trying to attach a vfio device with a QEMU not supporting iommufd,
without declaring iommufd object associated.

Instead of:
```
$ qemu-system-* -device vfio-pci,host=0000:01:00.0,iommufd=iommufd0
qemu-system-*: -device vfio-pci,host=0000:01:00.0,iommufd=iommufd0: Property 'vfio-pci.iommufd' not found
```
User will now see:
```
qemu-system-aarch64: -device vfio-pci,host=0000:01:00.0,iommufd=iommufd0: Device 'iommufd0' not found
```

However, since declaring the iommufd object is needed, error reported
before and after is still the same:
```
$ qemu-system-* -object iommufd,id=iommufd0 -device vfio-pci,host=0000:01:00.0,iommufd=iommufd0
qemu-system-*: invalid object type: iommufd
```

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-5-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:28 +0000 (10:47 -0700)] 
hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD

Add stubs for needed functions.

vfio_pci_hot_reset_info must be forwarded declared on non linux platforms:
In file included from ../hw/vfio/igd-stubs.c:9:
../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  265 |                                     struct vfio_pci_hot_reset_info **info_p);
      |

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-4-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:27 +0000 (10:47 -0700)] 
hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c

Because those functions use kvm specific types, they need to be isolated
in another source file.
This allows us to link kvm-helpers only in configurations with
CONFIG_KVM.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-3-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agohw/vfio/listener.c: remove CONFIG_KVM
Pierrick Bouvier [Wed, 18 Mar 2026 17:47:26 +0000 (10:47 -0700)] 
hw/vfio/listener.c: remove CONFIG_KVM

Code concerned is under a kvm_enabled() guard.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260318174733.1717643-2-pierrick.bouvier@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 months agoUpdate version for v11.0.0 release v11.0.0
Peter Maydell [Tue, 21 Apr 2026 15:28:47 +0000 (16:28 +0100)] 
Update version for v11.0.0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMAINTAINERS: add new reviewer for Hexagon target
Pierrick Bouvier [Thu, 16 Apr 2026 23:14:54 +0000 (16:14 -0700)] 
MAINTAINERS: add new reviewer for Hexagon target

Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260416231455.346504-3-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2 months agoMAINTAINERS: update address
Pierrick Bouvier [Thu, 16 Apr 2026 23:14:53 +0000 (16:14 -0700)] 
MAINTAINERS: update address

Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260416231455.346504-2-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2 months agoUpdate version for v11.0.0-rc4 release v11.0.0-rc4
Peter Maydell [Tue, 14 Apr 2026 19:22:00 +0000 (20:22 +0100)] 
Update version for v11.0.0-rc4 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agomigration: Remove unnecessary zlib include from qemu-file.h
Chad Jablonski [Fri, 19 Dec 2025 01:45:12 +0000 (20:45 -0500)] 
migration: Remove unnecessary zlib include from qemu-file.h

Commit 70eb5fde05 removed zlib from the libmigration dependencies but
missed removing the zlib include from the header file. zlib doesn't
appear to be used anywhere in qemu-file.h. This is fine in most
environments where zlib is nearly always in the default include path but
breaks the build when it isn't (NixOS for example).

Fixes: 70eb5fde05 ("migration: remove unnecessary zlib dependency")
Signed-off-by: Chad Jablonski <chad@jablonski.xyz>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agodocs: Deprecate Arm OABI and NWFPE support
Peter Maydell [Mon, 13 Apr 2026 10:37:54 +0000 (11:37 +0100)] 
docs: Deprecate Arm OABI and NWFPE support

Linux for 32-bit Arm has had two major ABIs: the original OABI and
the more modern EABI.  OABI support was marked as obsolete in GCC 4.7
and dropped in GCC 4.8.  In the Linux kernel, compatibility handling
for OABI (OABI_COMPAT) is not generally enabled by default and is not
compatible with building a Thumb2 kernel.  Distros dropped OABI
support fifteen years or more ago.

NWFPE floating-point emulation handles the ancient FPA11 coprocessor,
which is only needed/supported with OABI.  Our implementation is old,
untested and not thread-safe.

Mark OABI and NWFPE support as deprecated so we can remove it in a
future release.  Our main motivation here is to be able to drop the
2500+ lines of NWFPE emulation code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260413103754.45745-1-peter.maydell@linaro.org

2 months agoutil/cutils: Fix heap corruption under Windows
Bernhard Beschow [Tue, 14 Apr 2026 11:40:33 +0000 (13:40 +0200)] 
util/cutils: Fix heap corruption under Windows

Under Windows, QEMU would only sporadically start successfully. In the
G_OS_WIN32 case, get_relocated_path() first determines a cursor
to the end of the "result" string and then increases its size with
g_string_set_size(). Since g_string_set_size() may reallocate, the
cursor may become dangling. Windows may detect this and crash the QEMU
process with the following message:

  HEAP: Free Heap block 000000000499B640 modified at 000000000499B684 after it was freed

Furthermore, QEMU crashes spontaneously, even long after the guest has
booted. For example, it presumably crashes due to the guest setting a
new cursor icon which may be a result of the heap corruption.

Fix this by determining the cursor on the resized string.

Fixes: cf60ccc3306c ("cutils: Introduce bundle mechanism")
Cc: qemu-stable@nongnu.org
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-id: 20260414114033.2360-1-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoaccel/kvm: return early from kvm_irqchip_create if kvm does not support irqchip
Ani Sinha [Tue, 14 Apr 2026 04:59:11 +0000 (10:29 +0530)] 
accel/kvm: return early from kvm_irqchip_create if kvm does not support irqchip

During refactoring of kvm_irqchip_create(), the refactored code was returning
early from do_kvm_irqchip_create() function if the required essential
capabilities were not present in KVM. This was not translating to an early
return from kvm_irqchip_create() as was the case before refactoring.
This is because, do_kvm_irqchip_create() did not have a means to notify the
caller of the lack of required kvm capabilities. Fix this by making
do_notify_irqchip_create() return EOPNOTSUPP error when  capabilities
are absent and then the caller can check the return code and return early.

Due to this regression during refactoring, all KVM guests on ppc64le hang
immediately during startup and this completely breaks all functionality on
that platform.

Fixes: 98884e0cc1 ("accel/kvm: add changes required to support KVM VM file descriptor change")
Message-ID: <20260413090010.60339-1-anisinha@redhat.com>
Reported-by: Misbah Anjum N <misanjum@linux.ibm.com>
Reported-by: Gautam Menghani <gautam@linux.ibm.com>
Tested-by: Misbah Anjum N <misanjum@linux.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-id: 20260414045911.63662-1-anisinha@redhat.com
Suggested-by: Fabiano Rosas <farosas@suse.de>
Suggested-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Tested-by: Misbah Anjum N <misanjum@linux.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging
Peter Maydell [Mon, 13 Apr 2026 14:13:01 +0000 (15:13 +0100)] 
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging

Pull request

virtio-blk zone report CVE DoS fix

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmnc72sACgkQnKSrs4Gr
# c8h2CQf/TzMkfPv4bV0G3Z7JMOCllVejmlWUJpSh7lQdboNiIrWbtiCaC5n7CfTF
# +A8e8g4FYlTHhRj8nWMTd4vs6lmKEHTS7dbBlwB/ZkmAzHGtGizIXK7X7aAz6LZT
# KSRJYIm9Qj+c8kGZjPY/XmA6Y3uFS0jAZRd/1fFSshg0NyNxPIipj3YAv2P8mQf8
# y+v32O2WTezQQfTTBZR2moYmo3wBeSXum6NHOGq4DVswvaSQDJ1Eooc30xFswkIM
# vg+RqzUFCABsNj6vED61j1mE01vgFAvJKfCXNY1RFYkyeM2uzwlByktocbMTbs+b
# BJweRe9fO01GcQAunWT5Y6VmrJib7A==
# =m/MG
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Apr 13 14:28:11 2026 BST
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  virtio-blk: fix zone report buffer out-of-memory (CVE-2026-5761)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agovirtio-blk: fix zone report buffer out-of-memory (CVE-2026-5761)
Stefan Hajnoczi [Fri, 10 Apr 2026 12:11:28 +0000 (08:11 -0400)] 
virtio-blk: fix zone report buffer out-of-memory (CVE-2026-5761)

An internal buffer is used when processing VIRTIO_BLK_T_ZONE_REPORT
requests. The buffer's size is controlled by the guest. A large value
can result in g_malloc() failure and the QEMU process aborts, resulting
in a Denial of Service (DoS) (most likely in cases where an untrusted
guest application or a nested guest with virtio-blk passthrough is able
to abort QEMU).

Modify the zone report implementation to work incrementally with a
bounded buffer size.

This is purely a QEMU implementation issue and no VIRTIO spec changes
are needed.

Mingyuan Luo found this bug and provided a reproducer which I haven't
put into tests/qtest/ because it requires a zoned storage device (e.g.
root and modprobe null_blk):

1) Prepare a zoned nullblk backend (/dev/nullb0):

sudo modprobe -r null_blk || true
sudo modprobe null_blk nr_devices=1 zoned=1
sudo chmod 0666 /dev/nullb0
cat /sys/block/nullb0/queue/zoned

2) Create qtest input:

cat >/tmp/vblk-zone-report-oom.qtest <<'EOF'
outl 0xcf8 0x80002004
outw 0xcfc 0x0007
outl 0xcf8 0x80002010
outl 0xcfc 0x0000c001
outb 0xc012 0x00
outb 0xc012 0x01
outb 0xc012 0x03
outl 0xc004 0x00000000
outw 0xc00e 0x0000
outl 0xc008 0x00000100
outb 0xc012 0x07
writel 0x00020000 0x00000010
writel 0x00020004 0x00000000
writeq 0x00020008 0x0000000000000000
writeq 0x00100000 0x0000000000020000
writel 0x00100008 0x00000010
writew 0x0010000c 0x0001
writew 0x0010000e 0x0001
EOF

for i in $(seq 1 1022); do
d=$((0x00100000 + i * 16))
n=$((i + 1))
printf 'writeq 0x%08x 0x0000000000200000\n' "$d" >> /tmp/vblk-zone-report-oom.qtest
printf 'writel 0x%08x 0x1fe00000\n' $((d + 8)) >> /tmp/vblk-zone-report-oom.qtest
printf 'writew 0x%08x 0x0003\n' $((d + 12)) >> /tmp/vblk-zone-report-oom.qtest
printf 'writew 0x%08x 0x%04x\n' $((d + 14)) "$n" >> /tmp/vblk-zone-report-oom.qtest
done

d=$((0x00100000 + 1023 * 16))
printf 'writeq 0x%08x 0x0000000000200000\n' "$d" >> /tmp/vblk-zone-report-oom.qtest
printf 'writel 0x%08x 0x1fe00000\n' $((d + 8)) >> /tmp/vblk-zone-report-oom.qtest
printf 'writew 0x%08x 0x0002\n' $((d + 12)) >> /tmp/vblk-zone-report-oom.qtest
printf 'writew 0x%08x 0x0000\n' $((d + 14)) >> /tmp/vblk-zone-report-oom.qtest
cat >> /tmp/vblk-zone-report-oom.qtest <<'EOF'
writew 0x00104000 0x0000
writew 0x00104002 0x0001
writew 0x00104004 0x0000
outw 0xc010 0x0000
EOF

3) Run the qtest input with ASAN build (compile qemu with --enable-asan):

build/qemu-system-x86_64 -display none \
-accel qtest -qtest stdio \
-machine pc -nodefaults -m 512M -monitor none -serial none \
-blockdev driver=host_device,node-name=disk0,filename=/dev/nullb0 \
-device virtio-blk-pci-transitional,drive=disk0,addr=04.0,queue-size=1024 \
< /tmp/vblk-zone-report-oom.qtest

Cc: Sam Li <faithilikerun@gmail.com>
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Fixes: CVE-2026-5761
Fixes: 4f7366506a9 ("virtio-blk: add zoned storage emulation for zoned devices")
Reported-by: Mingyuan Luo <myluo24@m.fudan.edu.cn>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoUpdate version for v11.0.0-rc3 release v11.0.0-rc3
Peter Maydell [Thu, 9 Apr 2026 20:18:56 +0000 (21:18 +0100)] 
Update version for v11.0.0-rc3 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'hw-misc-20260409' of https://github.com/philmd/qemu into staging
Peter Maydell [Thu, 9 Apr 2026 14:54:41 +0000 (15:54 +0100)] 
Merge tag 'hw-misc-20260409' of https://github.com/philmd/qemu into staging

Misc HW patches

Few hw/ fixes and a keymap one.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmnXtasACgkQ4+MsLN6t
# wN6TYxAAkfAJ+bFx35zYD1BJXS9ozboprLFR6EtGzEzomOSNSio4W0Dh+X3G6R69
# CZ6AW11J+17JtIsvVp4UrZVT1Seq4nhEl+LVCvJtIgpKkDv4o1IZh+jyIpwRxlZ8
# JweahVgOgc3z9r+gEM8GTrZmux9P3fYjELPt+71tsrgiVWhXntOyO3MriRHD4+1m
# pYMKEh3FEd84VVacKVArnxf/ThUlgxd+nt+KjXMpPnW7oDlLnqaVahn5qqqDgYX8
# Kgva7g7Z30ZCrxuOa+9Fx2FsTof8EW6htGbSr8kfa8gzzveUYRmEFvRFpuTE7rX7
# 4LItAUaKKUsA65cbXPXPNB+3Ua2odtNgjhvbudTsRnpcKNfTW203ct7R9h9OnfIu
# WROnegR4qFi1uVRFaI0NUxS9pOWCtK4MotnmBtJPwTBB9xP6qch6i8pOLj7loNEo
# QC2AN1RB0N6u3mSXdMWUaWsbsCq7Mw2j7YIpj0N8Cg7/sCzzAXR1XEmHl1bPesbc
# D/f89ck2kBe8wFHphkTxkIu1USPMxP9nVYt/UU+dh3iusXu5wzp26a/TSMoCYCYl
# LTd/8mYPvAFK71icgZwaGvzhJagA9EYExL2RAWCQZ56K8GG5UvsHmriQovyNMBgX
# QRNlKU6X+fbnv5lHOUVVRtPcT4xz7xYycfm2I9bqLXt4aLDRkxs=
# =i6vx
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Apr  9 15:20:27 2026 BST
# 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 'hw-misc-20260409' of https://github.com/philmd/qemu:
  qemu-keymap: fix altgr modifier lookup for newer xkeyboard-config
  ati-vga: Fix check for overflowing vram
  hw/timer: ibex_timer: Update IRQs after writing CTRL
  ati-vga: Fix pitch and offset registers mask

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoqemu-keymap: fix altgr modifier lookup for newer xkeyboard-config
Dietmar Maurer [Wed, 8 Apr 2026 09:14:59 +0000 (11:14 +0200)] 
qemu-keymap: fix altgr modifier lookup for newer xkeyboard-config

xkeyboard-config 2.37 removed the "AltGr" virtual modifier in favor
of mapping upper groups directly to Mod5. Since then,
xkb_keymap_mod_get_index(map, "AltGr") returns XKB_MOD_INVALID, so
AltGr-based keysyms were never generated.

See: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/473f9bc32f9ba869829cc0d06a75cd1f2560aa60

Try "AltGr" first, and fall back to "Mod5" for compatibility with
both old and new xkeyboard-config versions.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260408091459.4001711-1-dietmar@proxmox.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoati-vga: Fix check for overflowing vram
BALATON Zoltan [Wed, 8 Apr 2026 10:49:35 +0000 (12:49 +0200)] 
ati-vga: Fix check for overflowing vram

Take into account the bytes per pixels when checking for accessing
beyond end of vram area.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260408104935.1A55A5969F6@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agohw/timer: ibex_timer: Update IRQs after writing CTRL
Alistair Francis [Tue, 7 Apr 2026 04:36:13 +0000 (14:36 +1000)] 
hw/timer: ibex_timer: Update IRQs after writing CTRL

When writing to rv_timer.CTRL after setting the compare values the timer
doesn't fire as we don't update the interrupts. Ensure we update the
interrupts after a write to the rv_timer.CTRL register.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2796
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Message-ID: <20260407043614.372871-5-alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoati-vga: Fix pitch and offset registers mask
BALATON Zoltan [Sat, 4 Apr 2026 11:13:18 +0000 (13:13 +0200)] 
ati-vga: Fix pitch and offset registers mask

Remove the Radeon specific masks for offset and pitch registers. While
the documentation is not clear about it I believe it is a copy&paste
error from the combined DST_PITCH_OFFSET register that has less bits
so more constrained than the individual registers which should not
have this mask.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-ID: <20260404111318.8334E596A22@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Peter Maydell [Thu, 9 Apr 2026 10:58:04 +0000 (11:58 +0100)] 
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* virtio-scsi: fix cdb_size issue

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmnXhEYUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroMx5ggAqWT2APURWbs4tz16RhC3GlIWdxxo
# zb+xEtwX9s/G1Pb18R6+ZJdOjW1EeKut84K/q+jkkQ514kfzXJFNlonqKnajvJ3i
# YcQ7TL8o2F7PDeAWlJ/vgQJuAAvXnTqk8ppuqz75W1cJnA6vLBCaCA0nUiUNMXR2
# fIMot1a5l2yH1V4IzspIJDkP1oNIfqhPG4/89sraJPhmKqhGw/gDfLsJ/oZ1C2LI
# sm9qmMSsHsyV6gW3TbOn3mCt1R7+16JwvF/E6HsSXaK8u/UJxLPzlfQGjaKBDtE3
# HpVNtKY4XJzSWR6zbWw10dqQbT2h7WwHEbHCnYhnCJs9RMDu+t2evpmMGw==
# =Z7CW
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Apr  9 11:49:42 2026 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  virtio-scsi: pass the same cdb_size to virtio_scsi_pop_req and virtio_scsi_handle_cmd_req_prepare

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agohw/uefi: fix heap overflow (CVE-2026-5744)
Gerd Hoffmann [Wed, 8 Apr 2026 07:34:02 +0000 (09:34 +0200)] 
hw/uefi: fix heap overflow (CVE-2026-5744)

When copying the request response into the pio transfer buffer the code
skips the 'struct mm_header' but does not consider that when calculating
transfer size, so it will copy 24 (== sizeof(struct mm_header)) extra
bytes, which can overflow uv->pio_xfer_buffer.

Fix that by copying the complete buffer, including the header, which
also makes the pio code path consistent with the (unaffected) dma code
path.

Fixes: CVE-2026-5744
Fixes: 90ca4e03c27d ("hw/uefi: add var-service-core.c")
Reported-by: Yuma Kurogome <yumak@ricsec.co.jp>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20260408073403.3410541-1-kraxel@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agovirtio-scsi: pass the same cdb_size to virtio_scsi_pop_req and virtio_scsi_handle_cmd...
Paolo Bonzini [Fri, 27 Mar 2026 21:00:09 +0000 (22:00 +0100)] 
virtio-scsi: pass the same cdb_size to virtio_scsi_pop_req and virtio_scsi_handle_cmd_req_prepare

Ensure that there is no allocation/usage mismatch when requests
are processed in virtio_scsi_handle_cmd_vq.  To do this,
retrieve the value once and pass it to both functions.

For other calls to virtio_scsi_pop_req the extra size
can be 0, because control and event requests fit
entirely in VirtIOSCSIReq.

Reported-by: Jihe Wang <wangjihe.mail@gmail.com>
Tested-by: Jihe Wang <wangjihe.mail@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: CVE-2026-5763
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoMerge tag 'hw-misc-20260407' of https://github.com/philmd/qemu into staging
Peter Maydell [Wed, 8 Apr 2026 18:16:36 +0000 (19:16 +0100)] 
Merge tag 'hw-misc-20260407' of https://github.com/philmd/qemu into staging

Misc HW patches

Few fixes, mostly for VGA display models.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmnVffgACgkQ4+MsLN6t
# wN4vAw/+OpYUXgVIE82vn6eJQPewiFm/oq7Bi2iHWtB51JLGy+eckbVrahG5M74g
# dvr2x+1APsweNizhkHz6m00UdCDmhli8N+p9xOa2F61LjYCszZBteR7DhMdPVF33
# GuptAXnyZZkeN0lvD+hYfk2KBNCGGOz2r96XUsuSoOS6BwgTzqlpaZ3mL4YaQbLD
# KED9wsqqKHgUrgZa7yzH4IFx4iuQoRTEeXUfa/BOnYUMKs7zlf8+x8a/93GM2fqK
# HRHi27Dw52DI0wSKZ97i67a+pP291S5BbSBnLb37HZeOdS5AUa3hHuoXKNhdd1O1
# PbQT1Rs0cPBkQ/YEeJySfQbRNS6fk2W/fz1yKVUaUzgWgXZxRJuAIml0JyudfhMr
# g4/g882St0b8umQRqePgmCUHWeG/bpVvsRPZN+lm6jobpk69htbGtR0pYO/dRCkZ
# aZWTGulPqnPNLMQG/qkYCFCPX4NpJfrl1VWSwCXRLt8d4r1CrnqmwfqmgQCsMkRd
# UJtHqYeYPHT4ivW/Vbn3cEUY1c5kRLjlPjWO6mAZCKCwnPyK5p3f4hSStLJlra6k
# /bidMyIJXvYHPCgHRzTDWsx2tV1tL3iyGlxEae3BTcPlUiXOczxsoKEqvg487nh6
# tmzodtsOHpNXnuZQb3rFdiGdzKUhhpobex7mKzef7xEFOKA2adk=
# =7zMH
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Apr  7 22:58:16 2026 BST
# 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 'hw-misc-20260407' of https://github.com/philmd/qemu:
  ati-vga: Do not crash on 24 bits per pixel
  ati-vga: Update mode on CRTC_PITCH change
  ati-vga: Fix setting CRTC_OFFSET
  hw/arm/omap_sx1: map CS3 at the correct base
  cirrus-vga: Make frame buffer endianness little endian by default
  docs/about/removed-features: Replace 'since' -> 'removed in'

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
Peter Maydell [Wed, 8 Apr 2026 12:34:10 +0000 (13:34 +0100)] 
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging

trivial patches for 2026-04-08

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmnWM84ACgkQgqpKJDse
# lHgJMxAAuz4rJQh51cTA1vKa/Pte//BZ4ro9dVnCi2ogCVjmy/ZaD6r2B8ZJtpHo
# RMXbTrswGF1Hs6J5HxztcMHNHE9fO+2CGjhgjujCsvs72Msdp5j6TjQ61DzIG3UL
# jz3g7fGPxabOyiJcMi61QMIMwcOQlS4WSZhvcRtxixc6KpY6fx5uCXpvEKUIzumQ
# WSmTkHVah4C8D05jUWmD5jF2krAUvf0XjsGDIYidjXRwsnORnBSZdHGoukQ8rGl9
# 6OjvuWT9UZIM7nXv76lPkk3APVFL4q9FMNoc3GxcTzHMWyvYknOM5KI4tDFhncqh
# 0gvie5OalWCxrzq8inGy3o+3v0/ggsOG/mjyN9tR5nas6qsqzya6PHaPoXbLn/uq
# ibsV+LOtjo65w0uJUV1LRn1TwG6bBQBKO1pdYmx3SouaY8dF9UsNTsvhiyFOdBge
# 7ZnjzoMmD33USkSWbAL5icGHSAShsIvJkQfWd8lrsx46dzuePC/DwGp8S384sNA+
# j0Ecqd/ar0cBfGi9mToKHufrGZS4S4R4xdVU41k2eA5AmhaEQ4D3BkWaZC7ocx59
# Q5s2N/XMDK6CX7OEkIAEy6Oi8DyO8vl/hozEI/USpc6OqUM/eX74WH7dR2fKaDZa
# D+36iSHOKQK2wgPVHaeBrfjobgFXY+/MGFGPMlvk9Z4q4zQNZ2Y=
# =XP94
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Apr  8 11:54:06 2026 BST
# 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:
  util: fix missing aio_wait sym in qemu guest agent only build
  Allow building qemu tools on 32-bit hosts
  util/meson.build: do not add cpuinfo-$arch to util_ss for 32bit CPUs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoutil/readline: Fix out-of-bounds access in readline_insert_char().
Nguyen Dinh Phi [Mon, 6 Apr 2026 05:04:54 +0000 (13:04 +0800)] 
util/readline: Fix out-of-bounds access in readline_insert_char().

Currently, the readline_insert_char() function is guarded by the cursor
position (cmd_buf_index) rather than the actual buffer fill level(cmd_buf_size).
The current check is:
if (rs->cmd_buf_index < READLINE_CMD_BUF_SIZE)

This logic is flawed because if the command buffer is full and a user moves the
cursor backward (e.g. by sending left arrow key), cmd_buf_index can be
decreased without descreasing of buffer size.
This allow subsequent insertions to increase cmd_buf_size past its maximum
limit of rs->cmd_buf.

Because in the ReadLineState struct, cmd_buf[READLINE_CMD_BUF_SIZE + 1] is
immediately followed by the cmd_buf_index integer, once the buffer size is
sufficiently inflated, the memmove() operation inside readline_insert_char()
can write past the end of cmd_buf[] and overwrites cmd_buf_index itself.

The subsequent line:
rs->cmd_buf[rs->cmd_buf_index] = ch;

then writes the input character to an address determined by the now-corrupted
index.

By providing a specifically crafted input sequence via HMP, this flaw can be
used to redirect the write operation to overwrite any field within the
ReadLineState structure, which can lead to unpredictable behavior or
application crashes.

Fix this by adding the guard to check for buffer fullness.

Cc: qemu-stable@nongnu.org
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Message-id: 20260406050454.284873-2-phind.uet@gmail.com
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoutil: fix missing aio_wait sym in qemu guest agent only build
Daniel P. Berrangé [Tue, 7 Apr 2026 15:18:17 +0000 (16:18 +0100)] 
util: fix missing aio_wait sym in qemu guest agent only build

Configure QEMU with

 --disable-system --disable-user --disable-tools --enable-guest-agent

and the build with fail with

  FAILED: [code=1] qga/qemu-ga
  ld: libqemuutil.a.p/qapi_qmp-dispatch.c.o: in function `do_qmp_dispatch_bh':
  qapi/qmp-dispatch.c:140:(.text+0x5c): undefined reference to `aio_wait_kick'

This aio_kick() usage was recently introduced in qmp-dispatch.c
without updating the build logic.

Fixes commit fc1a2ec7da531223b3473185dc2584f8a7c6c659
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2 months agoAllow building qemu tools on 32-bit hosts
Helge Deller [Sat, 4 Apr 2026 22:40:16 +0000 (00:40 +0200)] 
Allow building qemu tools on 32-bit hosts

Qemu's tools like qemu-img are often needed on 32-bit platforms,
although the actual qemu emulators have been discontinued on 32-bit.

To allow building the tools on 32-bit this patch implements three small
changes:

a) The check in meson.build is changed to still error out if the user
tries to build qemu-system or qemu-user on a 32-bit platform, but allows
building tools (e.g. by "--enable-tools") alone.

b) The compile time check in atomic.h now checks against
sizeof(uint64_t) so that 32-bit environments can still build
successfully, while 128-bit atomic operations are prevented to sneak in.

c) Allow linking against libatomic as long as we don't build the
qemu-system and qemu-user binaries.

Sucessfully tested on the 32-bit big-endian powerpc architecture.

Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2 months agoati-vga: Do not crash on 24 bits per pixel
BALATON Zoltan [Mon, 6 Apr 2026 01:20:31 +0000 (03:20 +0200)] 
ati-vga: Do not crash on 24 bits per pixel

The stn_he_p function only supports power of two sizes so it will
assert if we call it with size 3 that happens with 24 bits per pixel.
It's not clear from the documentation if this should be supported or
not and drivers tested so far don't use it so refuse the parameters
that would crash QEMU for now.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Chad Jablonski <chad@jablonski.xyz>
Message-ID: <20260406012031.335A0596A24@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoati-vga: Update mode on CRTC_PITCH change
BALATON Zoltan [Fri, 3 Apr 2026 14:59:28 +0000 (16:59 +0200)] 
ati-vga: Update mode on CRTC_PITCH change

When changing line length we need to update display parameters so call
mode change when changing CRTC_PITCH if the value has changed.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Chad Jablonski <chad@jablonski.xyz>
Message-ID: <3f54ff54a873a8f8a0cc5f14660703b4025a69e2.1775228029.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agoati-vga: Fix setting CRTC_OFFSET
BALATON Zoltan [Fri, 3 Apr 2026 14:59:27 +0000 (16:59 +0200)] 
ati-vga: Fix setting CRTC_OFFSET

Offset (display start address) should also be updated when changing
the register value not only on mode change. Fix the register write
mask to hard code bits 0:2 to 0 as the chip docs say and update the
start address on register write. This fixes virtual screen panning for
screens larger than displayed resolution.

As this register allows values that cannot be handled by the VBE_DISPI
X and Y offsets (which is restricted by line length) we add a function
to set it directly not through the VBE offsets.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Chad Jablonski <chad@jablonski.xyz>
Reviewed-by: Chad Jablonski <chad@jablonski.xyz>
Message-ID: <2b8af6022aba06aa98a249ae67922de29d82d86f.1775228029.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agohw/arm/omap_sx1: map CS3 at the correct base
GuoHan Zhao [Fri, 3 Apr 2026 01:44:41 +0000 (09:44 +0800)] 
hw/arm/omap_sx1: map CS3 at the correct base

omap_sx1 wires the "sx1.cs3" region to OMAP_CS2_BASE instead of
OMAP_CS3_BASE.

That places both CS2 and CS3 at the same address and leaves the real
CS3 window unmapped. Point the CS3 region at OMAP_CS3_BASE so the
static chip-select layout matches the OMAP address definitions.

Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Fixes: ba1580299d0 ("omap_sx1: convert to memory API")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260403014441.38725-1-zhaoguohan@kylinos.cn>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agocirrus-vga: Make frame buffer endianness little endian by default
BALATON Zoltan [Wed, 1 Apr 2026 20:53:27 +0000 (22:53 +0200)] 
cirrus-vga: Make frame buffer endianness little endian by default

QEMU VGA defaults to target endianness but real Cirrus VGA is little
endian so set it explicitly in cirrus_init_common() to fix it on big
endian machines.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260401205327.914905969EC@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2 months agodocs/about/removed-features: Replace 'since' -> 'removed in'
Philippe Mathieu-Daudé [Mon, 23 Mar 2026 15:05:09 +0000 (16:05 +0100)] 
docs/about/removed-features: Replace 'since' -> 'removed in'

We use "deprecated since ..." and "removed in ...".
Replace "since" by "removed in" for removed features.

Fixes: 762c8554394 ("vfio: Remove 'vfio-platform'")
Fixes: aeb1a50d4a7 ("vfio: Remove 'vfio-amd-xgbe' device")
Fixes: e50a021a451 ("hw/arm: Remove ast2700a0-evb machine")
Fixes: 4af2433a81b ("docs: Mention 32-bit PPC host as removed")
Fixes: 8ebc416ac17 ("vfio: Remove 'vfio-calxeda-xgmac' device")
Fixes: a80151c9da1 ("hw/sd/sdcard: Remove support for spec v1.10")
Fixes: 269ffaabc84 ("buildsys: Remove support for 32-bit MIPS hosts")
Fixes: fc37c122fff ("migration: Drop deprecated QMP migrate argument @detach")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20260323151934.92880-1-philmd@linaro.org>

2 months agoMerge tag 'pull-target-arm-20260407' of https://gitlab.com/pm215/qemu into staging
Peter Maydell [Tue, 7 Apr 2026 17:55:04 +0000 (18:55 +0100)] 
Merge tag 'pull-target-arm-20260407' of https://gitlab.com/pm215/qemu into staging

target-arm queue:
 * docs/system: remove extraneous sentence
 * target/arm: fix fault_s1ns for stage 2 faults
 * target/arm: do_ats_write(): avoid assertion when ptw failed

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmnVRJIZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3iy2EACmribMFgzcPttAFU9Tx3VG
# SZ6jvm3xexspyh0bQe/P47gV2oZgvTepEYzteM0b6b6hOfiDFHCFzXXjyfcTqhxU
# LkeDXysB54zKjnHThihTnD3065JndwSYQdIQx+P3hk1Lcq3uGvZNLHjMRT++N0xv
# Jtp9SLKD9LtJZcEAXtPEy3gxoZwA/3hXp03EooO9TpZHDEdhTFxTmP9DVLeaAU9T
# zH1CwIPvZv2g1ep82fKuVM2TNNazPC60RIy4jiyiMAKAFgWLdp2bpes8MfXu24Au
# mAFdZJirVI8/oBQn+WaM1o9zVcIPuXqpK1AfFa9KRxYJx35dS3fUEC80vhdcL7gO
# HQP0ZmnKqWxB2CN8b7sEAjLyLjScE5GMqWbbTUckfJoFdQF1jcmfxRpl8t5VI/p/
# /2lCIwFjSerRiRrqwbUMss1ue37IpwZ8dWUkpKPhwnlBUe/Ts41DMZeQ9Cf/HieZ
# 6RgfcXszTQWwUESOPooy593Smw2pwKfB3Gmpq7khwIPtu5WLMhDKiQhTA1t4r7YM
# /BmNXUCAoiTIN2S8IXxe23ORXcPlQ4EyFDDBh0h4gAeX0eQCgUAcfkmDlRZb7Rbj
# sIVuAFOd1YW8sz3AHoXXH4bq0oPeh5MeWZJwcp1djTV3j1Cdyz9L9I0eFF+OWtj/
# MNvSBK7/IIapbLenws8GHg==
# =eIR5
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Apr  7 18:53:22 2026 BST
# 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-20260407' of https://gitlab.com/pm215/qemu:
  docs/system: remove extraneous sentence
  target/arm: fix fault_s1ns for stage 2 faults
  target/arm: do_ats_write(): avoid assertion when ptw failed

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agodocs/system: remove extraneous sentence
Alex Bennée [Mon, 6 Apr 2026 16:56:48 +0000 (17:56 +0100)] 
docs/system: remove extraneous sentence

Lest we confuse the reader about something we are no longer showing in
the example.

Fixes: 132f8ec799c (target/arm: change default pauth algorithm to impdef)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260406165648.997995-1-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm: fix fault_s1ns for stage 2 faults
Alex Bennée [Sun, 5 Apr 2026 11:24:10 +0000 (12:24 +0100)] 
target/arm: fix fault_s1ns for stage 2 faults

The computation of s1ns was simply wrong. For Stage 2 faults, it
should indicate whether the faulting IPA is in the Non-Secure IPA
space. Correct the logic to check for ARMSS_NonSecure and drop the
extraneous s2_mmu_idx test.

This is effectively a change in the intended semantics of the
ARMMMUFaultInfo::s1ns field, so that we no longer try to make it
exactly match HPFAR_EL2.NS but instead set it for any stage 2 fault
on an NS IPA, relying on users of the field to check whether the
fault is to be taken to Secure EL2 before propagating the field to
the HPFAR_EL2.NS bit.  Since the actual writing of HPFAR_EL2.NS is
already gated by arm_is_secure_below_el3(env), we only need to update
the comments to document this change of semantics.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2568
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260405112410.603223-1-alex.bennee@linaro.org
[PMM: also update comments about the s1ns field]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoutil/meson.build: do not add cpuinfo-$arch to util_ss for 32bit CPUs
Michael Tokarev [Wed, 25 Mar 2026 13:49:26 +0000 (16:49 +0300)] 
util/meson.build: do not add cpuinfo-$arch to util_ss for 32bit CPUs

qemu dropped support for 32bit CPUs recently, so this change is an
additional clean-up on top.  But in theory it will allow building
qemu-guest-agent on a 32bit system.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2 months agotarget/arm: do_ats_write(): avoid assertion when ptw failed
Peter Maydell [Tue, 31 Mar 2026 09:23:05 +0000 (10:23 +0100)] 
target/arm: do_ats_write(): avoid assertion when ptw failed

In do_ats_write() we try to assert that the cacheattrs from
get_phys_addr_for_at() are in the form we expect:

    /*
     * ATS operations only do S1 or S1+S2 translations, so we never
     * have to deal with the ARMCacheAttrs format for S2 only.
     */
    assert(!res.cacheattrs.is_s2_format);

However, the GetPhysAddrResult struct documents that its fields are
only valid when the page table walk succeeded.  For a two stage page
table walk which fails during stage two, we will return early from
get_phys_addr_twostage() and depending on the fault type the
res.cacheattrs may have been initialized with the stage 2 cache attr
information in stage 2 format.  In this case we will incorrectly
assert here.

Fix the assertion to not look at the res fields if the lookup failed.

Note for stable backports: the do_ats_write() function is in
target/arm/helper.c in older QEMU versions, but the change to the
assert line is the same.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3328
Fixes: 9f225e607f21 ("target/arm: Postpone interpretation of stage 2 descriptor attribute bits")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260331092305.2062580-1-peter.maydell@linaro.org

2 months agoUpdate version for v11.0.0-rc2 release v11.0.0-rc2
Peter Maydell [Wed, 1 Apr 2026 19:48:02 +0000 (20:48 +0100)] 
Update version for v11.0.0-rc2 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'firmware-20260401-for-11.0-pull-request' of https://gitlab.com/kraxel...
Peter Maydell [Wed, 1 Apr 2026 15:47:41 +0000 (16:47 +0100)] 
Merge tag 'firmware-20260401-for-11.0-pull-request' of https://gitlab.com/kraxel/qemu into staging

igvm bugfixes

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmnM6lEACgkQTLbY7tPo
# cTg9BhAA1WRZUp8e3G7wUwZPf8JGztEExXRC8ageNp6c4cmY8WB9BmqdteH4afo/
# ulKzwNk7aI8AdyG5OlIl+aI9MyfEMiOEstdL+Hu2nt8o0Ve5h5uXh9NmqTbcHxNU
# G3lwzTR1mjE5zm8/PZ0mQDMD7MMMbAPrpVCxbUSg13oWxQCG0Tl38w8n9G2RCTZe
# PE1XMRp/tzumzmraxTkCRwleD4Ctq298gS4DG7k8Zlits8Wwak5dDFvphwV7X/na
# Aix4DF0mtXgHHZ4szjX5HZGQq824JdY6keq8vq30kE87rA2/Qz9evhgRelYPPiLH
# /QFGUhHEwL4o5fMZkID852QXA85wRL9XulPIU08jF15jkkhOQZo6nYYQDJvTjtpz
# Lji++Pm8EFxvbDqO8TrSagXA0Y7DQ0GTzj5wuJ/5jIePA1trfV9dypjrT9vpOIg/
# iKM+kT8vb05Fid0v12thI0/7bAcnTMv+BNjtkiMYkQ8PIgSfEDbHYS6OBelXSHY0
# aw8I85UORuzqq5DDFRvY7WqpZ4Rd+vHDh9lBpnPEI6QheLFSV39zHpveNlB14z4Q
# r7CO9pQKvxU44qEpIiDQ36AJT8udBt4e9rBpBoRTbq77hbU0APKllpn89yb0YckQ
# uhoJnF8glP7kuu0aMz8OLHDFvZwmlSm/HuOFw4pbmE0WtLPnEcY=
# =rhi3
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Apr  1 10:50:09 2026 BST
# 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-20260401-for-11.0-pull-request' of https://gitlab.com/kraxel/qemu:
  igvm: fix parent object type in IgvmCfg struct
  igvm: fix memory leak on failed memory region init
  igvm: switch to PRIx64

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'pull-linux-user-20260401' of https://gitlab.com/pm215/qemu into staging
Peter Maydell [Wed, 1 Apr 2026 09:49:09 +0000 (10:49 +0100)] 
Merge tag 'pull-linux-user-20260401' of https://gitlab.com/pm215/qemu into staging

linux-user:
 * don't incorrectly sign extend guest addresses from mlock etc
 * fix name_to_handle_at when AT_HANDLE_MNT_ID_UNIQUE flag is set
 * update select timeout writeback
 * make openat2() use -L for absolute paths
 * correctly handle SIGSEGV generated when trying to deliver
   a synchronous signal

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmnM6b0ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3utoEACFpsqPLc4bTYZfIOy7Q8qW
# Kd9w/QT2Wyp5eZ52efxXopimpB7yKfIbHOB6MF1lHELfwkrDZ04CcD2q+JSR9Zce
# Zydl11nMdmhIzsWmfUju5qzrQQmx+F9pjC2nntt6QAqixMKqj6DLNEClK9QXp1WX
# q9XfJVju5JgciiUlC/Ne01GmKv1xGV3PkZy6BOzi1n3BVFyqb+wWP1G83KKIYoSN
# VCgs5IOh53qEwlPYMKzDJAUJhc3Ba2LvC4xQ2rAZlHTAoejcJHMtKjd/8ZNebGTo
# juO+7GpqxBhAQUFrmsaLidD7kiNcTMpWV5N25BDG+QFlD7pRdwk7hPrrtTHUCw7c
# H+HKKmCTUoTgoucNzkfokX58YTOOyG4Uh2eRnQ03SCd2bVX2Oesq2WYIkaJ6kY/D
# JukzaTGHLZHYzze7vmZe0dGdWWFox5MqbuNOuALan+sCq+VsznCOI2quXFovU/9m
# OCYRYwB5sAPmAd1yVvkwl53xfhyXvwCPJhzBTq9YfY6RAtqufgq1zfFPiMqvQNMi
# AZRTIcB+YXxk3fOa/xAMKF7GAzYujNbKCC/DTE2EnaqgpDHqUyQxQXSUJiAiR0os
# yI1XL/1I7dKEsV+ZdNJtQiWFdLJvi0f3C15jq1ICqzQViI2Dk27MVNAhYhda4ueo
# sr9PJ85vQk8bKu7+Ng2qYg==
# =jmT5
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Apr  1 10:47:41 2026 BST
# 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-linux-user-20260401' of https://gitlab.com/pm215/qemu:
  bsd-user, linux-user: signal: recursive signal delivery fix
  linux-user: Make openat2() use -L for absolute paths
  linux-user: update select timeout writeback
  linux-user: fix name_to_handle_at when AT_HANDLE_MNT_ID_UNIQUE flag is set
  include/user/guest-host.h: Provide g2h etc for both abi_ptr and vaddr
  include: Don't include guest-host.h in cpu-ldst.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'hppa-more-v11-fixes-pull-request' of https://github.com/hdeller/qemu-hppa...
Peter Maydell [Tue, 31 Mar 2026 19:46:13 +0000 (20:46 +0100)] 
Merge tag 'hppa-more-v11-fixes-pull-request' of https://github.com/hdeller/qemu-hppa into staging

HPPA patches for qemu-v11

A few late fixes for the HPPA architecture for QEMU v11:
- graphics support was broken for 64-bit machines. This series adds
  support for VGA graphics for Linux guests
- the various memory ranges were not correctly implemented
- TOC/NMI was not working on 64-bit machines
- minor 64-bit HP-UX boot fixes (but HP-UX 64-bit still crashes)

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCacwXxAAKCRD3ErUQojoP
# X7NxAQCBszDUKsNX5KiB+cxW1AfT1Gyzo4q9T0NNULO5v2Fn7gD/YVzgtZ6F+crK
# 1eG1R0aVekPmx+NClsCLvy/dX1YmTww=
# =L+6i
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Mar 31 19:51:48 2026 BST
# 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 'hppa-more-v11-fixes-pull-request' of https://github.com/hdeller/qemu-hppa:
  target/hppa: Update SeaBIOS-hppa to version 24
  hw/hppa: Implement memory ranges
  target/hppa: Fix TOC handler for 64-bit CPUs
  hw/pci-host/astro: Add GMMIO mapping
  hw/pci-host/astro: Fix LMMIO DIRECT mappings
  hw/pci-host/astro: Implement LMMIO registers
  hw/pci-host/astro: Fix initial addresses in IOC
  hw/pci-host/astro: Make astro address arrays accessible for other users

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/hppa: Update SeaBIOS-hppa to version 24
Helge Deller [Tue, 31 Mar 2026 18:24:24 +0000 (20:24 +0200)] 
target/hppa: Update SeaBIOS-hppa to version 24

New SeaBIOS-hppa v24 release with various fixes for qemu-v11:
- Initialize Astro chip with relevant LMMIO, GMMIO and others
- Disable Artist on 64-bit machines
- Fully implement parisc memory ranges
- Change inventory to list CPU first for HP-UX
- Allow 715 to boot from HP-UX 11iv1 CD-ROM
- Prepare for MULTICELL machines
- Initialize PCI_CACHE_LINE_SIZE PCI value
- Call TOC/HPMC handler code from OS if installed

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/hppa: Implement memory ranges
Helge Deller [Sun, 29 Mar 2026 22:11:12 +0000 (00:11 +0200)] 
hw/hppa: Implement memory ranges

All 64-bit PA-RISC machines split the memory into (up to 3) different
memory ranges, which are mapped at specific addresses.  This patch
mimics the mapping as it's done on physical machines, which includes the
3.75 GB split for C3700, and 1 GB split for newer 64-bit PAT machines
like the A400.

SeaBIOS-hppa needs to know how the memory split is done, so add a new
memsplit_addr variable which stores the specific split address and hand
this over to SeaBIOS-hppa via fwcfg.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agotarget/hppa: Fix TOC handler for 64-bit CPUs
Helge Deller [Sun, 29 Mar 2026 18:46:52 +0000 (20:46 +0200)] 
target/hppa: Fix TOC handler for 64-bit CPUs

When the TOC handler is triggered, e.g. by using the "NMI" command
in the QEMU monitor, make sure to call the full 64-bit TOC handler
address in SeaBIOS-hppa firmware.
This fixes the TOC handler on 64-bit CPUs (and 64-bit SeaBIOS).

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/pci-host/astro: Add GMMIO mapping
Helge Deller [Sat, 28 Mar 2026 23:34:59 +0000 (00:34 +0100)] 
hw/pci-host/astro: Add GMMIO mapping

Implement the GMMIO mapping.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/pci-host/astro: Fix LMMIO DIRECT mappings
Helge Deller [Sat, 28 Mar 2026 23:30:36 +0000 (00:30 +0100)] 
hw/pci-host/astro: Fix LMMIO DIRECT mappings

Fix the existing code which has the mask wrong.
Implement the direct mapping via overlapping subregion with priority 3
to make sure the direct mapping gets precedence over the LMMIO region.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/pci-host/astro: Implement LMMIO registers
Helge Deller [Sat, 28 Mar 2026 23:26:14 +0000 (00:26 +0100)] 
hw/pci-host/astro: Implement LMMIO registers

Add code to adjust the memory mapping windows according to the LMMIO registers
in Astro.  This allows SeaBIOS-hppa to configure Astro depending on existing
PCI cards, and especially makes it possible to enable a VGA PCI card.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/pci-host/astro: Fix initial addresses in IOC
Helge Deller [Sat, 28 Mar 2026 23:15:12 +0000 (00:15 +0100)] 
hw/pci-host/astro: Fix initial addresses in IOC

F-Extend the LMMIO and IOS distributed addresses.
Use the 44-bit address for the IOS distributed address.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agohw/pci-host/astro: Make astro address arrays accessible for other users
Helge Deller [Sat, 28 Mar 2026 23:12:09 +0000 (00:12 +0100)] 
hw/pci-host/astro: Make astro address arrays accessible for other users

Move the tables out of astro_realize(). This is needed because follow-up
patches will need those tables.

Signed-off-by: Helge Deller <deller@gmx.de>
2 months agobsd-user, linux-user: signal: recursive signal delivery fix
Nicholas Piggin [Sat, 21 Mar 2026 13:56:22 +0000 (23:56 +1000)] 
bsd-user, linux-user: signal: recursive signal delivery fix

Synchronous signals must accommodate a synchronous signal being
raised during delivery, as asynchronous ones do. For example
badframe errors during delivery will cause SIGSEGV to be raised.

Without this fix, cpu_loop() runs process_pending_signals() which
delivers the first synchronous signal (e.g., SIGILL) which fails
to set the handler and forces SIGSEGV, but that is not picked up.
process_pending_signals() returns. Then cpu_loop() runs cpu_exec()
again, which attempts to execute the same instruction, another
SIGILL.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260321135624.581398-3-npiggin@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agolinux-user: Make openat2() use -L for absolute paths
Sun Haoyu [Tue, 17 Mar 2026 05:38:27 +0000 (13:38 +0800)] 
linux-user: Make openat2() use -L for absolute paths

openat2() ignored the -L prefix and opened host files directly.
For example, openat2("/tmp/file") opened /tmp/file on the host, not
QEMU_LD_PREFIX/tmp/file like openat() does.

Fix this by using path() to rewrite absolute paths. Skip this
when RESOLVE_BENEATH or RESOLVE_IN_ROOT is set:
- RESOLVE_BENEATH rejects absolute paths anyway
- RESOLVE_IN_ROOT resolves relative to dirfd

Now openat() and openat2() work in the same way.

Link: https://gitlab.com/qemu-project/qemu/-/work_items/3341
Signed-off-by: Sun Haoyu <shyliuli@aosc.io>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260317053827.25051-1-shyliuli@aosc.io
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agolinux-user: update select timeout writeback
Sun Haoyu [Fri, 20 Mar 2026 11:16:47 +0000 (19:16 +0800)] 
linux-user: update select timeout writeback

The Linux kernel writes back the remaining timeout for select-family
syscalls in poll_select_finish(). If that writeback fails, it keeps
the original return value.

However, QEMU only writes back the timeout on success. If the writeback
fails, QEMU returns -TARGET_EFAULT. This can lose the remaining
timeout and change the return value.

Update do_select(), do_pselect6(), and do_ppoll() to always write back
the timeout to match the Linux kernel's behavior. If the timeout
writeback fails, keep the original return value.

Tested with the issue reproducer.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3343
Signed-off-by: Sun Haoyu <shyliuli@aosc.io>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260320111647.138984-1-shyliuli@aosc.io
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>