]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
4 weeks agohw/riscv/riscv-iommu: Add IPSR.PMIP RW1C support
Jay Chang [Wed, 25 Mar 2026 05:00:11 +0000 (13:00 +0800)] 
hw/riscv/riscv-iommu: Add IPSR.PMIP RW1C support

Add proper RW1C (Read/Write 1 to Clear) support for the IPSR.PMIP
(Performance Monitor Interrupt Pending) bit, which was missing from
the IPSR register implementation.

Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Message-ID: <20260325050011.66722-3-jay.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agohw/riscv/riscv-iommu-hpm: Fix irq_overflow_left residual value bug
Jay Chang [Wed, 25 Mar 2026 05:00:10 +0000 (13:00 +0800)] 
hw/riscv/riscv-iommu-hpm: Fix irq_overflow_left residual value bug

Reset irq_overflow_left to 0 before setting up a new timer. Without
this fix, a stale irq_overflow_left value from a previous timer setup
could cause incorrect timer behavior.

Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Message-ID: <20260325050011.66722-2-jay.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agoconfigs/targets: Forbid RISC-V to use legacy native endianness APIs
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:21 +0000 (11:31 +0100)] 
configs/targets: Forbid RISC-V to use legacy native endianness APIs

All RISC-V related binaries are buildable without a single
use of the legacy "native endian" API. Set the transitional
TARGET_USE_LEGACY_NATIVE_ENDIAN_API definition to forbid
further uses of the legacy API.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-17-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Use MO_LE for instruction fetch
Djordje Todorovic [Wed, 18 Mar 2026 10:31:20 +0000 (11:31 +0100)] 
target/riscv: Use MO_LE for instruction fetch

RISC-V instructions are always little-endian regardless of the data
endianness mode configured via mstatus SBE/MBE/UBE bits.

Currently, instruction fetches in decode_opc() and the page boundary
check use mo_endian(ctx), which returns MO_TE. This happens to work
today because RISC-V targets are little-endian only, but is
semantically incorrect and will break once mo_endian() is updated to
respect runtime data endianness for big-endian support.

Use MO_LE explicitly for all instruction fetch paths. Data memory
operations (AMOs, loads/stores via mxl_memop) continue to use
mo_endian(ctx) as they should respect the configured data endianness.

Not-Signed-off-by: Djordje Todorovic <Djordje.Todorovic@htecgroup.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260311115910.564481-3-djordje.todorovic@htecgroup.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260318103122.97244-16-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Replace MO_TE -> MO_LE
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:19 +0000 (11:31 +0100)] 
target/riscv: Replace MO_TE -> MO_LE

We only build the RISC-V target using little endianness order,
therefore the MO_TE definitions expand to the little endian
one. Use the latter which is more explicit.

Mechanical change running:

  $ sed -i -e s/MO_TE/MO_LE/ \
        $(git grep -wl MO_TE target/riscv/)

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-15-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Replace MO_TE by mo_endian (Zalasr extension)
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:18 +0000 (11:31 +0100)] 
target/riscv: Replace MO_TE by mo_endian (Zalasr extension)

Replace compile-time MO_TE evaluation by runtime mo_endian()
one, which expand target endianness from DisasContext.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-14-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Replace MO_TE by mo_endian (Zilsd extension)
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:17 +0000 (11:31 +0100)] 
target/riscv: Replace MO_TE by mo_endian (Zilsd extension)

Replace compile-time MO_TE evaluation by runtime mo_endian()
one, which expand target endianness from DisasContext.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-13-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Replace MO_TE by mo_endian (MIPS extension)
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:16 +0000 (11:31 +0100)] 
target/riscv: Replace MO_TE by mo_endian (MIPS extension)

Replace compile-time MO_TE evaluation by runtime mo_endian()
one, which expand target endianness from DisasContext.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-12-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Have gdbstub consider CPU endianness
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:15 +0000 (11:31 +0100)] 
target/riscv: Have gdbstub consider CPU endianness

Consider CPU endianness when accessing registers.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-11-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Expose mo_endian_env()
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:14 +0000 (11:31 +0100)] 
target/riscv: Expose mo_endian_env()

Move mo_endian_env() definition to "internals.h" for re-use.
Do not restrict to system emulation only because this will
also be used by user emulation code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-10-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Simplify riscv_cpu_gdb_write_register()
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:13 +0000 (11:31 +0100)] 
target/riscv: Simplify riscv_cpu_gdb_write_register()

Use a single ldn() call, sign-extend once.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-9-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Factor tiny ldn() helper in gdbstub
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:12 +0000 (11:31 +0100)] 
target/riscv: Factor tiny ldn() helper in gdbstub

In preparation of having this helper handle CPU runtime
endianness changes, factor the ldn() helper out.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-8-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Conceal MO_ALIGN|MO_TE within load_acquire / store_release
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:11 +0000 (11:31 +0100)] 
target/riscv: Conceal MO_ALIGN|MO_TE within load_acquire / store_release

All callers of gen_load_acquire() and gen_store_release() set both
the MO_ALIGN|MO_TE flags. Set them once in each callee.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-7-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Explode MO_TExx -> MO_TE | MO_xx (again)
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:10 +0000 (11:31 +0100)] 
target/riscv: Explode MO_TExx -> MO_TE | MO_xx (again)

Following commit 73ae67fd4e6, extract the implicit MO_TE
definition in order to replace it.

Mechanical change using:

  $ for n in UW UL UQ UO SW SL SQ; do \
      sed -i -e "s/MO_TE$n/MO_TE | MO_$n/" \
           $(git grep -l MO_TE$n target/riscv); \
    done

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-6-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Remove MTTCG check for x-rv128 CPU model
Frédéric Pétrot [Wed, 18 Mar 2026 10:31:09 +0000 (11:31 +0100)] 
target/riscv: Remove MTTCG check for x-rv128 CPU model

We had to check that mttcg was not used when executing QEMU with
-cpu x-rv128 as a single 128-bit access was done as two distinct
64-bit accesses.
Now that we use the 128-bit ld/st that access the data atomically,
this check is no longer necessary.

Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Message-ID: <20260101181442.2489496-3-frederic.petrot@univ-grenoble-alpes.fr>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-5-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Make LQ and SQ use 128-bit ld/st
Frédéric Pétrot [Wed, 18 Mar 2026 10:31:08 +0000 (11:31 +0100)] 
target/riscv: Make LQ and SQ use 128-bit ld/st

