]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
2 months agomigration: vmstate_load_state(): add some newlines
Vladimir Sementsov-Ogievskiy [Wed, 4 Mar 2026 21:22:48 +0000 (00:22 +0300)] 
migration: vmstate_load_state(): add some newlines

Split logical blocks by newlines, that simplify reading the code.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260304212303.667141-5-vsementsov@yandex-team.ru
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agomigration: make .post_save() a void function
Vladimir Sementsov-Ogievskiy [Wed, 4 Mar 2026 21:22:47 +0000 (00:22 +0300)] 
migration: make .post_save() a void function

All other handlers now have _errp() variants. Should we go this way
for .post_save()? Actually it's rather strange, when the vmstate do
successful preparations in .pre_save(), then successfully save all
sections and subsections, end then fail when all the state is
successfully transferred to the target.

Happily, we have only three .post_save() realizations, all always
successful. Let's make this a rule.

Also note, that we call .post_save() in two places, and handle
its (theoretical) failure inconsistently. Fix that too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com> #rust
Link: https://lore.kernel.org/qemu-devel/20260304212303.667141-4-vsementsov@yandex-team.ru
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agomigration: make vmstate_save_state_v() static
Vladimir Sementsov-Ogievskiy [Wed, 4 Mar 2026 21:22:46 +0000 (00:22 +0300)] 
migration: make vmstate_save_state_v() static

It's used only in vmstate.c.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260304212303.667141-3-vsementsov@yandex-team.ru
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agomigration: vmstate_save_state_v: fix double error_setg
Vladimir Sementsov-Ogievskiy [Wed, 4 Mar 2026 21:22:45 +0000 (00:22 +0300)] 
migration: vmstate_save_state_v: fix double error_setg

We may call error_setg twice on same errp if inner
vmstate_save_state_v() or vmstate_save_state() call fails. Next we will
crash on assertion in error_setv().

Fixes: 848a0503422d043 "migration: Update error description outside migration.c"
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260304212303.667141-2-vsementsov@yandex-team.ru
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agotests/functional: Make socat wait longer in migration exec test
Fabiano Rosas [Wed, 22 Apr 2026 23:00:01 +0000 (20:00 -0300)] 
tests/functional: Make socat wait longer in migration exec test

The migration_with_exec test is failing sporadically for all
architectures due to a race when the destination socat process takes
too long to start listening while the source process is already
issuing connect().

The race is inherent because the exec: migration spawns the
to-be-exec'ed command asynchronously and returns from the
migrate-incoming command. The localhost-only testcase is not
representative of the majority of migrations. In a real scenario
between two different hosts that race wouldn't happen.

Fix the testcase by configuring the source socat command to wait
indefinitely while trying to connect.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260422230001.3168-1-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agohw/display: don't accidentally autofree existing virgl resources
Alex Bennée [Fri, 17 Apr 2026 12:27:03 +0000 (13:27 +0100)] 
hw/display: don't accidentally autofree existing virgl resources

While sanity checking a create blob operation the use of the auto
freed res variable could lead to inadvertently freeing an existing
blob.

Avoid this by in-lining the virtio_gpu_virgl_find_resource() check as
the value is not needed anyway.

While at it add a comment to the end and use g_steal_pointer to make
it clearer the object lifetime exceeds the function bounds if we pass
all the checks.

Fixes: CVE-2026-6502
Fixes: 7c092f17cce (virtio-gpu: Handle resource blob commands)
Message-ID: 20260417094443.785462-1-alex.bennee@linaro.org
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-stable@nongnu.org
Message-ID: <20260417122703.845442-1-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
2 months agoui/sdl2: Fix assumption of EGL presence at runtime
Anthony Roberts [Thu, 9 Apr 2026 11:02:55 +0000 (12:02 +0100)] 
ui/sdl2: Fix assumption of EGL presence at runtime

The original commit had a section of code which worked on the assumption
that if OpenGL was enabled at build, it was present on the end user machine,
and calls could be made to it. This is not always the case (such as Windows
on Arm devices).

This line should have also included a runtime check.

This commit moves the relevant line to inside a runtime check for OpenGL.

Fixes: 52053b7e0a0e ("ui/sdl2: Implement dpy dmabuf functions")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3347
Cc: qemu-stable@nongnu.org
Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20260409110256.684-1-anthony.roberts@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2 months agocheckpatch: Allow spaces after all coroutine annotations
Fabiano Rosas [Mon, 20 Apr 2026 19:13:56 +0000 (16:13 -0300)] 
checkpatch: Allow spaces after all coroutine annotations

The coroutine annotations may be used in the declaration of function
pointers, which triggers checkpatch due to the space before the
parentheses. E.g:

  int coroutine_fn (*run)(Job *job, Error **errp);
                  ^
The coroutine_fn annotation is already included in the list of terms
where spaces are allowed. Add the other coroutine annotations:
coroutine_mixed_fn and no_coroutine_fn.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260420191356.4439-1-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2 months agotarget/i386: emulate: include name of unhandled instruction
Mohamed Mediouni [Tue, 7 Apr 2026 14:17:57 +0000 (16:17 +0200)] 
target/i386: emulate: include name of unhandled instruction

Instead of just the command number, include the instruction name to make debugging easier.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260407141809.16862-2-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agomemory: Optimize flatview_simplify() to eliminate redundant memmove calls
Bin Guo [Tue, 31 Mar 2026 06:07:31 +0000 (14:07 +0800)] 
memory: Optimize flatview_simplify() to eliminate redundant memmove calls

The original flatview_simplify() implementation uses memmove() to shift
array elements after each merge operation, resulting in O(n²) time
complexity in the worst case. This is inefficient for VMs with large
memory topologies containing hundreds of MemoryRegions.

Replace the memmove-based approach with a two-pointer in-place compression
algorithm that achieves O(n) time complexity. The new algorithm uses a
write pointer i and a read pointer j, where i ≤ j is always maintained.
This invariant ensures we never overwrite unprocessed data, making memmove
unnecessary.

Signed-off-by: Bin Guo <guobin@linux.alibaba.com>
Link: https://lore.kernel.org/r/20260331060731.82641-1-guobin@linux.alibaba.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agomeson: add missing semicolon in pthread_condattr_setclock test
Stepan Popov [Mon, 30 Mar 2026 13:14:06 +0000 (16:14 +0300)] 
meson: add missing semicolon in pthread_condattr_setclock test

The test code was missing a semicolon after the pthread_condattr_t
variable declaration.

Signed-off-by: Stepan Popov <Stepan.Popov@kaspersky.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Fixes: 657ac98b58c ("thread-posix: use monotonic clock for QemuCond and QemuSemaphore", 2022-02-22)
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260330131406.87080-1-Stepan.Popov@kaspersky.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agothread-win32: replace CRITICAL_SECTION with SRWLOCK
Paolo Bonzini [Mon, 30 Mar 2026 14:17:15 +0000 (16:17 +0200)] 
thread-win32: replace CRITICAL_SECTION with SRWLOCK

SRWLOCK is a much cheaper primitive than CRITICAL_SECTION, which
basically exists only as a legacy API.  The SRWLOCK is a single word
in memory and it is cheaper to just initialize it always.

Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/i386/tcg: fix decoding of MOVBE and CRC32 in 16-bit mode
Paolo Bonzini [Tue, 31 Mar 2026 06:32:23 +0000 (08:32 +0200)] 
target/i386/tcg: fix decoding of MOVBE and CRC32 in 16-bit mode

Table A-4 of the SDM shows

                    F0                     F1
--------------------------------------------------------
     NP           MOVBE Gy,My           MOVBE My,Gy
     66           MOVBE Gw,Mw           MOVBW Mw,Gw
     F2           CRC32 Gd,Eb           CRC32 Gd,Ey
  66+F2           CRC32 Gd,Eb           CRC32 Gd,Ew

However, this is incorrect.  Both MOVBE and (for 0xF1) CRC32
take Gv, Ev or Mv operands.  In 16-bit mode therefore the
operand is of 16-bit size without prefix and 32-bit mode
with 0x66 (the data size override).

For example, with NASM you get:

                                 bits 16
   67 0F 38 F0 02                movbe ax, [edx]
   66 67 0F 38 F0 02             movbe eax, [edx]

   67 F2 0F 38 F1 02             crc32 ax, word [edx]
   66 67 F2 0F 38 F1 02          crc32 eax, dword [edx]