The lq and sq helpers for the experimental rv128 architecture
currently use direct memory accesses.
Replace these direct accesses with the standard
tcg_gen_qemu_{ld,st}_i128 TCG helpers that handle endianness
issues.

Reported-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Message-ID: <20260101181442.2489496-2-frederic.petrot@univ-grenoble-alpes.fr>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-4-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: Use explicit little-endian LD/ST API
Philippe Mathieu-Daudé [Wed, 18 Mar 2026 10:31:07 +0000 (11:31 +0100)] 
target/riscv: Use explicit little-endian LD/ST API

We only build our RISC-V targets as little-endian, therefore
the LD/ST API expands to its little-endian variant. Directly
use the latter.

Mechanical change running:

  $ for a in uw w l q; do \
      sed -i -e "s/ld${a}_p(/ld${a}_le_p(/" \
        $(git grep -wlE '(ld|st)u?[wlq]_p' target/riscv);
    done

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260318103122.97244-3-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agodisas: diassemble RISC-V xlrbr (crc32) instructions
Emmanuel Blot [Fri, 20 Mar 2026 13:42:54 +0000 (13:42 +0000)] 
disas: diassemble RISC-V xlrbr (crc32) instructions

Placed in a separate file as a vendor extension.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260320134254.217123-4-james.wainwright@lowrisc.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agotarget/riscv: add draft RISC-V Zbr ext as xbr0p93
Emmanuel Blot [Fri, 20 Mar 2026 13:42:53 +0000 (13:42 +0000)] 
target/riscv: add draft RISC-V Zbr ext as xbr0p93

This extension was not ratified with the Zb[abcs] bitmanip extensions.
This is the latest draft version (0.93) as implemented by the Ibex core.

These instructions are in the reserved encoding space but have not been
ratified and could conflict with future ratified instructions. For this
reason they are added as a vendor extension to support Ibex's impl.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260320134254.217123-3-james.wainwright@lowrisc.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agoutil: export CRC32[C] lookup tables
Emmanuel Blot [Fri, 20 Mar 2026 13:42:52 +0000 (13:42 +0000)] 
util: export CRC32[C] lookup tables

These are needed for the xlrbr CRC32 instructions which pre-XOR the data
into the CRC state before the instruction is executed, making the zlib
crc32 and QEMU crc32c implementations inappropriate.

https://github.com/riscv/riscv-bitmanip/releases/download/v0.93/bitmanip-0.93.pdf

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260320134254.217123-2-james.wainwright@lowrisc.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agohw/riscv/riscv-iommu: Use standard EN_PRI bit for PRI
Jay Chang [Wed, 25 Mar 2026 01:48:56 +0000 (09:48 +0800)] 
hw/riscv/riscv-iommu: Use standard EN_PRI bit for PRI

Replace the temporary custom extension bit (TC[32]) with the
standard EN_PRI bit defined in RISC-V IOMMU specification.

Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260325014856.58948-1-jay.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
4 weeks agolinux-user: Flush errors by using exit() instead of _exit() in error path
Helge Deller [Sun, 26 Apr 2026 14:38:40 +0000 (16:38 +0200)] 
linux-user: Flush errors by using exit() instead of _exit() in error path

Similiar to previous patch - ensure that we always flush I/O by using
exit() instead of _exit().

Reported by: Tobias Bergkvist <tobias@bergkv.ist>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2544
Signed-off-by: Helge Deller <deller@gmx.de>
4 weeks agolinux-user: Add missing CDROM ioctls
Helge Deller [Sat, 25 Apr 2026 20:58:12 +0000 (22:58 +0200)] 
linux-user: Add missing CDROM ioctls

Add the missing CDROM ioctls and bring them in same order as
documentation.

Signed-off-by: Helge Deller <deller@gmx.de>
4 weeks agoui/gtk: Turn clipboard flag into runtime option
Jindřich Makovička [Mon, 27 Apr 2026 20:06:44 +0000 (22:06 +0200)] 
ui/gtk: Turn clipboard flag into runtime option

- Compile the GTK clipboard support unconditionally

- Introduce GTK clipboard option, defaulting to off

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260427-gtk-clipboard-v5-2-6968feb31a5d@gmail.com>

4 weeks agoui/gtk: Use non-blocking clipboard retrieval
Jindřich Makovička [Mon, 27 Apr 2026 20:06:43 +0000 (22:06 +0200)] 
ui/gtk: Use non-blocking clipboard retrieval

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260427-gtk-clipboard-v5-1-6968feb31a5d@gmail.com>

4 weeks agoaudio: Use unsigned PCM bias
Akihiko Odaki [Thu, 23 Apr 2026 13:55:23 +0000 (22:55 +0900)] 
audio: Use unsigned PCM bias

Clang warns for the uint32_t clip_ instantiations because HALF cannot be
represented with mixeng_real:

[1115/2559] Compiling C object libqemuaudio.a.p/audio_mixeng.c.o
In file included from ../../qemu/audio/mixeng.c:147:
../../qemu/audio/mixeng_template.h:68:70: warning: implicit conversion from 'unsigned int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
   68 |     return ENDIAN_CONVERT((IN_T)((v * ((mixeng_real)IN_MAX / 2.f)) + HALF));
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../qemu/audio/mixeng_template.h:31:22: note: expanded from macro 'HALF'
   31 | #define HALF (IN_MAX >> 1)
      |                      ^
../../qemu/audio/mixeng.c:146:28: note: expanded from macro 'ENDIAN_CONVERT'
  146 | #define ENDIAN_CONVERT(v) (v)
      |                            ^
In file included from ../../qemu/audio/mixeng.c:152:
../../qemu/audio/mixeng_template.h:68:70: warning: implicit conversion from 'unsigned int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
   68 |     return ENDIAN_CONVERT((IN_T)((v * ((mixeng_real)IN_MAX / 2.f)) + HALF));
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../qemu/audio/mixeng_template.h:31:22: note: expanded from macro 'HALF'
   31 | #define HALF (IN_MAX >> 1)
      |                      ^
../../qemu/audio/mixeng.c:151:36: note: expanded from macro 'ENDIAN_CONVERT'
  151 | #define ENDIAN_CONVERT(v) bswap32 (v)
      |                           ~~~~~~~~~^~
/Users/person/v/qemu/include/qemu/bswap.h:10:39: note: expanded from macro 'bswap32'
   10 | #define bswap32(_x) __builtin_bswap32(_x)
      |                                       ^~
2 warnings generated.

HALF is not the right value here anyway. IN_MAX is odd, so the integer
sample range has two middle codes. Unsigned PCM normally uses the upper
middle code as the "bias": 0x80, 0x8000, or 0x80000000. HALF is instead
defined as the lower middle code: 0x7f, 0x7fff, or 0x7fffffff.

Replace HALF with BIAS, defined as the upper middle code. This fixes the
warnings, since the value can be exactly represented with mixeng_real.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260423-audio-v1-3-e1d6b65c76f9@rsg.ci.i.u-tokyo.ac.jp>

4 weeks agoaudio: Clamp unsigned sample conversion
Akihiko Odaki [Thu, 23 Apr 2026 13:55:22 +0000 (22:55 +0900)] 
audio: Clamp unsigned sample conversion

clip_*_uint32_t() returns 0 when v == 1.f because it computes the result
as (IN_T)((v * ((mixeng_real)IN_MAX / 2.f)) + HALF):

- (v * ((mixeng_real)IN_MAX / 2.f)) + HALF == 0x100000000.f, which does
  not fit in uint32_t.
- (v * ((mixeng_real)IN_MAX / 2.f)) == 0x80000000.f
- ((mixeng_real)IN_MAX / 2.f) == 0x80000000.f
- (mixeng_real)IN_MAX == 0x100000000.f because 0xffffffff cannot be
  represented exactly in float.
- HALF == 0x7fffffff, which is implicitly converted to 0x80000000.f.

Clamp the result to avoid the overflow.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260423-audio-v1-2-e1d6b65c76f9@rsg.ci.i.u-tokyo.ac.jp>

4 weeks agoaudio: Avoid unsigned sample wraparound
Akihiko Odaki [Thu, 23 Apr 2026 13:55:21 +0000 (22:55 +0900)] 
audio: Avoid unsigned sample wraparound

When !defined(SIGNED), nv - HALF will wrap around if nv < HALF because
nv and HALF are unsigned. Fix it by casting nv to mixeng_real, which is
signed.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260423-audio-v1-1-e1d6b65c76f9@rsg.ci.i.u-tokyo.ac.jp>

4 weeks agoui/dbus: fix warning for clients without "Interfaces" property
Marc-André Lureau [Wed, 22 Apr 2026 13:19:46 +0000 (17:19 +0400)] 
ui/dbus: fix warning for clients without "Interfaces" property

The "Interfaces" property is not strictly required. We can just assume
the peer doesn't implement the given interface. Fix warning:
GLib: g_strv_contains: assertion 'strv != NULL' failed

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
4 weeks agoui/console: move console_handle_touch_event() to input
Marc-André Lureau [Wed, 11 Mar 2026 09:29:56 +0000 (13:29 +0400)] 
ui/console: move console_handle_touch_event() to input

The function uses input.c functions to provide a simpler abstraction for
touch events. Let's move it from the already overloaded console.c, and
to avoid some unnecessary dependency from console.c on input.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui/console: return completion status from gfx_update callback
Marc-André Lureau [Thu, 5 Mar 2026 12:58:24 +0000 (13:58 +0100)] 
ui/console: return completion status from gfx_update callback

Replace the two-field design (gfx_update void callback + gfx_update_async
flag) with a single bool return value from gfx_update. Returning true
means the update completed synchronously and graphic_hw_update_done()
should be called by the console layer. Returning false means the update
is deferred and the device will call graphic_hw_update_done() itself
later (as done by QXL/SPICE and Apple GFX).

This simplifies the interface and makes the async contract explicit at
each call site rather than relying on a separate struct field.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
4 weeks agoui/console: remove qemu_console_is_visible()
Marc-André Lureau [Fri, 27 Feb 2026 07:19:53 +0000 (08:19 +0100)] 
ui/console: remove qemu_console_is_visible()

Drop the bookkeeping, we can simply afford an empty "foreach".

Notice that dpy_gfx_update_texture() is now called even when there are
no listeners. This is more correct, as the texture is not fully
refreshed when a listener connects, so it may be outdated/garbaged.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui: rename init_keyboard_layout->kbd_layout_new()
Marc-André Lureau [Sun, 12 Apr 2026 14:09:09 +0000 (18:09 +0400)] 
ui: rename init_keyboard_layout->kbd_layout_new()

Use a more convential name.

Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui: minor code simplification
Marc-André Lureau [Tue, 3 Mar 2026 21:00:45 +0000 (22:00 +0100)] 
ui: minor code simplification

Drop memset() usage.

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>
4 weeks agoui: make unregister_displaychangelistener() skip unregistered
Marc-André Lureau [Wed, 25 Feb 2026 13:29:12 +0000 (14:29 +0100)] 
ui: make unregister_displaychangelistener() skip unregistered

If the listener doesn't have associate ds / display state, it is already
unregistered.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui: make qemu_default_pixelformat() static inline
Marc-André Lureau [Mon, 23 Feb 2026 11:29:22 +0000 (12:29 +0100)] 
ui: make qemu_default_pixelformat() static inline

The function is a trivial wrapper around qemu_default_pixman_format()
and qemu_pixelformat_from_pixman(), so make it static inline in
qemu-pixman.h instead of a standalone function in console.c, allowing to
be easily reused.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui: move DisplaySurface functions to display-surface.c
Marc-André Lureau [Mon, 16 Feb 2026 17:41:35 +0000 (18:41 +0100)] 
ui: move DisplaySurface functions to display-surface.c

Extract DisplaySurface creation and destruction functions from console.c
into their own file to reduce the size of console.c and improve code
organization.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 weeks agoui: move FONT_WIDTH/HEIGHT to vgafont.h
Marc-André Lureau [Mon, 23 Feb 2026 14:52:23 +0000 (15:52 +0100)] 
ui: move FONT_WIDTH/HEIGHT to vgafont.h

Since those values are related to the VGA font, it make sense to move
them here.

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>
4 weeks agoMerge tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa...
Stefan Hajnoczi [Mon, 27 Apr 2026 16:57:33 +0000 (12:57 -0400)] 
Merge tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa into staging