versus

                                 bits 32
   66 0F 38 F0 02                movbe ax, [edx]
   0F 38 F0 02                   movbe eax, [edx]

   66 F2 0F 38 F1 02             crc32 eax, word [edx]
   F2 0F 38 F1 02                crc32 eax, dword [edx]

The instruction is listed correctly in the APX documentation
as "SCALABLE" (which means it has v-size operands).

Cc: qemu-stable@nongnu.org
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoaccel/mshv: return correct errno value from ioeventfd failure
Aastha Rawat [Thu, 9 Apr 2026 11:53:07 +0000 (11:53 +0000)] 
accel/mshv: return correct errno value from ioeventfd failure

Returning the raw ioctl return value results in misleading error
message. Ensure that actual failure reason is propagated by returning
-errno for ioeventfd failure.

Signed-off-by: Aastha Rawat <aastharawat@linux.microsoft.com>
Reviewed-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260409-fix_ioevent-v1-2-053b810ae6fb@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoaccel/mshv: fix ioeventfd deassignment to forward correct datamatch value
Aastha Rawat [Thu, 9 Apr 2026 11:53:06 +0000 (11:53 +0000)] 
accel/mshv: fix ioeventfd deassignment to forward correct datamatch value

unregister_ioevent() is not forwarding the datamatch (queue index) to
the mshv driver, causing only the first VirtIO-MMIO queue to be
deassigned correctly. Subsequent queues fail with `-ENOENT`, triggering
a fatal abort().

This failure was discovered while booting arm64 EDK2 firmware with mshv
accel.

Signed-off-by: Aastha Rawat <aastharawat@linux.microsoft.com>
Reviewed-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260409-fix_ioevent-v1-1-053b810ae6fb@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/i386/mshv: Fix segment regression in MMIO emu
Magnus Kulke [Fri, 10 Apr 2026 14:26:52 +0000 (16:26 +0200)] 
target/i386/mshv: Fix segment regression in MMIO emu

When the segmentation code has been reworked, there is now an
unconditional call to emul_ops->read_segment_descriptor(). The MSHV impl
was delegating this to x86_read_segement_descriptor(), which read from
the GDT in guest memory. This fails for selector.idx == 0 and when no
GDT is set up (which is the case in real mode).

In the fix we change the MSHV impl to fill segment descriptor from
SegmentCache, that was populated from the hypervisor by mshv_load_regs()
before instruction emulation.

Fixes: 09442d98ab (target/i386: emulate: segmentation rework)
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260410142652.367541-1-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agomeson: Don't require nm for non-modular builds
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:44:01 +0000 (15:44 +0200)] 
meson: Don't require nm for non-modular builds

In the MSVC build environment, nm is missing; at the same time,
scripts/undefsym.py exits with code 0 at the beginning
for non-modular builds.

So, this change is harmless because it already didn't do anything
in non-modular builds, but remove the additional tool requirements.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260327134401.270186-16-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agostorage-daemon: use same link arguments as other tools
Paolo Bonzini [Fri, 27 Mar 2026 13:44:00 +0000 (15:44 +0200)] 
storage-daemon: use same link arguments as other tools

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20260327134401.270186-15-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoutil: Remove unused sys/param.h
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:59 +0000 (15:43 +0200)] 
util: Remove unused sys/param.h

We dropped the use of PATH_MAX in commit f3a8bdc1d5b26 (which
basically completely rewrote the path handling).
Now we don't need any sys/param.h defines.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260327134401.270186-14-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoutil: Remove unused dirent.h
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:58 +0000 (15:43 +0200)] 
util: Remove unused dirent.h

This one is OK to drop, because the rewrite of path.c in
commit f3a8bdc1d5b26 removed the uses of the dirent.h functions.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-13-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoosdep: Remove unused strings.h
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:57 +0000 (15:43 +0200)] 
osdep: Remove unused strings.h

We don't use strcasecmp/strncasecmp anymore. Also, we don't
use any other strings.h function. So this include is no more
needed.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-12-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agohw/ppc: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:56 +0000 (15:43 +0200)] 
hw/ppc: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-11-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/xtensa: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:55 +0000 (15:43 +0200)] 
target/xtensa: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-10-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/ppc: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:54 +0000 (15:43 +0200)] 
target/ppc: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-9-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/riscv: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:53 +0000 (15:43 +0200)] 
target/riscv: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-8-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/sparc: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:52 +0000 (15:43 +0200)] 
target/sparc: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here
 (2) we want the comparison on boolean property value to be a plain
     ASCII one, not to do weird things with "I" in Turkish locales,
     so g_ascii_strcasecmp() is better as it's explicit about that

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-7-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoio: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:50 +0000 (15:43 +0200)] 
io: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here
 (2) we want the comparison data in HTTP header and it should be a plain
     ASCII one, not to do weird things with "I" in Turkish locales,
     so g_ascii_strcasecmp() is better as it's explicit about that

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-5-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoblock: Use glib2 instead of strcasecmp/strncasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:49 +0000 (15:43 +0200)] 
block: Use glib2 instead of strcasecmp/strncasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here
 (2) we want the comparison on url prefix and it should be a plain ASCII
     one, not to do weird things with "I" in Turkish locales,
     so g_ascii_strcasecmp() is better as it's explicit about that

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-4-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoqom: Use g_ascii_strcasecmp instead of strcasecmp
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:48 +0000 (15:43 +0200)] 
qom: Use g_ascii_strcasecmp instead of strcasecmp

This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here
 (2) we want the comparison on class names to be a plain ASCII
     one, not to do weird things with "I" in Turkish locales,
     so g_ascii_strcasecmp() is better as it's explicit about that

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20260327134401.270186-3-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agomeson: Use stddef.h instead of unistd.h
Kostiantyn Kostiuk [Fri, 27 Mar 2026 13:43:47 +0000 (15:43 +0200)] 
meson: Use stddef.h instead of unistd.h

POSIX says stddef.h provides size_t, which is the only thing
we care about here. unistd.h can be missing in non-POSIX runtimes,
so include stddef.h instead.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-2-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agohw: i386: vapic: restore IRQ polling for non-kernel irqchip backends
rickgcn [Sat, 18 Apr 2026 06:14:29 +0000 (14:14 +0800)] 
hw: i386: vapic: restore IRQ polling for non-kernel irqchip backends

69dfc078 extended vAPIC handling for WHPX with user-mode irqchip, but it
also changed vapic_write() case 4 in a way that excludes TCG from
apic_poll_irq().

Before that change, IRQ polling happened whenever no in-kernel irqchip
was active. After the change, it only happened for KVM or WHPX with a
user-mode irqchip. Under TCG, both kvm_enabled() and whpx_enabled() are
false, so the poll never happens.

This regresses 32-bit Windows XP guests on a Windows host with
-machine pc-i440fx-10.0,accel=tcg, causing a STOP 0x0000000A during boot.

Fix it by making the decision depend on whether KVM or WHPX is using an
in-kernel irqchip, instead of whether either accelerator is enabled.

Fixes: 69dfc078a6f0 ("hw: i386: vapic: enable on WHPX with user-mode irqchip")
Signed-off-by: rickgcn <rickgcn@gmail.com>
Link: https://lore.kernel.org/r/20260418061429.16898-1-rickgcn@gmail.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/i386: fix missing PF_INSTR in SIGSEGV context
Simon Scherer [Mon, 13 Apr 2026 11:56:22 +0000 (13:56 +0200)] 
target/i386: fix missing PF_INSTR in SIGSEGV context

When running linux-user emulation, the SIGSEGV handler does not
correctly set the 4th bit (PF_INSTR) in the error_code variable of
the context argument (context->uc_mcontext.gregs[REG_ERR]).

Because this bit is never set, guest applications cannot distinguish
if a fault was due to missing executable permissions. This patch
ensures that when a page fault occurs during an instruction fetch,
the PF_INSTR flag is properly populated in the signal context.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3384
Signed-off-by: Simon Scherer <scherer.simon89@gmail.com>
Link: https://lore.kernel.org/r/20260413115622.160212-1-scherer.simon89@gmail.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agotarget/i386: fix strList leak in x86_cpu_get_unavailable_features
Marc-André Lureau [Mon, 13 Apr 2026 12:50:40 +0000 (16:50 +0400)] 
target/i386: fix strList leak in x86_cpu_get_unavailable_features