linux-user: Pull request

This patch series adds myself as linux-user maintainer, and includes some
patches which have piled up for linux-user during the last few weeks.

Please apply.
Thanks!
Helge

* tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa:
  linux-user: Flush errors by using exit() instead of _exit() in error path
  linux-user: Use abi_int for imr_ifindex in ip_mreqn struct
  linux-user: Fix CLONE_PARENT_SETTID when using fork-like clone
  linux-user: Add getsockopt() for SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
  linux-user: Add setsockopt() for SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
  linux-user: Define SO_TIMESTAMP*_NEW and SO_RCVTIMEIO_NEW
  linux-user/mips: sync k0 TLS for EF_MIPS_MACH_OCTEON userlands
  linux-user/strace: Use pointer type for read and write values
  linux-user/arm/nwfpe: Use thread-local storage for qemufpa
  linux-user/arm/nwfpe: Replace user_registers with current_cpu
  linux-user: Don't define target_stat64 struct for loongarch64
  linux-user: fix off-by-one in host_to_target_for_each_rtattr()
  linux-user/ppc: Fix ppc64 rt_sigframe stack offset
  MAINTAINERS: Add myself as maintainer for linux-user

[I have confirmed with Laurent, the current maintainer, that he would
like Helge to help.
-- Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Conflicts:
  MAINTAINERS
  Pierrick's email address changed.

4 weeks agoMerge tag 'pull-target-arm-20260427' of https://gitlab.com/pm215/qemu into staging
Stefan Hajnoczi [Mon, 27 Apr 2026 15:45:45 +0000 (11:45 -0400)] 
Merge tag 'pull-target-arm-20260427' of https://gitlab.com/pm215/qemu into staging

target-arm queue:
docs/system: add FEAT_AA32 and FEAT_AA64 to emulation list
hw/arm: Add the i.MX 8MM EVK(Evaluation Kit) board
target/arm: Build M-profile helper code once only
hw/arm: Remove hw_error() for the unimplemented CM_LMBUSCNT register
hw: Move ARM_SYSCTL_GPIO definitions to arm sysctl specific header
target/arm: Allow 'aarch64=off' to be set for TCG CPUs
target/arm: Allow some sysregs to not have to be an exact match for migration
hw/arm/raspi4b: NOP all DTB nodes when removing unimplemented devices
hw/arm/fsl-imx6ul: Implement LCDIF display device
target/arm: Refactor syndrome value code to use registerfields
target/arm: Report the register in WFxT syndromes

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmnvWqUZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3sXqD/0Rz/TCbnO82o1Pdgeq2ZJM
# n9JdErd55w0LVepMZT4Hmq/V3W1Om65MGluRjUEdKK1+uB9l7wgHWxnJRPp1+pe4
# EGg0rXxio1Z81CCMV6jQrlG+uKCn15gMpTXvGYGbd+8xXGMrCmsfVQxAU8BLyiRk
# CcpOOdWqVtdq6F+yjzYBnz0PtLnbWt/x7hlcBAxOZZKjdH2t/zyDKMMMxPt2V8TS
# XsJOgAk/ugmGZop2X4lwmtaJFelTb7g3XDkeh2fkdbkl0Jf8jFe4tVTirbc1RhSE
# WHoH/yP3rE0oA16b6uXtU5rSFrW3WlNglIasidnDIrjX9NdImD68FDEaDJ2MBuS0
# esy0+of/jqpy1rFBUP5KRtg4MJMstLRIlGxWQtQfoBK5uF5kT0SI2kAnipPIwN49
# IrRfEVM3V7m83+BksfP0+anM85W92kPtwZQfey7oXGJ9jOWbLYRShWphE6k2UI3y
# jU2bWiVdNF1qwUIEh5NHUJKw9rJI5Uz9msxT/U5VRnV78GC8sPf2+YXZmPOqbRFo
# j4QuSNuEnQ2OxBzzneZFYzllLZhVU0CQjD5ax5xJ4Cj4o99eOlyMS3aopWDuVHxJ
# TUJDXC349NeyzSwJgjdwH64lR+qfFeuU4jyI9yisNsYG1LbIEenXX8ww2LXI3eoh
# s/VEjZo5wZ1e5RSAoP41dw==
# =MSX5
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 27 Apr 2026 08:46:29 EDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20260427' of https://gitlab.com/pm215/qemu: (63 commits)
  target/arm: report register in WFIT syndromes
  target/arm: remove old syndrome defines
  target/arm: use syndrome helpers to query VNCR bit
  target/arm: use syndrome helpers in merge_syn_data_abort
  target/arm: make hvf use syndrome helpers for decode
  target/arm: make whpx use syndrome helpers for decode
  target/arm: use syndrome helpers to set SAME_EL EC bit
  target/arm: use syndrome helpers in arm_cpu_do_interrupt_aarch32_hyp
  target/arm: migrate check_hcr_el2_trap to use syndrome helper
  target/arm: migrate memory op syndromes to registerfields
  target/arm: migrate gcs syndromes to registerfields
  target/arm: migrate wfx syndromes to registerfields
  target/arm: migrate debug syndromes to registerfields
  target/arm: migrate fault syndromes to registerfields
  target/arm: migrate Granule Protection traps to registerfields
  target/arm: migrate BXJ trap syndromes to registerfields
  target/arm: migrate BTI trap syndromes to registerfields
  target/arm: migrate PAC trap syndromes to registerfields
  target/arm: migrate SME trap syndromes to registerfields
  target/arm: migrate eret trap syndromes to registerfields
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'pull-request-2026-04-27' of https://gitlab.com/thuth/qemu into staging
Stefan Hajnoczi [Mon, 27 Apr 2026 15:45:10 +0000 (11:45 -0400)] 
Merge tag 'pull-request-2026-04-27' of https://gitlab.com/thuth/qemu into staging

* Bump the minimum GCC version to v10.4
* Make SMM code ready for the QEMU universal binary
* Convert TABs to spaces according to QEMU's coding style
* Fix use of pthread_get_name_np on OpenBSD
* Silence some warnings from pylint in the functional tests
* Fix a regression in the "register-array" device
* malloc cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmnvMekACgkQLtnXdP5w
# LbWojQ//W/6wgTiE07I4LkG4CNhC8K9kYZHePmq933V4aAAp8lsrTqods+bfbxZd
# ByWoXsDfkgzeWgn3mqrAUWq6rLJfGJ8NGcTFmg++BX0Oi8Y+1aQEG59wc5V/Ak+c
# 7yjyhSHorvyuYP70rx5HaIT/VbGFMzZrIRRUS8tY31W24+Y+rvwz3t+dsJi0m9Jx
# Gl64ZTbrADf7qo7RNBNV/ucw5k+b/armXNKcjIhGKxgSrSkog5g+MkSzB9aizWRU
# 3rNssfG3XXb+Adq9CGQw0knPu/gD10TclMex/yfZ61OEZ7yMjYwYQVrmjLL8S+ZE
# wDeUn6KyY7cG2APPJN5XzS8V6KvQ1z6Zigd9010LDAVn2nIGdEobYrnv5Fj5DcOA
# 1oNlnS7PRXxRIBycMba589S/TrOBTk8B9zDH+VCMmmJR3EKFO8e9ZKtXwU2ywVk2
# j2ay8desNVj+Ntso5CRUDmTtWJXLsKMZLFhzK1I7p/Upjue5drWd7GiT7rsZItde
# bMS6oEZM+LOpT/7kK3cndt2+km/6yYho5oVmpeugVW0rgT96uOXOyQuBtoT5S/7S
# uigqrzPYnogf7OvyqOhUeLyGm3I2itr/jNxDOCgf/53Zi85jLsgAJBn+Cxt4Hrym
# iAUpxbw1yfqT1UW4CrLpNdStFY443mhu9otFhpTYxbQ3T30nZGM=
# =zqWg
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 27 Apr 2026 05:52:41 EDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2026-04-27' of https://gitlab.com/thuth/qemu:
  tests/functional/ppc/test_ppe42: Fix warning from the latest version of pylint
  target/xtensa: Replace malloc() with g_strdup_printf()
  hw/i386/fw_cfg: Use g_new() and g_new0() instead of g_malloc()
  hw/core/register: add register_array_get_owner
  tests/functional/qemu_test: Silence warnings from pylint in tesseract.py
  util: fix use of pthread_get_name_np on OpenBSD
  target: convert TABS indentation to spaces for consistency
  target/i386/tcg/sysemu: Allow 32-bit SMM code to be used in the 64-bit binary
  target/i386/tcg/sysemu: Move target specific SMM code to separate functions
  meson.build: Bump the minimum GCC version to v10.4

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agotarget/arm: report register in WFIT syndromes
Alex Bennée [Wed, 22 Apr 2026 12:52:40 +0000 (13:52 +0100)] 
target/arm: report register in WFIT syndromes

Pass the register number (rd) to the wfit helper and report it in the
syndrome ISS.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-24-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: remove old syndrome defines
Alex Bennée [Wed, 22 Apr 2026 12:52:39 +0000 (13:52 +0100)] 
target/arm: remove old syndrome defines

Now everything is defined with registerfields we can drop the old
defines.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-23-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: use syndrome helpers to query VNCR bit
Alex Bennée [Wed, 22 Apr 2026 12:52:38 +0000 (13:52 +0100)] 
target/arm: use syndrome helpers to query VNCR bit

These are only valid for data abort syndromes.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-22-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: use syndrome helpers in merge_syn_data_abort
Alex Bennée [Wed, 22 Apr 2026 12:52:37 +0000 (13:52 +0100)] 
target/arm: use syndrome helpers in merge_syn_data_abort

One more step to removing the old defines.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-21-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: make hvf use syndrome helpers for decode
Alex Bennée [Wed, 22 Apr 2026 12:52:36 +0000 (13:52 +0100)] 
target/arm: make hvf use syndrome helpers for decode

Rather than open coding a bunch of shifts and masks we can use the
syndrome definitions.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260422125250.1303100-20-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: make whpx use syndrome helpers for decode
Alex Bennée [Wed, 22 Apr 2026 12:52:35 +0000 (13:52 +0100)] 
target/arm: make whpx use syndrome helpers for decode

Rather than open coding a bunch of shifts and masks we can use the
syndrome definitions. While we are at it assert it really is a
EC_DATAABORT.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-19-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: use syndrome helpers to set SAME_EL EC bit
Alex Bennée [Wed, 22 Apr 2026 12:52:34 +0000 (13:52 +0100)] 
target/arm: use syndrome helpers to set SAME_EL EC bit

This removes the last use of ARM_EL_EC_SHIFT.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-18-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: use syndrome helpers in arm_cpu_do_interrupt_aarch32_hyp
Alex Bennée [Wed, 22 Apr 2026 12:52:33 +0000 (13:52 +0100)] 
target/arm: use syndrome helpers in arm_cpu_do_interrupt_aarch32_hyp

One more step towards dropping the old #defines.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-17-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate check_hcr_el2_trap to use syndrome helper
Alex Bennée [Wed, 22 Apr 2026 12:52:32 +0000 (13:52 +0100)] 
target/arm: migrate check_hcr_el2_trap to use syndrome helper

It shares the same COPROC_ISS encoding as the other CP traps although
not all the fields are used.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-16-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate memory op syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:31 +0000 (13:52 +0100)] 
target/arm: migrate memory op syndromes to registerfields

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-15-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate gcs syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:30 +0000 (13:52 +0100)] 
target/arm: migrate gcs syndromes to registerfields

Tweak arg names to make it clear raddr is the data address register
number.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-14-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate wfx syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:29 +0000 (13:52 +0100)] 
target/arm: migrate wfx syndromes to registerfields

This will help later when we expand the fields we report.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-13-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate debug syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:28 +0000 (13:52 +0100)] 
target/arm: migrate debug syndromes to registerfields

Migrate syn_swstep, syn_watchpoint and syn_breakpoint to the
registerfields API.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-12-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate fault syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:27 +0000 (13:52 +0100)] 
target/arm: migrate fault syndromes to registerfields

Migrate syn_insn_abort and syn_data_abort_* to the registerfields API.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260422125250.1303100-11-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate Granule Protection traps to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:26 +0000 (13:52 +0100)] 
target/arm: migrate Granule Protection traps to registerfields

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-10-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate BXJ trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:25 +0000 (13:52 +0100)] 
target/arm: migrate BXJ trap syndromes to registerfields

This is an Armv7 specific syndrome for chips with Jazelle
functionality.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-9-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate BTI trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:24 +0000 (13:52 +0100)] 
target/arm: migrate BTI trap syndromes to registerfields

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-8-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate PAC trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:23 +0000 (13:52 +0100)] 
target/arm: migrate PAC trap syndromes to registerfields