The result list built by x86_cpu_list_feature_names() was never freed
after being visited, causing a memory leak detected by ASan.
(the getter visitor is VISITOR_OUTPUT kind and doesn't own data)

Fixes: 506174bf8219 ("i386: "unavailable-features" QOM property")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260413125040.3842686-1-marcandre.lureau@redhat.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 months agoMAINTAINERS: Remove Xie Changlong
Peter Maydell [Thu, 16 Apr 2026 09:16:54 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Xie Changlong

Xie Changlong has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "Replication" block filter orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-id: 20260416091654.316158-29-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Xiao Guangrong
Peter Maydell [Thu, 16 Apr 2026 09:16:53 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Xiao Guangrong

Xiao Guangrong has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-28-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Wen Congyang
Peter Maydell [Thu, 16 Apr 2026 09:16:52 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Wen Congyang

Wen Congyang has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-id: 20260416091654.316158-27-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Yanan Wang
Peter Maydell [Thu, 16 Apr 2026 09:16:51 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Yanan Wang

Yanan Wang has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20260416091654.316158-26-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Vijai Kumar K
Peter Maydell [Thu, 16 Apr 2026 09:16:50 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Vijai Kumar K

Vijai Kumar K has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the Shakti C class RISC-V SoC orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-25-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Su Hang
Peter Maydell [Thu, 16 Apr 2026 09:16:49 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Su Hang

Su Hang has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the Intel Hexadecimal Object File Loader orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-24-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Shannon Zhao
Peter Maydell [Thu, 16 Apr 2026 09:16:48 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Shannon Zhao

Shannon Zhao has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "ARM ACPI Subsystem" orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-23-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Ryo ONODERA
Peter Maydell [Thu, 16 Apr 2026 09:16:47 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Ryo ONODERA

Ryo ONODERA has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-22-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Ronnie Sahlberg
Peter Maydell [Thu, 16 Apr 2026 09:16:46 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Ronnie Sahlberg

Ronnie Sahlberg has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-21-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Luigi Rizzo
Peter Maydell [Thu, 16 Apr 2026 09:16:45 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Luigi Rizzo

Luigi Rizzo has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-20-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Qiuhao Li
Peter Maydell [Thu, 16 Apr 2026 09:16:44 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Qiuhao Li

Qiuhao Li has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-19-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Jia Liu
Peter Maydell [Thu, 16 Apr 2026 09:16:43 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Jia Liu

Jia Liu has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the or1k-sim OpenRISC machine orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-18-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Paul Burton
Peter Maydell [Thu, 16 Apr 2026 09:16:42 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Paul Burton

Paul Burton has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-17-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Aarushi Mehta
Peter Maydell [Thu, 16 Apr 2026 09:16:41 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Aarushi Mehta

Aarushi Mehta has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-16-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Marcel Apfelbaum
Peter Maydell [Thu, 16 Apr 2026 09:16:40 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Marcel Apfelbaum

Marcel Apfelbaum has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-15-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Magnus Damm
Peter Maydell [Thu, 16 Apr 2026 09:16:39 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Magnus Damm

Magnus Damm has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-14-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Mahmoud Mandour
Peter Maydell [Thu, 16 Apr 2026 09:16:38 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Mahmoud Mandour

Mahmoud Mandour has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-13-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Bastian Koppelmann
Peter Maydell [Thu, 16 Apr 2026 09:16:37 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Bastian Koppelmann

Bastian Koppelmann has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the Tricore TCG CPUs orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-12-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Huai-Cheng Kuo
Peter Maydell [Thu, 16 Apr 2026 09:16:36 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Huai-Cheng Kuo

Huai-Cheng Kuo has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes "PCIE DOE" orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-11-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Dongjiu Geng
Peter Maydell [Thu, 16 Apr 2026 09:16:34 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Dongjiu Geng

Dongjiu Geng has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "ACPI/HEST/GHES" section orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-9-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Ed Maste
Peter Maydell [Thu, 16 Apr 2026 09:16:33 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Ed Maste

Ed Maste has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-8-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Damien Hedde
Peter Maydell [Thu, 16 Apr 2026 09:16:32 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Damien Hedde

Damien Hedde has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-7-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Coiby Xu
Peter Maydell [Thu, 16 Apr 2026 09:16:31 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Coiby Xu

Coiby Xu has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "Vhost-user block device backend server" orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-6-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Jeff Cody
Peter Maydell [Thu, 16 Apr 2026 09:16:30 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Jeff Cody

Jeff Cody has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "VHDX" block driver orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-5-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Beniamino Galvani
Peter Maydell [Thu, 16 Apr 2026 09:16:29 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Beniamino Galvani

Beniamino Galvani has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-4-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Anup Patel
Peter Maydell [Thu, 16 Apr 2026 09:16:28 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Anup Patel

Anup Patel has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-3-peter.maydell@linaro.org

2 months agoMAINTAINERS: Remove Ahmed Karaman
Peter Maydell [Thu, 16 Apr 2026 09:16:27 +0000 (10:16 +0100)] 
MAINTAINERS: Remove Ahmed Karaman

Ahmed Karaman has not posted to qemu-devel in some years and did not
respond to a query about whether they still wished to be listed in
our MAINTAINERS file.  Remove them, on the assumption that they are
no longer active in QEMU.

This makes the "Performance Tools and Tests" orphan.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260416091654.316158-2-peter.maydell@linaro.org

2 months agotarget/arm: Remove target_ulong use in hvf_handle_psci_call()
Philippe Mathieu-Daudé [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm: Remove target_ulong use in hvf_handle_psci_call()

Similarly to commit 3580aa03547 ("target/arm/tcg/psci.c: make
compilation unit common") which replaced the target_ulong use in
arm_handle_psci_call(), replace the one in hvf_handle_psci_call.

This could be vaddr, because entry is the start pc for the on-lining
cpu, but we prefer uint64_t because this is what we get in param[]
and pass to arm_set_cpu_on().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260410194227.16357-1-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm: Replace target_ulong -> vaddr in guarded_page_br()
Philippe Mathieu-Daudé [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm: Replace target_ulong -> vaddr in guarded_page_br()

Following commit 15500df3b3b ("target/arm/tcg/translate.h: replace
target_ulong with vaddr") change, adapt guarded_page_br().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260401143456.79843-1-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: make compilation unit common

We removed all target specifics, and can finally compile this file only
once.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-22-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: remove target_ulong
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: remove target_ulong

We can replace it with uint32_t, because we know it's limited to 32-bit
target.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-21-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/cpu.c: simplify endianness handling in arm_disas_set_info
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm/cpu.c: simplify endianness handling in arm_disas_set_info

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260407222208.271838-20-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: replace translator_ldl_swap with translator_ldl_end
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:11 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: replace translator_ldl_swap with translator_ldl_end

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260407222208.271838-19-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/arm_ldst.h: merge in translate.c
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/arm_ldst.h: merge in translate.c

Only translate.c uses those functions, thus move them back to this file.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260407222208.271838-18-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate-a64.c: use translator_ldl_end instead of arm_ldl_code
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate-a64.c: use translator_ldl_end instead of arm_ldl_code

Allows to reduce scope of target/arm/tcg/arm_ldst.h to aarch32 only.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-17-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: replace TCGv with TCGv_va
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: replace TCGv with TCGv_va

We know this file is for 32-bit runtime target, so we can set
TCG_ADDRESS_BITS. TCG_TYPE_VA is derived accordingly and is already
passed to translator_loop.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260407222208.271838-16-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotcg/translator: add parameter to translator_loop for current addr type
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
tcg/translator: add parameter to translator_loop for current addr type

With TCG_ADDRESS_BITS mechanism, it's now possible to specify which
variant every source file is written for. Compared to before, it means
that addr_type will now vary per tb translation, where it was constant
for a given target previously.

Thus, we add new a parameter to translator_loop().
This will allow us to convert targets one by one.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260407222208.271838-15-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: extract aarch64_translate_code()
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: extract aarch64_translate_code()

This allows to get rid of TARGET_AARCH64, and helps with next patch
which will define at runtime tcg address type, by adding a second entry
point in a different source file.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-14-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: replace target_ulong with uint32_t
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: replace target_ulong with uint32_t

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-13-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.c: remove MO_TE usage
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.c: remove MO_TE usage

dc->be_data is already set just above in the same function:
```
    dc->be_data = EX_TBFLAG_ANY(tb_flags, BE_DATA) ? MO_BE : MO_LE;
```

Cc: qemu-stable@nongnu.org
Fixes: a729a46b05a ("target/arm: Add wrapper macros for accessing tbflags")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-12-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/gengvec.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/gengvec.c: make compilation unit common

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-11-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/op_helper.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/op_helper.c: make compilation unit common

Remove unused header accel/tcg/cpu-ldst.h that has target specifics.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-10-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate-m-nocp.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate-m-nocp.c: make compilation unit common

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-9-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate-mve.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate-mve.c: make compilation unit common

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-8-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate-neon.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate-neon.c: make compilation unit common

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-7-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate-vfp.c: make compilation unit common
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate-vfp.c: make compilation unit common

Generated decode files must be duplicated between user and system, as
they are generated in private folders per libs, and can't be included
otherwise, as meson does not give control on output folder.
Indeed, meson generator is a different approach than custom_target, and
this is a limitation by design.

They were already duplicated between arch variants anyway, so nothing
new here. They will now be compiled once for system binaries, and still
per target for user binaries.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-6-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.h: remove TARGET_AARCH64
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.h: remove TARGET_AARCH64

We need to stub a64_translate_init and gen_a64_update_pc.
At this point, we don't need to do anything for aarch64_translator_ops
since it's just an external symbol.

We can now include target/arm/tcg/translate.h from common code, since
all target specific bits have been removed, or can be specialized with
specific defines.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-5-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg/translate.h: remove tcg-op-gvec.h include
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/tcg/translate.h: remove tcg-op-gvec.h include

Include tcg-op-gvec-common.h instead.
No target/arm code rely on target specifics for gvec ops.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-4-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/translate.h: remove tcg-op.h include
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm/translate.h: remove tcg-op.h include

Include tcg-op-common.h instead, and include target specific tcg-op.h in
files needing it. This intermediate step allows to clean up every file
(TCGv, tcg_gen.*_tl.*) in separate commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-3-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoinclude/tcg/tcg-op: extract memory operations to tcg-op-mem.h
Pierrick Bouvier [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
include/tcg/tcg-op: extract memory operations to tcg-op-mem.h

This new header defines a new type for target virtual address,
independent from TCGv and is parameterized by a new define
TCG_ADDRESS_BITS (name was suggested by Paolo instead of
TARGET_ADDRESS_BITS).

By default, tcg-op.h include set this define to TARGET_LONG_BITS, but
it's also possible to include only tcg-op-common.h and tcg-op-mem.h and
set TCG_ADDRESS_BITS manually, which is what next commits will do.

We preserve existing MIT license when extracting this new header.

Implemented from:
https://lore.kernel.org/qemu-devel/a68321f0-3d54-4909-864c-9793cda05b2a@linaro.org/

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260407222208.271838-2-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm: Move OMAP CP15 register definitions to cpregs-omap.c
Alessandro Ratti [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
target/arm: Move OMAP CP15 register definitions to cpregs-omap.c

The OMAP CP15 registers are only relevant to system-mode emulation
of OMAP SoCs. Move them out of the monolithic helper.c into a
dedicated file, following the pattern of cpregs-pmu.c and
cpregs-gcs.c. This reduces the size of helper.c and compiles
the OMAP-specific code out of CONFIG_USER_ONLY builds.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
Message-id: 20260405180826.729652-1-alessandro@0x65c.net
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoUpdate the ACPI tables based on new aml-build.c
Alireza Sanaee [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
Update the ACPI tables based on new aml-build.c

The disassembled differences between actual and expected PPTT based on
the following cache topology representation:

- l1d and l1i shared at cluster level
- l2 shared at cluster level
- l3 shared at cluster level

 /*
  * Intel ACPI Component Architecture
  * AML/ASL+ Disassembler version 20230628 (64-bit version)
  * Copyright (c) 2000 - 2023 Intel Corporation
  *
- * Disassembly of tests/data/acpi/aarch64/virt/PPTT.topology, Fri Aug  8 16:50:38 2025
+ * Disassembly of /tmp/aml-JGBZA3, Fri Aug  8 16:50:38 2025
  *
  * ACPI Data Table [PPTT]
  *
  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
  */

 [000h 0000 004h]                   Signature : "PPTT"    [Processor Properties Topology Table]
-[004h 0004 004h]                Table Length : 00000164
+[004h 0004 004h]                Table Length : 00000204
 [008h 0008 001h]                    Revision : 02
-[009h 0009 001h]                    Checksum : 97
+[009h 0009 001h]                    Checksum : B8
 [00Ah 0010 006h]                      Oem ID : "BOCHS "
 [010h 0016 008h]                Oem Table ID : "BXPC    "
 [018h 0024 004h]                Oem Revision : 00000001
 [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
 [020h 0032 004h]       Asl Compiler Revision : 00000001

 [024h 0036 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [025h 0037 001h]                      Length : 14
 [026h 0038 002h]                    Reserved : 0000
 [028h 0040 004h]       Flags (decoded below) : 00000011
                             Physical package : 1
                      ACPI Processor ID valid : 0
                        Processor is a thread : 0
                               Node is a leaf : 0
                     Identical Implementation : 1
@@ -34,223 +34,369 @@
 [030h 0048 004h]           ACPI Processor ID : 00000000
 [034h 0052 004h]     Private Resource Number : 00000000

 [038h 0056 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [039h 0057 001h]                      Length : 14
 [03Ah 0058 002h]                    Reserved : 0000
 [03Ch 0060 004h]       Flags (decoded below) : 00000011
                             Physical package : 1
                      ACPI Processor ID valid : 0
                        Processor is a thread : 0
                               Node is a leaf : 0
                     Identical Implementation : 1
 [040h 0064 004h]                      Parent : 00000024
 [044h 0068 004h]           ACPI Processor ID : 00000000
 [048h 0072 004h]     Private Resource Number : 00000000

-[04Ch 0076 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[04Dh 0077 001h]                      Length : 14
+[04Ch 0076 001h]               Subtable Type : 01 [Cache Type]
+[04Dh 0077 001h]                      Length : 18
 [04Eh 0078 002h]                    Reserved : 0000
-[050h 0080 004h]       Flags (decoded below) : 00000010
+[050h 0080 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[054h 0084 004h]         Next Level of Cache : 00000000
+[058h 0088 004h]                        Size : 00200000
+[05Ch 0092 004h]              Number of Sets : 00000800
+[060h 0096 001h]               Associativity : 10
+[061h 0097 001h]                  Attributes : 0F
+                             Allocation Type : 3
+                                  Cache Type : 3
+                                Write Policy : 0
+[062h 0098 002h]                   Line Size : 0040
+
+[064h 0100 001h]               Subtable Type : 01 [Cache Type]
+[065h 0101 001h]                      Length : 18
+[066h 0102 002h]                    Reserved : 0000
+[068h 0104 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[06Ch 0108 004h]         Next Level of Cache : 0000004C
+[070h 0112 004h]                        Size : 00008000
+[074h 0116 004h]              Number of Sets : 00000080
+[078h 0120 001h]               Associativity : 04
+[079h 0121 001h]                  Attributes : 03
+                             Allocation Type : 3
+                                  Cache Type : 0
+                                Write Policy : 0
+[07Ah 0122 002h]                   Line Size : 0040
+
+[07Ch 0124 001h]               Subtable Type : 01 [Cache Type]
+[07Dh 0125 001h]                      Length : 18
+[07Eh 0126 002h]                    Reserved : 0000
+[080h 0128 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[084h 0132 004h]         Next Level of Cache : 0000004C
+[088h 0136 004h]                        Size : 0000C000
+[08Ch 0140 004h]              Number of Sets : 00000100
+[090h 0144 001h]               Associativity : 03
+[091h 0145 001h]                  Attributes : 07
+                             Allocation Type : 3
+                                  Cache Type : 1
+                                Write Policy : 0
+[092h 0146 002h]                   Line Size : 0040
+
+[094h 0148 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[095h 0149 001h]                      Length : 1C
+[096h 0150 002h]                    Reserved : 0000
+[098h 0152 004h]       Flags (decoded below) : 00000010
                             Physical package : 0
                      ACPI Processor ID valid : 0
                        Processor is a thread : 0
                               Node is a leaf : 0
                     Identical Implementation : 1
-[054h 0084 004h]                      Parent : 00000038
-[058h 0088 004h]           ACPI Processor ID : 00000000
-[05Ch 0092 004h]     Private Resource Number : 00000000
-
-[060h 0096 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[061h 0097 001h]                      Length : 14
-[062h 0098 002h]                    Reserved : 0000
-[064h 0100 004h]       Flags (decoded below) : 00000010
-                            Physical package : 0
-                     ACPI Processor ID valid : 0
-                       Processor is a thread : 0
-                              Node is a leaf : 0
-                    Identical Implementation : 1
-[068h 0104 004h]                      Parent : 0000004C
-[06Ch 0108 004h]           ACPI Processor ID : 00000000
-[070h 0112 004h]     Private Resource Number : 00000000
-
-[074h 0116 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[075h 0117 001h]                      Length : 14
-[076h 0118 002h]                    Reserved : 0000
-[078h 0120 004h]       Flags (decoded below) : 0000000E
-                            Physical package : 0
-                     ACPI Processor ID valid : 1
-                       Processor is a thread : 1
-                              Node is a leaf : 1
-                    Identical Implementation : 0
-[07Ch 0124 004h]                      Parent : 00000060
-[080h 0128 004h]           ACPI Processor ID : 00000000
-[084h 0132 004h]     Private Resource Number : 00000000
-
-[088h 0136 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[089h 0137 001h]                      Length : 14
-[08Ah 0138 002h]                    Reserved : 0000
-[08Ch 0140 004h]       Flags (decoded below) : 0000000E
-                            Physical package : 0
-                     ACPI Processor ID valid : 1
-                       Processor is a thread : 1
-                              Node is a leaf : 1
-                    Identical Implementation : 0
-[090h 0144 004h]                      Parent : 00000060
-[094h 0148 004h]           ACPI Processor ID : 00000001
-[098h 0152 004h]     Private Resource Number : 00000000
-
-[09Ch 0156 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[09Dh 0157 001h]                      Length : 14
-[09Eh 0158 002h]                    Reserved : 0000
-[0A0h 0160 004h]       Flags (decoded below) : 00000010
-                            Physical package : 0
-                     ACPI Processor ID valid : 0
-                       Processor is a thread : 0
-                              Node is a leaf : 0
-                    Identical Implementation : 1
-[0A4h 0164 004h]                      Parent : 0000004C
-[0A8h 0168 004h]           ACPI Processor ID : 00000001
-[0ACh 0172 004h]     Private Resource Number : 00000000
+[09Ch 0156 004h]                      Parent : 00000038
+[0A0h 0160 004h]           ACPI Processor ID : 00000000
+[0A4h 0164 004h]     Private Resource Number : 00000002
+[0A8h 0168 004h]            Private Resource : 0000007C
+[0ACh 0172 004h]            Private Resource : 00000064

 [0B0h 0176 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [0B1h 0177 001h]                      Length : 14
 [0B2h 0178 002h]                    Reserved : 0000
-[0B4h 0180 004h]       Flags (decoded below) : 0000000E
+[0B4h 0180 004h]       Flags (decoded below) : 00000010
                             Physical package : 0
-                     ACPI Processor ID valid : 1
-                       Processor is a thread : 1
-                              Node is a leaf : 1
-                    Identical Implementation : 0
-[0B8h 0184 004h]                      Parent : 0000009C
-[0BCh 0188 004h]           ACPI Processor ID : 00000002
+                     ACPI Processor ID valid : 0
+                       Processor is a thread : 0
+                              Node is a leaf : 0
+                    Identical Implementation : 1
+[0B8h 0184 004h]                      Parent : 00000094
+[0BCh 0188 004h]           ACPI Processor ID : 00000000
 [0C0h 0192 004h]     Private Resource Number : 00000000

 [0C4h 0196 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [0C5h 0197 001h]                      Length : 14
 [0C6h 0198 002h]                    Reserved : 0000
 [0C8h 0200 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
                      ACPI Processor ID valid : 1
                        Processor is a thread : 1
                               Node is a leaf : 1
                     Identical Implementation : 0
-[0CCh 0204 004h]                      Parent : 0000009C
-[0D0h 0208 004h]           ACPI Processor ID : 00000003
+[0CCh 0204 004h]                      Parent : 000000B0
+[0D0h 0208 004h]           ACPI Processor ID : 00000000
 [0D4h 0212 004h]     Private Resource Number : 00000000

 [0D8h 0216 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [0D9h 0217 001h]                      Length : 14
 [0DAh 0218 002h]                    Reserved : 0000
-[0DCh 0220 004h]       Flags (decoded below) : 00000010
+[0DCh 0220 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
-                     ACPI Processor ID valid : 0
-                       Processor is a thread : 0
-                              Node is a leaf : 0
-                    Identical Implementation : 1
-[0E0h 0224 004h]                      Parent : 00000038
+                     ACPI Processor ID valid : 1
+                       Processor is a thread : 1
+                              Node is a leaf : 1
+                    Identical Implementation : 0
+[0E0h 0224 004h]                      Parent : 000000B0
 [0E4h 0228 004h]           ACPI Processor ID : 00000001
 [0E8h 0232 004h]     Private Resource Number : 00000000

 [0ECh 0236 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [0EDh 0237 001h]                      Length : 14
 [0EEh 0238 002h]                    Reserved : 0000
 [0F0h 0240 004h]       Flags (decoded below) : 00000010
                             Physical package : 0
                      ACPI Processor ID valid : 0
                        Processor is a thread : 0
                               Node is a leaf : 0
                     Identical Implementation : 1
-[0F4h 0244 004h]                      Parent : 000000D8
-[0F8h 0248 004h]           ACPI Processor ID : 00000000
+[0F4h 0244 004h]                      Parent : 00000094
+[0F8h 0248 004h]           ACPI Processor ID : 00000001
 [0FCh 0252 004h]     Private Resource Number : 00000000

 [100h 0256 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [101h 0257 001h]                      Length : 14
 [102h 0258 002h]                    Reserved : 0000
 [104h 0260 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
                      ACPI Processor ID valid : 1
                        Processor is a thread : 1
                               Node is a leaf : 1
                     Identical Implementation : 0
 [108h 0264 004h]                      Parent : 000000EC
-[10Ch 0268 004h]           ACPI Processor ID : 00000004
+[10Ch 0268 004h]           ACPI Processor ID : 00000002
 [110h 0272 004h]     Private Resource Number : 00000000

 [114h 0276 001h]               Subtable Type : 00 [Processor Hierarchy Node]
 [115h 0277 001h]                      Length : 14
 [116h 0278 002h]                    Reserved : 0000
 [118h 0280 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
                      ACPI Processor ID valid : 1
                        Processor is a thread : 1
                               Node is a leaf : 1
                     Identical Implementation : 0
 [11Ch 0284 004h]                      Parent : 000000EC
-[120h 0288 004h]           ACPI Processor ID : 00000005
+[120h 0288 004h]           ACPI Processor ID : 00000003
 [124h 0292 004h]     Private Resource Number : 00000000

-[128h 0296 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[129h 0297 001h]                      Length : 14
+[128h 0296 001h]               Subtable Type : 01 [Cache Type]
+[129h 0297 001h]                      Length : 18
 [12Ah 0298 002h]                    Reserved : 0000
-[12Ch 0300 004h]       Flags (decoded below) : 00000010
+[12Ch 0300 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[130h 0304 004h]         Next Level of Cache : 00000000
+[134h 0308 004h]                        Size : 00200000
+[138h 0312 004h]              Number of Sets : 00000800
+[13Ch 0316 001h]               Associativity : 10
+[13Dh 0317 001h]                  Attributes : 0F
+                             Allocation Type : 3
+                                  Cache Type : 3
+                                Write Policy : 0
+[13Eh 0318 002h]                   Line Size : 0040
+
+[140h 0320 001h]               Subtable Type : 01 [Cache Type]
+[141h 0321 001h]                      Length : 18
+[142h 0322 002h]                    Reserved : 0000
+[144h 0324 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[148h 0328 004h]         Next Level of Cache : 00000128
+[14Ch 0332 004h]                        Size : 00008000
+[150h 0336 004h]              Number of Sets : 00000080
+[154h 0340 001h]               Associativity : 04
+[155h 0341 001h]                  Attributes : 03
+                             Allocation Type : 3
+                                  Cache Type : 0
+                                Write Policy : 0
+[156h 0342 002h]                   Line Size : 0040
+
+[158h 0344 001h]               Subtable Type : 01 [Cache Type]
+[159h 0345 001h]                      Length : 18
+[15Ah 0346 002h]                    Reserved : 0000
+[15Ch 0348 004h]       Flags (decoded below) : 0000007F
+                                  Size valid : 1
+                        Number of Sets valid : 1
+                         Associativity valid : 1
+                       Allocation Type valid : 1
+                            Cache Type valid : 1
+                          Write Policy valid : 1
+                             Line Size valid : 1
+                              Cache ID valid : 0
+[160h 0352 004h]         Next Level of Cache : 00000128
+[164h 0356 004h]                        Size : 0000C000
+[168h 0360 004h]              Number of Sets : 00000100
+[16Ch 0364 001h]               Associativity : 03
+[16Dh 0365 001h]                  Attributes : 07
+                             Allocation Type : 3
+                                  Cache Type : 1
+                                Write Policy : 0
+[16Eh 0366 002h]                   Line Size : 0040
+
+[170h 0368 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[171h 0369 001h]                      Length : 1C
+[172h 0370 002h]                    Reserved : 0000
+[174h 0372 004h]       Flags (decoded below) : 00000010
+                            Physical package : 0
+                     ACPI Processor ID valid : 0
+                       Processor is a thread : 0
+                              Node is a leaf : 0
+                    Identical Implementation : 1
+[178h 0376 004h]                      Parent : 00000038
+[17Ch 0380 004h]           ACPI Processor ID : 00000001
+[180h 0384 004h]     Private Resource Number : 00000002
+[184h 0388 004h]            Private Resource : 00000158
+[188h 0392 004h]            Private Resource : 00000140
+
+[18Ch 0396 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[18Dh 0397 001h]                      Length : 14
+[18Eh 0398 002h]                    Reserved : 0000
+[190h 0400 004h]       Flags (decoded below) : 00000010
+                            Physical package : 0
+                     ACPI Processor ID valid : 0
+                       Processor is a thread : 0
+                              Node is a leaf : 0
+                    Identical Implementation : 1
+[194h 0404 004h]                      Parent : 00000170
+[198h 0408 004h]           ACPI Processor ID : 00000000
+[19Ch 0412 004h]     Private Resource Number : 00000000
+
+[1A0h 0416 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[1A1h 0417 001h]                      Length : 14
+[1A2h 0418 002h]                    Reserved : 0000
+[1A4h 0420 004h]       Flags (decoded below) : 0000000E
+                            Physical package : 0
+                     ACPI Processor ID valid : 1
+                       Processor is a thread : 1
+                              Node is a leaf : 1
+                    Identical Implementation : 0
+[1A8h 0424 004h]                      Parent : 0000018C
+[1ACh 0428 004h]           ACPI Processor ID : 00000004
+[1B0h 0432 004h]     Private Resource Number : 00000000
+
+[1B4h 0436 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[1B5h 0437 001h]                      Length : 14
+[1B6h 0438 002h]                    Reserved : 0000
+[1B8h 0440 004h]       Flags (decoded below) : 0000000E
+                            Physical package : 0
+                     ACPI Processor ID valid : 1
+                       Processor is a thread : 1
+                              Node is a leaf : 1
+                    Identical Implementation : 0
+[1BCh 0444 004h]                      Parent : 0000018C
+[1C0h 0448 004h]           ACPI Processor ID : 00000005
+[1C4h 0452 004h]     Private Resource Number : 00000000
+
+[1C8h 0456 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[1C9h 0457 001h]                      Length : 14
+[1CAh 0458 002h]                    Reserved : 0000
+[1CCh 0460 004h]       Flags (decoded below) : 00000010
                             Physical package : 0
                      ACPI Processor ID valid : 0
                        Processor is a thread : 0
                               Node is a leaf : 0
                     Identical Implementation : 1
-[130h 0304 004h]                      Parent : 000000D8
-[134h 0308 004h]           ACPI Processor ID : 00000001
-[138h 0312 004h]     Private Resource Number : 00000000
-
-[13Ch 0316 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[13Dh 0317 001h]                      Length : 14
-[13Eh 0318 002h]                    Reserved : 0000
-[140h 0320 004h]       Flags (decoded below) : 0000000E
+[1D0h 0464 004h]                      Parent : 00000170
+[1D4h 0468 004h]           ACPI Processor ID : 00000001
+[1D8h 0472 004h]     Private Resource Number : 00000000
+
+[1DCh 0476 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[1DDh 0477 001h]                      Length : 14
+[1DEh 0478 002h]                    Reserved : 0000
+[1E0h 0480 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
                      ACPI Processor ID valid : 1
                        Processor is a thread : 1
                               Node is a leaf : 1
                     Identical Implementation : 0
-[144h 0324 004h]                      Parent : 00000128
-[148h 0328 004h]           ACPI Processor ID : 00000006
-[14Ch 0332 004h]     Private Resource Number : 00000000
-
-[150h 0336 001h]               Subtable Type : 00 [Processor Hierarchy Node]
-[151h 0337 001h]                      Length : 14
-[152h 0338 002h]                    Reserved : 0000
-[154h 0340 004h]       Flags (decoded below) : 0000000E
+[1E4h 0484 004h]                      Parent : 000001C8
+[1E8h 0488 004h]           ACPI Processor ID : 00000006
+[1ECh 0492 004h]     Private Resource Number : 00000000
+
+[1F0h 0496 001h]               Subtable Type : 00 [Processor Hierarchy Node]
+[1F1h 0497 001h]                      Length : 14
+[1F2h 0498 002h]                    Reserved : 0000
+[1F4h 0500 004h]       Flags (decoded below) : 0000000E
                             Physical package : 0
                      ACPI Processor ID valid : 1
                        Processor is a thread : 1
                               Node is a leaf : 1
                     Identical Implementation : 0
-[158h 0344 004h]                      Parent : 00000128
-[15Ch 0348 004h]           ACPI Processor ID : 00000007
-[160h 0352 004h]     Private Resource Number : 00000000
+[1F8h 0504 004h]                      Parent : 000001C8
+[1FCh 0508 004h]           ACPI Processor ID : 00000007
+[200h 0512 004h]     Private Resource Number : 00000000

-Raw Table Data: Length 356 (0x164)
+Raw Table Data: Length 516 (0x204)

-    0000: 50 50 54 54 64 01 00 00 02 97 42 4F 43 48 53 20  // PPTTd.....BOCHS
+    0000: 50 50 54 54 04 02 00 00 02 B8 42 4F 43 48 53 20  // PPTT......BOCHS
     0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43  // BXPC    ....BXPC
     0020: 01 00 00 00 00 14 00 00 11 00 00 00 00 00 00 00  // ................
     0030: 00 00 00 00 00 00 00 00 00 14 00 00 11 00 00 00  // ................
-    0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00  // $...............
-    0050: 10 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00  // ....8...........
-    0060: 00 14 00 00 10 00 00 00 4C 00 00 00 00 00 00 00  // ........L.......
-    0070: 00 00 00 00 00 14 00 00 0E 00 00 00 60 00 00 00  // ............`...
-    0080: 00 00 00 00 00 00 00 00 00 14 00 00 0E 00 00 00  // ................
-    0090: 60 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00  // `...............
-    00A0: 10 00 00 00 4C 00 00 00 01 00 00 00 00 00 00 00  // ....L...........
-    00B0: 00 14 00 00 0E 00 00 00 9C 00 00 00 02 00 00 00  // ................
-    00C0: 00 00 00 00 00 14 00 00 0E 00 00 00 9C 00 00 00  // ................
-    00D0: 03 00 00 00 00 00 00 00 00 14 00 00 10 00 00 00  // ................
-    00E0: 38 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00  // 8...............
-    00F0: 10 00 00 00 D8 00 00 00 00 00 00 00 00 00 00 00  // ................
-    0100: 00 14 00 00 0E 00 00 00 EC 00 00 00 04 00 00 00  // ................
+    0040: 24 00 00 00 00 00 00 00 00 00 00 00 01 18 00 00  // $...............
+    0050: 7F 00 00 00 00 00 00 00 00 00 20 00 00 08 00 00  // .......... .....
+    0060: 10 0F 40 00 01 18 00 00 7F 00 00 00 4C 00 00 00  // ..@.........L...
+    0070: 00 80 00 00 80 00 00 00 04 03 40 00 01 18 00 00  // ..........@.....
+    0080: 7F 00 00 00 4C 00 00 00 00 C0 00 00 00 01 00 00  // ....L...........
+    0090: 03 07 40 00 00 1C 00 00 10 00 00 00 38 00 00 00  // ..@.........8...
+    00A0: 00 00 00 00 02 00 00 00 7C 00 00 00 64 00 00 00  // ........|...d...
+    00B0: 00 14 00 00 10 00 00 00 94 00 00 00 00 00 00 00  // ................
+    00C0: 00 00 00 00 00 14 00 00 0E 00 00 00 B0 00 00 00  // ................
+    00D0: 00 00 00 00 00 00 00 00 00 14 00 00 0E 00 00 00  // ................
+    00E0: B0 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00  // ................
+    00F0: 10 00 00 00 94 00 00 00 01 00 00 00 00 00 00 00  // ................
+    0100: 00 14 00 00 0E 00 00 00 EC 00 00 00 02 00 00 00  // ................
     0110: 00 00 00 00 00 14 00 00 0E 00 00 00 EC 00 00 00  // ................
-    0120: 05 00 00 00 00 00 00 00 00 14 00 00 10 00 00 00  // ................
-    0130: D8 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00  // ................
-    0140: 0E 00 00 00 28 01 00 00 06 00 00 00 00 00 00 00  // ....(...........
-    0150: 00 14 00 00 0E 00 00 00 28 01 00 00 07 00 00 00  // ........(.......
-    0160: 00 00 00 00                                      // ....
+    0120: 03 00 00 00 00 00 00 00 01 18 00 00 7F 00 00 00  // ................
+    0130: 00 00 00 00 00 00 20 00 00 08 00 00 10 0F 40 00  // ...... .......@.
+    0140: 01 18 00 00 7F 00 00 00 28 01 00 00 00 80 00 00  // ........(.......
+    0150: 80 00 00 00 04 03 40 00 01 18 00 00 7F 00 00 00  // ......@.........
+    0160: 28 01 00 00 00 C0 00 00 00 01 00 00 03 07 40 00  // (.............@.
+    0170: 00 1C 00 00 10 00 00 00 38 00 00 00 01 00 00 00  // ........8.......
+    0180: 02 00 00 00 58 01 00 00 40 01 00 00 00 14 00 00  // ....X...@.......
+    0190: 10 00 00 00 70 01 00 00 00 00 00 00 00 00 00 00  // ....p...........
+    01A0: 00 14 00 00 0E 00 00 00 8C 01 00 00 04 00 00 00  // ................
+    01B0: 00 00 00 00 00 14 00 00 0E 00 00 00 8C 01 00 00  // ................
+    01C0: 05 00 00 00 00 00 00 00 00 14 00 00 10 00 00 00  // ................
+    01D0: 70 01 00 00 01 00 00 00 00 00 00 00 00 14 00 00  // p...............
+    01E0: 0E 00 00 00 C8 01 00 00 06 00 00 00 00 00 00 00  // ................
+    01F0: 00 14 00 00 0E 00 00 00 C8 01 00 00 07 00 00 00  // ................
+    0200: 00 00 00 00                                      // ....

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Message-id: 20260311160609.358-9-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotests/qtest/bios-table-test: testing new ARM ACPI PPTT topology
Alireza Sanaee [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
tests/qtest/bios-table-test: testing new ARM ACPI PPTT topology

Test new PPTT topolopy with cache representation.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Message-id: 20260311160609.358-8-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agohw/acpi: add cache hierarchy to pptt table
Alireza Sanaee [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
hw/acpi: add cache hierarchy to pptt table

Add cache topology to PPTT table.

Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20260311160609.358-7-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoacpi: Add parameters to pass cache descriptions to ACPI build_pptt()
Alireza Sanaee [Thu, 23 Apr 2026 09:24:10 +0000 (10:24 +0100)] 
acpi: Add parameters to pass cache descriptions to ACPI build_pptt()

Add optional parameters to pass cache descriptions to build_pptt().
Update ARM and Loongarch callers to pass none for now.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Message-id: 20260311160609.358-6-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agobios-tables-test: prepare to change ARM ACPI virt PPTT
Alireza Sanaee [Thu, 23 Apr 2026 09:24:09 +0000 (10:24 +0100)] 
bios-tables-test: prepare to change ARM ACPI virt PPTT

Prepare to update `build_pptt` function to add cache description
functionalities, thus add binaries in this patch.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Message-id: 20260311160609.358-5-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agohw/arm/virt: add cache hierarchy to device tree
Alireza Sanaee [Thu, 23 Apr 2026 09:24:09 +0000 (10:24 +0100)] 
hw/arm/virt: add cache hierarchy to device tree

Specify which level (core/cluster/socket) caches found at in the CPU
topology. Updating cache topology to device tree (spec v0.4).
Example:

For example, 2 sockets (packages), and 2 clusters, 4 cores and 2 threads
created, in aggregate 2*2*4*2 logical cores. In the smp-cache object,
cores will have L1d and L1i.  However, extending this is not difficult.
The clusters will share a unified L2 level cache, and finally sockets
will share L3. In this patch, threads will share L1 caches by default,
but this can be adjusted if case required.

Only three levels of caches are supported.  The patch does not
allow partial declaration of caches. In other words, the topology level
of every cache must be specified if that of any level is.

./qemu-system-aarch64 \
    -machine virt,\
         smp-cache.0.cache=l1i,smp-cache.0.topology=core,\
         smp-cache.1.cache=l1d,smp-cache.1.topology=core,\
         smp-cache.2.cache=l2,smp-cache.2.topology=cluster,\
         smp-cache.3.cache=l3,smp-cache.3.topology=socket\
    -cpu max \
    -m 2048 \
    -smp sockets=2,clusters=2,cores=4,threads=1 \
    -kernel ./Image.gz \
    -append "console=ttyAMA0 root=/dev/ram rdinit=/init acpi=force" \
    -initrd rootfs.cpio.gz \
    -bios ./edk2-aarch64-code.fd \
    -nographic

For instance, following device tree will be generated for a scenario
where we have 2 sockets, 2 clusters, 2 cores and 2 threads, in total 16
PEs. L1i and L1d are private to each thread, and L2 and L3 are shared at
socket level as an example.

Limitation: SMT cores cannot share L1 cache for now. This
problem does not exist in PPTT tables.

Co-developed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20260311160609.358-4-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agohw/core/machine: topology functions capabilities added
Alireza Sanaee [Thu, 23 Apr 2026 09:24:09 +0000 (10:24 +0100)] 
hw/core/machine: topology functions capabilities added

Add two functions one of which finds the lowest cache level defined in
the cache description input, and the other checks if a given cache
topology is defined at a particular cache level

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20260311160609.358-3-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agotarget/arm/tcg: increase cache level for cpu=max
Alireza Sanaee [Thu, 23 Apr 2026 09:24:09 +0000 (10:24 +0100)] 
target/arm/tcg: increase cache level for cpu=max

This patch addresses cache description in the `aarch64_max_tcg_initfn`
function for cpu=max. It introduces three levels of caches and modifies
the cache description registers accordingly.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
Message-id: 20260311160609.358-2-alireza.sanaee@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 months agoMerge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging
Stefan Hajnoczi [Wed, 22 Apr 2026 18:30:03 +0000 (14:30 -0400)] 
Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging

UI-related fixes and cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmnoo+8ACgkQ2ujhCXWW
# nOXHBw//ZExbO7yBzNY8s+DReQdJ3tWjwRozT296Ep8DyCW7qloGDBdWpPJ+ENHy
# b+NNQp5BBzEbuiWenqbKZtCsWcB2ozKzKP3pdxKsYjJoV/33FQFFem9fXuRu721Q
# vDLiZz5hsvpheeJBtNrndEDXBzVVMtZ0rC6zo0TKTRKScsCoTWKacraDgjTiMGMT
# p0ASjJvu6EOClwm2hxuKjbu5J7bFUoFIoEE7r6HCIVJGxrIK1wf3es0/pGI1b6Id
# GKwqWDf1ny2QlVdrUkD0nkeLQz0ZhI1YHuOGAaJjUZ14SHqkvSDFClsYRmYL4AaM
# 5OwKjpKIBXDoXH8Jbuj/wScYMzZfbdaDM+84BYIiNDLnZzuPkQ9dZhsTaJLnjsTb
# cDbMcvZ/DI03/k2w/Vm82iZ0F7a3awrT5m+WymLCSitoxqtAT7+0zW/dQYkLsv87
# yAoFkTBie2NHOYEdqUK7hv8aozUA2NtIUzXhaGdMVB9r7KUzv9dZej+gknbyRqHM
# k6JrSgTjtLBz00yAk4dTT1jbtKrVL8octq3XhbYuHo8/3qNpYREFk6+qAwdj87gt
# Rpd9sVM+xe9xmw4l/6BGCwt4E7kEVVkBY78xZ8tQa0bRsRl7jZ1bCC+hqjAu7KsU
# bcHfN9h1udt2K7T2l3bNt/RyaehFGg8aPYSS1uuHPlSD6h2zqbk=
# =4Q/3
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 22 Apr 2026 06:33:19 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-pull-request' of https://gitlab.com/marcandre.lureau/qemu: (40 commits)
  tests: rename the dbus-daemon helper script
  ui/vnc: explicitly link with png
  ui/vnc: remove left-over dead code
  ui/vnc: make vnc_disconnect_finish() private
  ui/vnc: fix vnc_display_init() leak on failure
  ui/keymaps: introduce kbd_layout_free()
  ui/vnc: VncDisplay.id is not const
  ui/vnc: simplify vnc_init_func error handling
  ui/vnc: assert preconditions instead of silently returning
  system: make qemu_del_vm_change_state_handler accept NULL
  util: move datadir.c from system/
  ui/vgafont: add SPDX license header
  ui: avoid duplicating vgafont16 in each translation unit
  ui/console-vc: unify the write path
  ui/console-vc: move vc_put_lf() to VT100 layer as vt100_put_lf()
  ui/console-vc: refactor text_console_resize() into vt100_set_image()
  ui/console-vc: console_scroll() -> vt100_scroll()
  ui/console-vc: move cursor blinking logic into VT100 layer
  ui/console-vc: console_refresh() -> vt100_refresh()
  ui/console-vc: decouple VT100 display updates via function pointer
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'pull-vfio-20260421' of https://github.com/legoater/qemu into staging
Stefan Hajnoczi [Wed, 22 Apr 2026 18:28:47 +0000 (14:28 -0400)] 
Merge tag 'pull-vfio-20260421' of https://github.com/legoater/qemu into staging

vfio queue:

* Refactors vfio code to remove CONFIG_KVM, CONFIG_IOMMU and
  CONFIG_VFIO_IGD, enabling vfio files to be common files
* Extracts KVM-specific helpers and SPAPR KVM code into separate files
* Improves iommufd with dirty tracking support for nesting parent
  HWPT and variable naming cleanup
* Adds VFIO I/O backend capability flags for feature support
* Enhances vfio-user with DEVICE_FEATURE support and DMA protocol fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmnnpu0ACgkQUaNDx8/7
# 7KFoPRAAtI+Y3c5nGWKNbTSuuc8nX/CZs6tq3Lq0VPM+ogKRsNlMgQlgthRa/tbk
# GYYK9o7cegx8DipR0hMx78DSHe8Q0P41C2DeqXMVjspR+BS2cBZ09yVid+ftKV5E
# gMkwwUDUdSWNf5Q9R6ing0Qyxew5tbLIhe7xmGorT8itrIpbeMpcIdiODin/iXaL
# lP4oBTU8WiqlmBPaa//HNNhmFWUsx1Y7hgwyMllTmQJVgOz08sPXfR3pPcVgyexD
# kSm3X5dR//VTUr9SEv+rfeRXXDNEhRU2Vuy1b6pDkQ07A8hFYPDmhoUHsmE8m0WD
# kxRC4BNrXG1qI7/4ZeZr7rkChEvbL6Lo4iIelrMPEXqRX1SfsuGYpBZx7MxpTg2q
# dVBn696rsViyiGdKDSnPiNJ8z1PNor8o56aw9+DEyHHmDpeS7Cvl2mYa354NEQli
# FwTP8iiUbLzmMQ9qdpKya5D2JopefpFjbosdHIty/L4bYVWl2HR3nvjVTe5bYSwM
# oupMTelU1e9AC/+3ynnRl0NN1xlf/cIQKr2ox2kxQpo0DvbS5nytKsfRXw+c2bf7
# dj4IL36b6X+IfHPrMpZYKwGFh+IKuCt/SJ/hl9H/A2zXxJTGr1rp4NJesmlV22wf
# XuNsvf10QxywufuFgTAqMPfy7UtyFzvFgcWyRvtJABnnpoCknOM=
# =LirL
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 21 Apr 2026 12:33:49 EDT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-vfio-20260421' of https://github.com/legoater/qemu:
  vfio-user: fix DMA write reply
  vfio-user: correct protocol for DMA reads/writes
  vfio-user: support VFIO_USER_DEVICE_FEATURE
  vfio: Add VFIO I/O backend capability flags for feature support
  hw/vfio/iommufd: Control dirty tracking for nesting parent HWPT
  iommufd: Rename all the idev and idevc variables to hiod and hiodc
  hw/vfio: all vfio files can now be common files
  hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to hw/vfio/kvm-spapr.c
  hw/vfio/ap.c: use full path for target specific header
  hw/vfio/pci.c: eradicate CONFIG_KVM
  hw/vfio: eradicate CONFIG_IOMMU from sources
  hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
  hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
  hw/vfio/listener.c: remove CONFIG_KVM

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoMerge tag 'pr-email_update-20260416' of https://gitlab.com/p-b-o/qemu into staging
Stefan Hajnoczi [Wed, 22 Apr 2026 18:26:59 +0000 (14:26 -0400)] 
Merge tag 'pr-email_update-20260416' of https://gitlab.com/p-b-o/qemu into staging

Changes:
- [PATCH v2 0/2] MAINTAINERS: update address and add Hexagon reviewer (Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>)
Link: https://lore.kernel.org/qemu-devel/20260416231455.346504-1-pierrick.bouvier@oss.qualcomm.com
# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEN8FWlNi6l2Sxlz/btEQ30ZwoYt8FAmnhbjgACgkQtEQ30Zwo
# Yt+mbAv/bvzIE5MFtAR3wvWD7CdX75eGx+UNERchc9sx5CN8AMQBTF5zBq7QNurk
# vdhPPwn+I56KRlBjcbL8CXs6xIhFtlxtirGB+BePlt597IHMEEspqxc98vKnyzIl
# g5D485Ue3nN+A0z/HgDrn6Z51H2xQs6kptM4uQi1jWhxWGs//nES1Ux1e2B9mRkP
# T+s7dciiigrzzBb+zDJQfum+ZBE5+KdVR3NQ9nt2rDMNXXM0F3cyWpxzSAZtjEpy
# egQyrsMSiTpV1r6IfeNgc27cljJ6cK9G66nschJKqqh8GZap9aRKJ2uoulT0PFnH
# 5PpXcfT0Z6dw8pMIo50eoXHp7QyvMTQzFtPtHAIhdrOuF1tDVs5tGf7AFxj8RcFb
# uB9gUyeVTtbtFvqMTTvoC/JXVFjJol9UJqT20xneZf8cfuS6lKK4eSd2qKJ2XwSV
# S9QTdIODWNmgZv8lBagnCkDId1UVGERKvuyZnXf2HJdV+e9PTJD9mLAC7a3QSZm4
# +OtAhh3s
# =ZS4Y
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 16 Apr 2026 19:18:16 EDT
# gpg:                using RSA key 37C15694D8BA9764B1973FDBB44437D19C2862DF
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 37C1 5694 D8BA 9764 B197  3FDB B444 37D1 9C28 62DF

* tag 'pr-email_update-20260416' of https://gitlab.com/p-b-o/qemu:
  MAINTAINERS: add new reviewer for Hexagon target
  MAINTAINERS: update address

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agoOpen 11.1 development tree
Stefan Hajnoczi [Wed, 22 Apr 2026 18:19:37 +0000 (14:19 -0400)] 
Open 11.1 development tree

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 months agotests: rename the dbus-daemon helper script
Marc-André Lureau [Mon, 16 Mar 2026 19:28:28 +0000 (23:28 +0400)] 
tests: rename the dbus-daemon helper script

The following patches are going to use it for qemu-vnc.

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: explicitly link with png
Marc-André Lureau [Mon, 23 Feb 2026 15:25:54 +0000 (16:25 +0100)] 
ui/vnc: explicitly link with png

The VNC code uses PNG directly.

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: remove left-over dead code
Marc-André Lureau [Tue, 7 Apr 2026 12:57:15 +0000 (16:57 +0400)] 
ui/vnc: remove left-over dead code

Since commit 5994dcb8d85 ("ui, monitor: remove deprecated VNC ACL option
and HMP commands"), this field is no longer used.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 months agoui/vnc: make vnc_disconnect_finish() private
Marc-André Lureau [Tue, 7 Apr 2026 11:23:17 +0000 (15:23 +0400)] 
ui/vnc: make vnc_disconnect_finish() private

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>