syn_pactrap is fairly simple as the ISS is all RES0.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-7-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate SME trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:22 +0000 (13:52 +0100)] 
target/arm: migrate SME trap syndromes to registerfields

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-6-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate eret trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:21 +0000 (13:52 +0100)] 
target/arm: migrate eret trap syndromes to registerfields

For simplicity keep the OP as a two bit field rather than the two
interlinked fields in the docs (ERET/ERETA).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-5-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate FP/SIMD trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:20 +0000 (13:52 +0100)] 
target/arm: migrate FP/SIMD trap syndromes to registerfields

The syn_simd_access trap was never used so remove it. We should only
see the COPROC encoding on v7 architectures.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-4-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate system/cp trap syndromes to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:19 +0000 (13:52 +0100)] 
target/arm: migrate system/cp trap syndromes to registerfields

Migrate syn_aa64_sysregtrap and co-processor register trap syndromes
to the registerfields API. The co-processor syndromes are split
between single and duel register moves.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-3-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: migrate basic syndrome helpers to registerfields
Alex Bennée [Wed, 22 Apr 2026 12:52:18 +0000 (13:52 +0100)] 
target/arm: migrate basic syndrome helpers to registerfields

We have a registerfields interface which we can use for defining
fields alongside helpers to access them. Define the basic syndrome
layout and convert the helpers that take the imm16 data directly.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260422125250.1303100-2-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx6ul: Wire in the LCDIF device model
Yucai Liu [Sun, 12 Apr 2026 11:02:40 +0000 (19:02 +0800)] 
hw/arm/fsl-imx6ul: Wire in the LCDIF device model

Instantiate LCDIF as a child object of the i.MX6UL SoC in init and
realize it in the SoC realize path before MMIO/IRQ hookup.

Also make FSL_IMX6UL select CONFIG_IMX6UL_LCDIF and map the LCDIF
region with a 16 KiB size to match the SoC memory map.

Signed-off-by: Yucai Liu <1486344514@qq.com>
Message-id: 20260412110240.93116-3-yangyanglan718@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/display: Add i.MX6UL LCDIF device model
Yucai Liu [Sun, 12 Apr 2026 11:02:39 +0000 (19:02 +0800)] 
hw/display: Add i.MX6UL LCDIF device model

Implement a basic i.MX6UL LCDIF controller model with MMIO registers,
frame-done interrupt behavior, and framebuffer-backed display updates
for RGB565 and XRGB8888 input formats.

Place the LCDIF device under hw/display and build it via a dedicated
CONFIG_IMX6UL_LCDIF symbol. Model register fields with
registerfields.h helpers and provide migration support via vmstate.

Signed-off-by: Yucai Liu <1486344514@qq.com>
Message-id: 20260412110240.93116-2-yangyanglan718@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/raspi4b: NOP all DTB nodes when removing unimplemented devices
Osama Abdelkader [Mon, 20 Apr 2026 16:21:14 +0000 (18:21 +0200)] 
hw/arm/raspi4b: NOP all DTB nodes when removing unimplemented devices

fdt_node_offset_by_compatible(fdt, -1, compat) only finds the first match.
If the blob has more than one node with the same compatible string, extra
nodes will remain active. Remove all the matching nodes, using the same
loop as imx8mp-evk.c does for this purpose.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Message-id: 20260420162114.308519-1-osama.abdelkader@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agoRevert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat"
Eric Auger [Mon, 20 Apr 2026 14:03:57 +0000 (16:03 +0200)] 
Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat"

This reverts commit 4f2b82f60431 ("target/arm: Reinstate bogus AArch32
DBGDTRTX register for migration compat). We don't need that commit
anymore as the AArch32 DBGDTRTX register is declared to
be safe to ignore in the incoming migration stream.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260420140552.104369-8-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/helper: Define cpreg migration tolerance for DGBDTR_EL0
Eric Auger [Mon, 20 Apr 2026 14:03:56 +0000 (16:03 +0200)] 
target/arm/helper: Define cpreg migration tolerance for DGBDTR_EL0

We want to remove AArch32 DBGDTRTX which was erroneously exposed.
This was attempted by 655659a74a36b ("target/arm: Correct encoding
of Debug Communications Channel registers") but it was discovered
that the removal of this debug register broke forward migration on
TCG. Now we have the cpreg migration tolerance infrastructure, we
can declare one for the DBGDTRTX. This allow to revert the reinstate
patch.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260420140552.104369-7-eric.auger@redhat.com
[PMM: revised comment, included note about when we can drop
 the workaround]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/cpu64: Define cpreg migration tolerance for KVM_REG_ARM_VENDOR_HYP_BMAP_2
Eric Auger [Mon, 20 Apr 2026 14:03:55 +0000 (16:03 +0200)] 
target/arm/cpu64: Define cpreg migration tolerance for KVM_REG_ARM_VENDOR_HYP_BMAP_2

KVM_REG_ARM_VENDOR_HYP_BMAP_2 pseudo FW register is exposed
from v6.15 onwards. Backward migration from a >= v6.15 to an older
kernel would fail without cpreg migration tolerance definition
for this register. If the register is present on source but not
on destination, its value must be checked to make sure it matches
the reset value, ie. 0, meaning no service is exposed to the guest,
hence the choice of a ToleranceOnlySrcTestValue migration
tolerance.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260420140552.104369-6-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/cpu64: Mitigate migration failures due to spurious TCR_EL1, PIRE0_EL1...
Eric Auger [Mon, 20 Apr 2026 14:03:54 +0000 (16:03 +0200)] 
target/arm/cpu64: Mitigate migration failures due to spurious TCR_EL1, PIRE0_EL1 and PIR_EL1

Before linux v6.13 those registers were erroneously unconditionally
exposed and this was fixed by commits:
0fcb4eea5345 ("KVM: arm64: Hide TCR2_EL1 from userspace when
                 disabled for guests")
a68cddbe47ef ("KVM: arm64: Hide S1PIE registers from userspace
                 when disabled for guests")
in v6.13.

This means if we migrate from an old kernel host to a >= 6.13 kernel
host, migration currently fails.

Declare cpreg migration tolerance for those registers.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260420140552.104369-5-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/machine: Handle ToleranceOnlySrcTestValue migration tolerance
Eric Auger [Mon, 20 Apr 2026 14:03:53 +0000 (16:03 +0200)] 
target/arm/machine: Handle ToleranceOnlySrcTestValue migration tolerance

Pass the value of the incoming register to
handle_cpreg_only_in_incoming_stream and check whether there is
a matching ToleranceOnlySrcTestValue tolerance.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20260420140552.104369-4-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/machine: Handle ToleranceNotOnBothEnds migration tolerances
Eric Auger [Mon, 20 Apr 2026 14:03:52 +0000 (16:03 +0200)] 
target/arm/machine: Handle ToleranceNotOnBothEnds migration tolerances

If there is a mismatch between the cpreg indexes found on both ends,
check whether a tolerance was registered for the given kvmidx. If any,
silence warning/errors.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260420140552.104369-3-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm/cpu: Introduce the infrastructure for cpreg migration tolerances
Eric Auger [Mon, 20 Apr 2026 14:03:51 +0000 (16:03 +0200)] 
target/arm/cpu: Introduce the infrastructure for cpreg migration tolerances

We introduce a datatype for a tolerance with respect to a given
cpreg migration issue. The tolerance applies to a given cpreg kvm index,
and can be of different types:
a) mismatch in cpreg indexes
- ToleranceNotOnBothEnds (cpreg index is allowed to be only present
  on one end)
- ToleranceOnlySrcTestValue (cpreg index is allowed to be only
  present in source if its value @mask field matches @value)
b) mismatch in cpreg values
- ToleranceDiffInMask (value differences are allowed only within a mask)
- ToleranceFieldLT (incoming field value must be less than a given value)
- ToleranceFieldGT (incoming field value must be greater than a given value)

A QLIST of such tolerances can be populated using a new helper:
arm_register_cpreg_mig_tolerance() and arm_cpu_match_cpreg_mig_tolerance()
allows to check whether a tolerance exists for a given kvm index and its
criterion is matched.

callers for those helpers will be introduced in subsequent patches.

Only registration of migration tolerances related to cpreg index
mismatch is currently allowed.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20260420140552.104369-2-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotests/functional/aarch64: Add basic test of TCG aarch64=off
Peter Maydell [Thu, 16 Apr 2026 16:53:53 +0000 (17:53 +0100)] 
tests/functional/aarch64: Add basic test of TCG aarch64=off

Add a basic test of the TCG 'aarch64=off' functionality; this is the
same as our existing arm/test_virt test, but it runs the AArch32
guest kernel on qemu-system-aarch64 with -cpu max,aarch64=off.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260416165353.589569-4-peter.maydell@linaro.org

4 weeks agotarget/arm: Allow 'aarch64=off' to be set for TCG CPUs
Peter Maydell [Thu, 16 Apr 2026 16:53:52 +0000 (17:53 +0100)] 
target/arm: Allow 'aarch64=off' to be set for TCG CPUs

Allow the 'aarch64=off' property, which is currently KVM-only, to
be set for TCG CPUs also.

Note that we don't permit it on the qemu-aarch64 user-mode binary:
this makes no sense as that executable can only handle AArch64
syscalls (and it would also assert at startup since it doesn't
compile in the A32-specific GDB xml files like arm-neon.xml).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Clément Chigot <chigot@adacore.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260416165353.589569-3-peter.maydell@linaro.org

4 weeks agotarget/arm: Clear AArch64 ID regs from ARMISARegisters if AArch64 disabled
Peter Maydell [Thu, 16 Apr 2026 16:53:51 +0000 (17:53 +0100)] 
target/arm: Clear AArch64 ID regs from ARMISARegisters if AArch64 disabled

If we create a normally-AArch64 CPU and configure it with
aarch64=off, this will by default leave all the AArch64 ID register
values in its ARMISARegisters struct untouched.  That in turn means
that tests of cpu_isar_feature(aa64_something, cpu) will return true.

Until now we have had a design policy that you shouldn't check an
aa64_ feature unless you know that the CPU has AArch64; but this is
quite fragile as it's easy to forget and only causes a problem in the
corner case where AArch64 was turned off.  In particular, when we
extend the ability to disable AArch64 from only KVM to also TCG there
are many more aa64 feature check points which we would otherwise have
to audit for whether they needed to be guarded with a check on
ARM_FEATURE_AARCH64.

Instead, make the CPU realize function zero out all the 64-bit ID
registers if a TCG CPU doesn't have AArch64; this will make aa64_
feature tests generally return false.

We only do this for TCG because only TCG really needs it, and for
KVM it might be confusing to have QEMU's idea of the ID registers
be different from KVM's.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260416165353.589569-2-peter.maydell@linaro.org

4 weeks agohw: Move ARM_SYSCTL_GPIO definitions to arm sysctl specific header
Peter Maydell [Thu, 16 Apr 2026 17:26:27 +0000 (18:26 +0100)] 
hw: Move ARM_SYSCTL_GPIO definitions to arm sysctl specific header

include/hw/arm/primecell.h used to be more expansive, but now the
only thing it defines is the ARM_SYSCTL_GPIO_* constants for the GPIO
lines for the arm-sysctl system-control device used on the Realview,
Versatile and Versatile Express boards.

Replace it with a header file specific to that device.

virt.c and vmapple.c included primecell.h despite not using the
constants it defined; there we can simply drop the include entirely.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260416172627.690396-1-peter.maydell@linaro.org

4 weeks agohw/arm: Remove hw_error() for the unimplemented CM_LMBUSCNT register
Thomas Huth [Mon, 20 Apr 2026 06:49:33 +0000 (08:49 +0200)] 
hw/arm: Remove hw_error() for the unimplemented CM_LMBUSCNT register

When writing to this register, QEMU currently aborts:

 $ echo "readl 0x10000018" | ./qemu-system-arm -audiodev none,id=snd0 \
    -M integratorcp,accel=qtest,audiodev=snd0 -display none -qtest stdio
 [I 0.000000] OPENED
 [R +0.001907] readl 0x10000018
 qemu: hardware error: integratorcm_read: CM_LMBUSCNT
 [...]
 Aborted                    (core dumped)

This is bad, a guest should ideally never be able to kill QEMU like this.

Now, according to the "Intergrator/CP User Guide" from:

 https://developer.arm.com/documentation/dui0159/b/porting-integrator-ap-and-im-pd1/registers

 "The Integrator/AP CM_LMBUSCNT has been removed."

That means this register does not seem to be implemented on real CP boards
at all, only for older AP boards. Thus it should be fine if we simply
ignore this register in QEMU and handle it like all other unimplemented
registers in the "default" handler of the case statement.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3407
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260420064933.64765-1-thuth@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Compile m_helper.c once
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:48 +0000 (02:53 +0200)] 
target/arm: Compile m_helper.c once

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-10-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Replace MO_TE -> mo_endian() for Cortex-M helpers
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:47 +0000 (02:53 +0200)] 
target/arm: Replace MO_TE -> mo_endian() for Cortex-M helpers

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-9-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Compile mve_helper.c once
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:46 +0000 (02:53 +0200)] 
target/arm: Compile mve_helper.c once

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-8-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Replace MO_TE -> mo_endian() for MVE helpers
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:45 +0000 (02:53 +0200)] 
target/arm: Replace MO_TE -> mo_endian() for MVE helpers

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-7-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Introduce mo_endian() helper
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:44 +0000 (02:53 +0200)] 
target/arm: Introduce mo_endian() helper

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-6-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Hoist MO_TE into MVE DO_VSTR() macro
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:43 +0000 (02:53 +0200)] 
target/arm: Hoist MO_TE into MVE DO_VSTR() macro

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-5-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Hoist MO_TE into mve_advance_vpt()
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:42 +0000 (02:53 +0200)] 
target/arm: Hoist MO_TE into mve_advance_vpt()

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-4-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Explode MO_TExx -> MO_TE | MO_xx
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:41 +0000 (02:53 +0200)] 
target/arm: Explode MO_TExx -> MO_TE | MO_xx

Extract the implicit MO_TE definition in order to replace
it in the next commit.

Mechanical change using:

  $ for n in UW UL UQ UO SW SL SQ; do \
      sed -i -e "s/MO_TE$n/MO_TE | MO_$n/" \
           $(git grep -l MO_TE$n target/arm); \
    done

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260414005348.4767-3-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agotarget/arm: Ignore endianness when setting MTE tags
Philippe Mathieu-Daudé [Tue, 14 Apr 2026 00:53:40 +0000 (02:53 +0200)] 
target/arm: Ignore endianness when setting MTE tags

As mentioned by Richard in [*]:

  We don't actually need any specific endianness here, because
  every byte has the same value.  So we could simply drop MO_TE.
  That would produce a store in host-endianness, which will be
  fractionally more efficient on some hosts.

[*] https://lore.kernel.org/qemu-devel/d64d3576-9188-4e74-afdc-3492c9feb8e0@linaro.org/

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260414005348.4767-2-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation
Gaurav Sharma [Tue, 21 Apr 2026 06:52:26 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation

Added script that would validate the iMX8MM emulation by checking the
linux console log. If it succeeds, it will return:-

ok 1 test_imx8mm_evk.Imx8mmEvkMachine.test_aarch64_imx8mm_evk_usdhc

Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
[PMM: Add missing blank lines that flake8 wants]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for USB controller
Gaurav Sharma [Tue, 21 Apr 2026 06:52:25 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for USB controller

It enables emulation of USB on iMX8MM
Enables testing and debugging of USB drivers

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for ENET ethernet controller
Gaurav Sharma [Tue, 21 Apr 2026 06:52:24 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for ENET ethernet controller

It enables emulation of ENET ethernet controller in iMX8MM
Enables testing and debugging of network dependent drivers
Added ENET MAC IRQ lines

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for General Purpose Timers
Gaurav Sharma [Tue, 21 Apr 2026 06:52:23 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for General Purpose Timers

It enables emulation of GPT in iMX8MM
Added GPT IRQ lines

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for Watchdog Timers
Gaurav Sharma [Tue, 21 Apr 2026 06:52:22 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for Watchdog Timers

It enables emulation of WDT in iMX8MM
Added WDT IRQ lines

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for SPI controller
Gaurav Sharma [Tue, 21 Apr 2026 06:52:21 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for SPI controller

It enables emulation of ECSPI in iMX8MM
Added SPI IRQ lines

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for I2C emulation
Gaurav Sharma [Tue, 21 Apr 2026 06:52:20 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for I2C emulation

This can be used to test and debug I2C device drivers.
Added I2C interrupts

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Add GPIO controllers
Gaurav Sharma [Tue, 21 Apr 2026 06:52:19 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Add GPIO controllers

Enabled GPIO controller emulation
Also updated the GPIO IRQ lines of iMX8MM

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Add PCIe support
Gaurav Sharma [Tue, 21 Apr 2026 06:52:18 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Add PCIe support

This enables support for Designware PCI Express Controller emulation
It provides a controlled environment to debug the linux pci subsystem

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Adding support for USDHC storage controllers
Gaurav Sharma [Tue, 21 Apr 2026 06:52:17 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Adding support for USDHC storage controllers

It enables emulation of SD/MMC cards through a virtual SDHCI interface
The emulated SDHCI controller allows guest OS to use emulated storage as
a standard block device.
This will allow running the images such as those generated
by Buildroot.

Reviewed-by: Philippe Mathieu-Daude <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Implemented support for SNVS
Gaurav Sharma [Tue, 21 Apr 2026 06:52:16 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Implemented support for SNVS

SNVS contains an RTC which allows Linux to deal correctly with time

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 weeks agohw/arm/fsl-imx8mm: Add Clock Control Module IP to iMX8MM
Gaurav Sharma [Tue, 21 Apr 2026 06:52:15 +0000 (12:22 +0530)] 
hw/arm/fsl-imx8mm: Add Clock Control Module IP to iMX8MM

Add the Clock Control Module (CCM) device to i.MX8MM SoC.
The CCM implementation is shared with i.MX8MP as the register
layout is identical between the two variants.Hence iMX8MM will
be using the source of iMX8MP CCM.

Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>