Skip to contentSkip to conversation

target-arm queue

GIT PULL Applied Peter Maydell 1 participant 19 messages Mar 16 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

Some arm changes for rc0, all fairly minor bugfixes.

-- PMM

The following changes since commit fff352b9b6080e580aa1fadd29b4eccf4cb2922a:

Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2026-03-12 15:21:06 +0000)

are available in the Git repository at:

https://gitlab.com/pm215/qemu.git tags/pull-target-arm-20260316

for you to fetch changes up to ed44618b8e6cb394c6b9d3642d9d130b46b8457a:

tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays (2026-03-13 13:27:57 +0000)

----------------------------------------------------------------
target-arm queue:
* hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug
* semihosting: Correctly byteswap data when CPU is in big-endian mode
* hw/dma/pl080: Fix various minor bugs
* MAINTAINERS: Remove some no-longer active maintainers
* tests/qtest: Use g_strdup_printf() in various arm tests

----------------------------------------------------------------
Martin Kröning (3):
include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian include/exec: Provide the cpu_internal_tswap() functions semihosting/uaccess: Use the cpu_internal_tswap() functions

Peter Maydell (12):
hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug hw/dma/pl080: Handle bogus swidth and dwidth in transfers
MAINTAINERS: Remove Hannes Reinecke
MAINTAINERS: Remove Cameron Esfahani
MAINTAINERS: Remove Eduardo Habkost
MAINTAINERS: Remove Radoslaw Biernacki
MAINTAINERS: Remove Andrey Smirnov
MAINTAINERS: Remove Chris Browy
tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays tests/qtest/arm-cpu-features: Use g_strdup_printf() instead of char arrays tests/qtest/ast2700-gpio-test: Use g_strdup_printf() instead of char arrays tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays

Tao Ding (2):
hw/dma/pl080: Update interrupts after pl080_run() hw/dma/pl080: Ignore bottom 2 bits of LLI register

 MAINTAINERS                      | 18 ++----------------
 hw/core/cpu-system.c             |  6 +++---
 hw/dma/pl080.c                   | 28 +++++++++++++++++++++++-----
 hw/net/rtl8139.c                 | 23 +++++++++++++++++++++++
 hw/virtio/virtio.c               |  2 +-
 include/exec/tswap.h             | 36 ++++++++++++++++++++++++++++++++++++
 include/hw/core/cpu.h            |  4 ++--
 include/hw/core/sysemu-cpu-ops.h |  6 +++---
 include/semihosting/uaccess.h    |  8 ++++----
 target/arm/cpu.c                 |  4 ++--
 target/ppc/cpu_init.c            |  2 +-
 tests/qtest/arm-cpu-features.c   | 24 +++++++++++++++---------
 tests/qtest/aspeed_gpio-test.c   |  4 ++--
 tests/qtest/ast2700-gpio-test.c  |  3 +--
 tests/qtest/ast2700-sgpio-test.c | 24 ++++++++++++------------
 15 files changed, 130 insertions(+), 62 deletions(-)
#1 lore raw

[PULL 02/17] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian

From: Martin Kröning <[email protected]>

These functions are needed to do semihosting on CPUs that support runtime-configurable endiannes. This commit renames them and allows using them for semihosting, but makes sure to signal that these functions should not be used in other circumstances.

Message-id: 20260311-semihosting-cpu-tswap-v3-1-8e239575ec08@eonerc.rwth-aachen.de

---
 hw/core/cpu-system.c             | 6 +++---
 hw/virtio/virtio.c               | 2 +-
 include/hw/core/cpu.h            | 4 ++--
 include/hw/core/sysemu-cpu-ops.h | 6 +++---
 target/arm/cpu.c                 | 4 ++--
 target/ppc/cpu_init.c            | 2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)
hw/core/cpu-system.c +3 -3
index 4a91c3e8ec..273b9b7c22 100644
@@ -127,10 +127,10 @@ int cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
     return (*cpu->cc->sysemu_ops->write_elf64_note)(f, cpu, cpuid, opaque);
 }
 
-bool cpu_virtio_is_big_endian(CPUState *cpu)
+bool cpu_internal_is_big_endian(CPUState *cpu)
 {
-    if (cpu->cc->sysemu_ops->virtio_is_big_endian) {
-        return cpu->cc->sysemu_ops->virtio_is_big_endian(cpu);
+    if (cpu->cc->sysemu_ops->internal_is_big_endian) {
+        return cpu->cc->sysemu_ops->internal_is_big_endian(cpu);
     }
     return target_big_endian();
 }
hw/virtio/virtio.c +1 -1
index 0ba734d0bc..8fcf6cfd0b 100644
@@ -2323,7 +2323,7 @@ static enum virtio_device_endian virtio_default_endian(void)
 
 static enum virtio_device_endian virtio_current_cpu_endian(void)
 {
-    if (cpu_virtio_is_big_endian(current_cpu)) {
+    if (cpu_internal_is_big_endian(current_cpu)) {
         return VIRTIO_DEVICE_ENDIAN_BIG;
     } else {
         return VIRTIO_DEVICE_ENDIAN_LITTLE;
include/hw/core/cpu.h +2 -2
index 7d2f4459d2..04e1f970ca 100644
@@ -782,13 +782,13 @@ hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs);
 
 /**
- * cpu_virtio_is_big_endian:
+ * cpu_internal_is_big_endian:
  * @cpu: CPU
 
  * Returns %true if a CPU which supports runtime configurable endianness
  * is currently big-endian.
  */
-bool cpu_virtio_is_big_endian(CPUState *cpu);
+bool cpu_internal_is_big_endian(CPUState *cpu);
 
 /**
  * cpu_has_work:
include/hw/core/sysemu-cpu-ops.h +3 -3
index 877892373f..7b2d2d2610 100644
@@ -77,13 +77,13 @@ typedef struct SysemuCPUOps {
     int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
                                 DumpState *s);
     /**
-     * @virtio_is_big_endian: Callback to return %true if a CPU which supports
+     * @internal_is_big_endian: Callback to return %true if a CPU which supports
      * runtime configurable endianness is currently big-endian.
      * Non-configurable CPUs can use the default implementation of this method.
      * This method should not be used by any callers other than the pre-1.0
-     * virtio devices.
+     * virtio devices and the semihosting interface.
      */
-    bool (*virtio_is_big_endian)(CPUState *cpu);
+    bool (*internal_is_big_endian)(CPUState *cpu);
 
     /**
      * @legacy_vmsd: Legacy state for migration.
target/arm/cpu.c +2 -2
index 7e3e84b4bb..98d09ac065 100644
@@ -756,7 +756,7 @@ static void arm_cpu_set_irq(void *opaque, int irq, int level)
     }
 }
 
-static bool arm_cpu_virtio_is_big_endian(CPUState *cs)
+static bool arm_cpu_internal_is_big_endian(CPUState *cs)
 {
     ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
@@ -2299,7 +2299,7 @@ static const struct SysemuCPUOps arm_sysemu_ops = {
     .asidx_from_attrs = arm_asidx_from_attrs,
     .write_elf32_note = arm_cpu_write_elf32_note,
     .write_elf64_note = arm_cpu_write_elf64_note,
-    .virtio_is_big_endian = arm_cpu_virtio_is_big_endian,
+    .internal_is_big_endian = arm_cpu_internal_is_big_endian,
     .legacy_vmsd = &vmstate_arm_cpu,
 };
 #endif
target/ppc/cpu_init.c +1 -1
index 3d932a5642..191f5726f6 100644
@@ -7480,7 +7480,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {
     .get_phys_page_debug = ppc_cpu_get_phys_page_debug,
     .write_elf32_note = ppc32_cpu_write_elf32_note,
     .write_elf64_note = ppc64_cpu_write_elf64_note,
-    .virtio_is_big_endian = ppc_cpu_is_big_endian,
+    .internal_is_big_endian = ppc_cpu_is_big_endian,
     .legacy_vmsd = &vmstate_ppc_cpu,
 };
 #endif
Signature · 1 line
2.43.0
#2 lore raw

[PULL 04/17] semihosting/uaccess: Use the cpu_internal_tswap() functions

In reply to Peter Maydell

From: Martin Kröning <[email protected]>

The semihosting ABI [1] states:

Quoted 2 lines

Multi-byte values in memory must be formatted as pure little-endian or pure big-endian to match the endianness mapping configuration of the processor.

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

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3258

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

Message-id: 20260311-semihosting-cpu-tswap-v3-3-8e239575ec08@eonerc.rwth-aachen.de

---
 include/semihosting/uaccess.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/semihosting/uaccess.h +4 -4
index 2093a49827..0911e3b31d 100644
@@ -28,7 +28,7 @@
     ({ uint64_t val_ = 0;                                               \
        int ret_ = cpu_memory_rw_debug(env_cpu(env), (addr),             \
                                       &val_, sizeof(val_), 0);          \
-       (val) = tswap64(val_); ret_; })
+       (val) = cpu_internal_tswap64(cs, val_); ret_; })
 
 /**
  * get_user_u32:
@@ -39,7 +39,7 @@
     ({ uint32_t val_ = 0;                                               \
        int ret_ = cpu_memory_rw_debug(env_cpu(env), (addr),             \
                                       &val_, sizeof(val_), 0);          \
-       (val) = tswap32(val_); ret_; })
+       (val) = cpu_internal_tswap32(cs, val_); ret_; })
 
 /**
  * get_user_u8:
@@ -65,7 +65,7 @@
  * Returns: 0 on success, -1 on error.
  */
 #define put_user_u64(val, addr)                                         \
-    ({ uint64_t val_ = tswap64(val);                                    \
+    ({ uint64_t val_ = cpu_internal_tswap64(cs, val);                   \
        cpu_memory_rw_debug(env_cpu(env), (addr), &val_, sizeof(val_), 1); })
 
 /**
@@ -74,7 +74,7 @@
  * Returns: 0 on success, -1 on error.
  */
 #define put_user_u32(val, addr)                                         \
-    ({ uint32_t val_ = tswap32(val);                                    \
+    ({ uint32_t val_ = cpu_internal_tswap32(cs, val);                   \
        cpu_memory_rw_debug(env_cpu(env), (addr), &val_, sizeof(val_), 1); })
 
 /**
Signature · 1 line
2.43.0
#3 lore raw

[PULL 12/17] MAINTAINERS: Remove Andrey Smirnov

In reply to Peter Maydell

Andrey Smirnov doesn't wish to be listed in MAINTAINERS any more; remove his email from the relevant sections.

Message-id: [email protected]

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 9706003812..06a0bd0383 100644
@@ -903,7 +903,6 @@ F: docs/system/arm/mcimx6ul-evk.rst
 
 MCIMX7D SABRE / i.MX7
 M: Peter Maydell <[email protected]>
-R: Andrey Smirnov <[email protected]>
 L: [email protected]
 S: Odd Fixes
 F: hw/arm/mcimx7d-sabre.c
Signature · 1 line
2.43.0
#4 lore raw

[PULL 03/17] include/exec: Provide the cpu_internal_tswap() functions

In reply to Peter Maydell

From: Martin Kröning <[email protected]>

These functions are needed to support semihosting on CPUs that support runtime-configurable endianness. They should not be used in other contexts.

Message-id: 20260311-semihosting-cpu-tswap-v3-2-8e239575ec08@eonerc.rwth-aachen.de

---
 include/exec/tswap.h | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
include/exec/tswap.h +36 -0
index 9e94fa0021..17ac544454 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/bswap.h"
 #include "qemu/target-info.h"
+#include "hw/core/cpu.h"
 
 /*
  * If we're in target-specific code, we can hard-code the swapping
@@ -72,4 +73,39 @@ static inline void tswap64s(uint64_t *s)
 }
 #endif
 
+/*
+ * If we're in semihosting code, have to swap depending on the currently
+ * configured endianness of the CPU. These functions should not be used in
+ * other contexts.
+ */
+#define cpu_internal_needs_bswap(cpu) \
+    (HOST_BIG_ENDIAN != cpu_internal_is_big_endian(cpu))
+
+static inline uint16_t cpu_internal_tswap16(CPUState *cpu, uint16_t s)
+{
+    if (cpu_internal_needs_bswap(cpu)) {
+        return bswap16(s);
+    } else {
+        return s;
+    }
+}
+
+static inline uint32_t cpu_internal_tswap32(CPUState *cpu, uint32_t s)
+{
+    if (cpu_internal_needs_bswap(cpu)) {
+        return bswap32(s);
+    } else {
+        return s;
+    }
+}
+
+static inline uint64_t cpu_internal_tswap64(CPUState *cpu, uint64_t s)
+{
+    if (cpu_internal_needs_bswap(cpu)) {
+        return bswap64(s);
+    } else {
+        return s;
+    }
+}
+
 #endif  /* TSWAP_H */
Signature · 1 line
2.43.0
#5 lore raw

[PULL 14/17] tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays

In reply to Peter Maydell

Older versions of gcc with -Wformat-overflow=2 don't like the usage of fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

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

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

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

Message-id: [email protected]

---
 tests/qtest/ast2700-sgpio-test.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
tests/qtest/ast2700-sgpio-test.c +12 -12
index 56c54cca9b..529408ca8f 100644
@@ -18,14 +18,14 @@
 static void test_output_pins(const char *machine, const uint32_t base, int idx)
 {
     QTestState *s = qtest_init(machine);
-    char name[16];
-    char qom_path[64];
     uint32_t offset = 0;
     uint32_t value = 0;
     for (int i = 0; i < ASPEED_SGPIO_MAX_PIN_PAIR; i++) {
         /* Odd index is output port */
-        sprintf(name, "sgpio%03d", i * 2 + 1);
-        sprintf(qom_path, "/machine/soc/sgpio[%d]", idx);
+        g_autofree const char *name = g_strdup_printf("sgpio%03d", i * 2 + 1);
+        g_autofree const char *qom_path
+            = g_strdup_printf("/machine/soc/sgpio[%d]", idx);
+
         offset = base + (R_SGPIO_0_CONTROL + i) * 4;
         /* set serial output */
         qtest_writel(s, offset, 0x00000001);
@@ -45,14 +45,14 @@ static void test_output_pins(const char *machine, const uint32_t base, int idx)
 static void test_input_pins(const char *machine, const uint32_t base, int idx)
 {
     QTestState *s = qtest_init(machine);
-    char name[16];
-    char qom_path[64];
     uint32_t offset = 0;
     uint32_t value = 0;
     for (int i = 0; i < ASPEED_SGPIO_MAX_PIN_PAIR; i++) {
         /* Even index is input port */
-        sprintf(name, "sgpio%03d", i * 2);
-        sprintf(qom_path, "/machine/soc/sgpio[%d]", idx);
+        g_autofree const char *name = g_strdup_printf("sgpio%03d", i * 2);
+        g_autofree const char *qom_path
+            = g_strdup_printf("/machine/soc/sgpio[%d]", idx);
+
         offset = base + (R_SGPIO_0_CONTROL + i) * 4;
         /* set serial input */
         qtest_qom_set_bool(s, qom_path, name, true);
@@ -73,8 +73,6 @@ static void test_irq_level_high(const char *machine,
                                 const uint32_t base, int idx)
 {
     QTestState *s = qtest_init(machine);
-    char name[16];
-    char qom_path[64];
     uint32_t ctrl_offset = 0;
     uint32_t int_offset = 0;
     uint32_t int_reg_idx = 0;
@@ -82,8 +80,10 @@ static void test_irq_level_high(const char *machine,
     uint32_t value = 0;
     for (int i = 0; i < ASPEED_SGPIO_MAX_PIN_PAIR; i++) {
         /* Even index is input port */
-        sprintf(name, "sgpio%03d", i * 2);
-        sprintf(qom_path, "/machine/soc/sgpio[%d]", idx);
+        g_autofree const char *name = g_strdup_printf("sgpio%03d", i * 2);
+        g_autofree const char *qom_path =
+            g_strdup_printf("/machine/soc/sgpio[%d]", idx);
+
         int_reg_idx = i / 32;
         int_bit_idx = i % 32;
         int_offset = base + (R_SGPIO_INT_STATUS_0 + int_reg_idx) * 4;
Signature · 1 line
2.43.0
#6 lore raw

[PULL 16/17] tests/qtest/ast2700-gpio-test: Use g_strdup_printf() instead of char arrays

In reply to Peter Maydell

Older versions of gcc with -Wformat-overflow=2 don't like the usage of fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/ast2700-gpio-test.c: In function ‘test_input_pins’:
../tests/qtest/ast2700-gpio-test.c:54:36: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]

             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/ast2700-gpio-test.c:54:13: note: ‘sprintf’ output between 7 and 17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Message-id: [email protected]

---
 tests/qtest/ast2700-gpio-test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tests/qtest/ast2700-gpio-test.c +1 -2
index eeae9bf11f..533feea7da 100644
@@ -44,14 +44,13 @@ static void test_output_pins(const char *machine, const uint32_t base)
 static void test_input_pins(const char *machine, const uint32_t base)
 {
     QTestState *s = qtest_init(machine);
-    char name[16];
     uint32_t offset = 0;
     uint32_t value = 0;
     uint32_t pin = 0;
 
     for (char c = 'A'; c <= 'D'; c++) {
         for (int i = 0; i < 8; i++) {
-            sprintf(name, "gpio%c%d", c, i);
+            g_autofree const char *name = g_strdup_printf("gpio%c%d", c, i);
             offset = base + (pin * 4);
             /* input direction */
             qtest_writel(s, offset, 0);
Signature · 1 line
2.43.0
#7 lore raw

[PULL 06/17] hw/dma/pl080: Update interrupts after pl080_run()

In reply to Peter Maydell

From: Tao Ding <[email protected]>

In the codepath in pl080_write() where we run the DMA engine after a change in the channel configuration register, we were missing a pl080_update() call, which meant that we weren't raising any interrupts generated by that DMA transfer.

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

Reproducer

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

Qemu monitor

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

The correct result after this fix:

    (qemu) xp /1wx 0x10140008
    10140008: 0x00020000

Message-id: 7584486ba62bc6d767c0d132dc843067f8c5efff.1773301927.git.dingtao0430@163.com

[PMM: Adjusted commit message]
---
 hw/dma/pl080.c | 1 +
 1 file changed, 1 insertion(+)
hw/dma/pl080.c +1 -0
index 6262c3f3df..c6dc5c8efa 100644
@@ -227,6 +227,7 @@ again:
         if (--s->running)
             s->running = 1;
     }
+    pl080_update(s);
 }
 
 static uint64_t pl080_read(void *opaque, hwaddr offset,
Signature · 1 line
2.43.0
#8 lore raw

[PULL 17/17] tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays

In reply to Peter Maydell

Older versions of gcc with -Wformat-overflow=2 don't like the usage of fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

../tests/qtest/aspeed_gpio-test.c: In function ‘test_set_input_pins’:
../tests/qtest/aspeed_gpio-test.c:149:36: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]

             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/aspeed_gpio-test.c:149:13: note: ‘sprintf’ output between 7 and 17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Message-id: [email protected]

---
 tests/qtest/aspeed_gpio-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qtest/aspeed_gpio-test.c +2 -2
index decbba23c8..029b3731d1 100644
@@ -140,13 +140,13 @@ static void test_set_colocated_pins(const void *data)
 static void test_set_input_pins(const void *data)
 {
     QTestState *s = (QTestState *)data;
-    char name[16];
     uint32_t value;
 
     qtest_writel(s, AST2600_GPIO_BASE + GPIO_ABCD_DIRECTION, 0x00000000);
     for (char c = 'A'; c <= 'D'; c++) {
         for (int i = 0; i < 8; i++) {
-            sprintf(name, "gpio%c%d", c, i);
+            g_autofree const char *name = g_strdup_printf("gpio%c%d", c, i);
+
             qtest_qom_set_bool(s, "/machine/soc/gpio", name, true);
         }
     }
Signature · 1 line
2.43.0
#9 lore raw

[PULL 05/17] hw/dma/pl080: Handle bogus swidth and dwidth in transfers

In reply to Peter Maydell

The PL080 TRM states that the DWidth and SWidth fields of the channel control registers can only validly specify widths up to 32 bits (i.e. values from 0 to 2) and all other values are reserved.

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

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

Cc: [email protected]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3203

Message-id: [email protected]

---
 hw/dma/pl080.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
hw/dma/pl080.c +15 -0
index 3f8acb03de..6262c3f3df 100644
@@ -164,6 +164,21 @@ again:
                destination widths are different.  */
             swidth = 1 << ((ch->ctrl >> 18) & 7);
             dwidth = 1 << ((ch->ctrl >> 21) & 7);
+
+            /* Only widths of 1, 2 or 4 are valid */
+            if (swidth > 4) {
+                qemu_log_mask(LOG_GUEST_ERROR,
+                              "pl080: channel %d: invalid SWidth %d\n",
+                              c, extract32(ch->ctrl, 18, 3));
+                continue;
+            }
+            if (dwidth > 4) {
+                qemu_log_mask(LOG_GUEST_ERROR,
+                              "pl080: channel %d: invalid DWidth %d\n",
+                              c, extract32(ch->ctrl, 21, 3));
+                continue;
+            }
+
             for (n = 0; n < dwidth; n+= swidth) {
                 address_space_read(&s->downstream_as, ch->src,
                                    MEMTXATTRS_UNSPECIFIED, buff + n, swidth);
Signature · 1 line
2.43.0
#10 lore raw

[PULL 13/17] MAINTAINERS: Remove Chris Browy

In reply to Peter Maydell

Chris Browy's listed email address is undeliverable:

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

Remove his name from the file.

Message-id: [email protected]

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 06a0bd0383..7a0c71e12c 100644
@@ -2160,7 +2160,6 @@ F: docs/system/sriov.rst
 
 PCIE DOE
 M: Huai-Cheng Kuo <[email protected]>
-M: Chris Browy <[email protected]>
 S: Supported
 F: include/hw/pci/pcie_doe.h
 F: hw/pci/pcie_doe.c
Signature · 1 line
2.43.0
#11 lore raw

[PULL 15/17] tests/qtest/arm-cpu-features: Use g_strdup_printf() instead of char arrays

In reply to Peter Maydell

Older versions of gcc with -Wformat-overflow=2 don't like the usage of fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:

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

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

Message-id: [email protected]

---
 tests/qtest/arm-cpu-features.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
tests/qtest/arm-cpu-features.c +15 -9
index eb8ddebffb..5444e4d40b 100644
@@ -519,7 +519,6 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
         bool kvm_supports_pmu;
         bool kvm_supports_steal_time;
         bool kvm_supports_sve;
-        char max_name[8], name[8];
         uint32_t max_vq, vq;
         uint64_t vls;
         QDict *resp;
@@ -573,9 +572,12 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
         }
 
         if (kvm_supports_sve) {
+            g_autofree const char *max_name = NULL;
+            g_autofree const char *name = NULL;
+
             g_assert(vls != 0);
             max_vq = 64 - __builtin_clzll(vls);
-            sprintf(max_name, "sve%u", max_vq * 128);
+            max_name = g_strdup_printf("sve%u", max_vq * 128);
 
             /* Enabling a supported length is of course fine. */
             assert_sve_vls(qts, "host", vls, "{ %s: true }", max_name);
@@ -583,6 +585,9 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
             /* Get the next supported length smaller than max-vq. */
             vq = 64 - __builtin_clzll(vls & ~BIT_ULL(max_vq - 1));
             if (vq) {
+                g_autofree const char *name2 =
+                    g_strdup_printf("sve%u", vq * 128);
+
                 /*
                  * We have at least one length smaller than max-vq,
                  * so we can disable max-vq.
@@ -595,11 +600,10 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
                  * unless all larger, supported vector lengths are also
                  * disabled.
                  */
-                sprintf(name, "sve%u", vq * 128);
-                error = g_strdup_printf("cannot disable %s", name);
+                error = g_strdup_printf("cannot disable %s", name2);
                 assert_error(qts, "host", error,
                              "{ %s: true, %s: false }",
-                             max_name, name);
+                             max_name, name2);
                 g_free(error);
             }
 
@@ -608,7 +612,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
              * we need at least one vector length enabled.
              */
             vq = __builtin_ffsll(vls);
-            sprintf(name, "sve%u", vq * 128);
+            name = g_strdup_printf(name, "sve%u", vq * 128);
             error = g_strdup_printf("cannot disable %s", name);
             assert_error(qts, "host", error, "{ %s: false }", name);
             g_free(error);
@@ -620,9 +624,11 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
                 }
             }
             if (vq <= SVE_MAX_VQ) {
-                sprintf(name, "sve%u", vq * 128);
-                error = g_strdup_printf("cannot enable %s", name);
-                assert_error(qts, "host", error, "{ %s: true }", name);
+                g_autofree const char *name2 =
+                    g_strdup_printf("sve%u", vq * 128);
+
+                error = g_strdup_printf("cannot enable %s", name2);
+                assert_error(qts, "host", error, "{ %s: true }", name2);
                 g_free(error);
             }
         } else {
Signature · 1 line
2.43.0
#12 lore raw

[PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug

In reply to Peter Maydell

If you compile QEMU with GCC with -fsanitize=address and -Wstringop-overflow, this causes GCC to produce a false-positive warning which it does not produce when the sanitizer is not enabled (and which makes compilation fail if you're using -Werror, as we do by default for builds from git):

../../hw/net/rtl8139.c: In function ‘rtl8139_io_writeb’:
../../hw/net/rtl8139.c:2264:17: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]

 2264 |                 memcpy(data_to_checksum, saved_ip_header + 12, 8);
      |                 ^
In file included from ../../hw/net/rtl8139.c:62:
/home/pm215/qemu/include/net/eth.h:50:14: note: at offset [8, 48] into destination object ‘ip_ver_len’ of size 1
   50 |     uint8_t  ip_ver_len;     /* version and header length */
      |              ^~~~~~~~~~
../../hw/net/rtl8139.c:2192:21: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
 2192 |                     memcpy(data_to_checksum, saved_ip_header + 12, 8);
      |                     ^
/home/pm215/qemu/include/net/eth.h:50:14: note: at offset [8, 48] into destination object ‘ip_ver_len’ of size 1
   50 |     uint8_t  ip_ver_len;     /* version and header length */
      |              ^~~~~~~~~~
../../hw/net/rtl8139.c:2192:21: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
 2192 |                     memcpy(data_to_checksum, saved_ip_header + 12, 8);
      |                     ^
/home/pm215/qemu/include/net/eth.h:50:14: note: at offset [8, 48] into destination object ‘ip_ver_len’ of size 1
   50 |     uint8_t  ip_ver_len;     /* version and header length */
      |              ^~~~~~~~~~
In file included from /home/pm215/qemu/include/system/memory.h:21,
                 from /home/pm215/qemu/include/hw/pci/pci.h:4,
                 from /home/pm215/qemu/include/hw/pci/pci_device.h:4,
                 from ../../hw/net/rtl8139.c:54:
In function ‘stl_he_p’,
    inlined from ‘stl_be_p’ at /home/pm215/qemu/include/qemu/bswap.h:371:5,
    inlined from ‘rtl8139_cplus_transmit_one’ at ../../hw/net/rtl8139.c:2244:21,
    inlined from ‘rtl8139_cplus_transmit’ at ../../hw/net/rtl8139.c:2345:28,
    inlined from ‘rtl8139_io_writeb’ at ../../hw/net/rtl8139.c:2728:17:
/home/pm215/qemu/include/qemu/bswap.h:284:5: error: writing 4 bytes into a region of size 0 [-Werror=stringop-overflow=]
  284 |     __builtin_memcpy(ptr, &v, sizeof(v));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pm215/qemu/include/net/eth.h: In function ‘rtl8139_io_writeb’:
/home/pm215/qemu/include/net/eth.h:50:14: note: at offset [24, 64] into destination object ‘ip_ver_len’ of size 1
   50 |     uint8_t  ip_ver_len;     /* version and header length */
      |              ^~~~~~~~~~

This has been triaged as a bug in GCC:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114494
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99673
(the sanitizer pass rewrites the IR in a way that conflicts with its use by the warning pass that runs afterwards).

Since this is the only place in our code where we hit this, work around it by disabling the -Wstringop-overflow in the part of the function that hits it. We do this only when using the address sanitizer on GCC, so that we still get the benefit of the warning in most compilation scenarios.

Cc: [email protected]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3006

Message-id: [email protected]

---
 hw/net/rtl8139.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
hw/net/rtl8139.c +23 -0
index 2ad6338ebe..424af73a18 100644
@@ -2124,6 +2124,26 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
                     hlen, ip->ip_sum);
             }
 
+            /*
+             * The code in this function triggers a GCC bug where an
+             * interaction between -fsanitize=address and -Wstringop-overflow
+             * results in a false-positive stringop-overflow warning that is
+             * only emitted when the address sanitizer is enabled:
+             *     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114494
+             *     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99673
+             * GCC incorrectly thinks that the eth_payload_data buffer has
+             * the type and size of the first field in 'struct ip_header', i.e.
+             * one byte, and then complains about all other attempts to access
+             * data in the buffer.
+             *
+             * Work around this by disabling the warning when building with
+             * GCC and the address sanitizer is enabled.
+             */
+#pragma GCC diagnostic push
+#if !defined(__clang__) && defined(QEMU_SANITIZE_ADDRESS)
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
             if ((txdw0 & CP_TX_LGSEN) && ip_protocol == IP_PROTO_TCP)
             {
                 /* Large enough for the TCP header? */
@@ -2307,6 +2327,9 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
                 /* restore IP header */
                 memcpy(eth_payload_data, saved_ip_header, hlen);
             }
+
+#pragma GCC diagnostic pop
+
         }
 
 skip_offload:
Signature · 1 line
2.43.0
#13 lore raw

[PULL 11/17] MAINTAINERS: Remove Radoslaw Biernacki

In reply to Peter Maydell

Radoslaw Biernacki doesn't wish to be listed in MAINTAINERS any more; remove his email from the relevant sections.

Message-id: [email protected]

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 71cd07acf1..9706003812 100644
@@ -1036,7 +1036,6 @@ F: include/hw/misc/imx6_*.h
 F: include/hw/ssi/imx_spi.h
 
 SBSA-REF
-M: Radoslaw Biernacki <[email protected]>
 M: Peter Maydell <[email protected]>
 R: Leif Lindholm <[email protected]>
 L: [email protected]
Signature · 1 line
2.43.0
#14 lore raw

[PULL 07/17] hw/dma/pl080: Ignore bottom 2 bits of LLI register

In reply to Peter Maydell

From: Tao Ding <[email protected]>

The PL080 channel LLI (linked list item) register has bits [31:2] of the address of the next LLI in bits [31:2], with bit [1] reserved and bits [0] the AHB master select. We were incorrectly using the whole register value as the address, which meant that if the guest programmed something into the AHB master select bit we would use an incorrect address, and read incorrect data from memory.

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

Configuration

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

The correct result with this bug fix:

    (qemu) xp /1wx 0x00001000
     00001000: 0x44332211
    (qemu) xp /1wx 0x00001004
     00001004: 0x88776655
[PMM: Adjusted commit message]

Message-id: cb35c1b622674da7a2b70691402132f691933f2c.1773301927.git.dingtao0430@163.com

---
 hw/dma/pl080.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
hw/dma/pl080.c +7 -5
index c6dc5c8efa..627ccbbd81 100644
@@ -102,6 +102,7 @@ static void pl080_run(PL080State *s)
     int size;
     uint8_t buff[4];
     uint32_t req;
+    uint32_t next_lli;
 
     s->tc_mask = 0;
     for (c = 0; c < s->nchannels; c++) {
@@ -198,21 +199,22 @@ again:
             ch->ctrl = (ch->ctrl & 0xfffff000) | size;
             if (size == 0) {
                 /* Transfer complete.  */
-                if (ch->lli) {
+                next_lli = (ch->lli & ~3);
+                if (next_lli) {
                     ch->src = address_space_ldl_le(&s->downstream_as,
-                                                   ch->lli,
+                                                   next_lli,
                                                    MEMTXATTRS_UNSPECIFIED,
                                                    NULL);
                     ch->dest = address_space_ldl_le(&s->downstream_as,
-                                                    ch->lli + 4,
+                                                    next_lli + 4,
                                                     MEMTXATTRS_UNSPECIFIED,
                                                     NULL);
                     ch->ctrl = address_space_ldl_le(&s->downstream_as,
-                                                    ch->lli + 12,
+                                                    next_lli + 12,
                                                     MEMTXATTRS_UNSPECIFIED,
                                                     NULL);
                     ch->lli = address_space_ldl_le(&s->downstream_as,
-                                                   ch->lli + 8,
+                                                   next_lli + 8,
                                                    MEMTXATTRS_UNSPECIFIED,
                                                    NULL);
                 } else {
Signature · 1 line
2.43.0
#15 lore raw

[PULL 09/17] MAINTAINERS: Remove Cameron Esfahani

In reply to Peter Maydell

Cameron Esfahani doesn't wish to be listed in MAINTAINERS any more; remove his email from the relevant sections.

Message-id: [email protected]

---
 MAINTAINERS | 3 ---
 1 file changed, 3 deletions(-)
MAINTAINERS +0 -3
index e691ac2662..f2ee7988ed 100644
@@ -553,7 +553,6 @@ F: target/arm/hvf/
 F: target/arm/hvf-stub.c
 
 X86 HVF CPUs
-M: Cameron Esfahani <[email protected]>
 M: Roman Bolshakov <[email protected]>
 R: Phil Dennis-Jordan <[email protected]>
 W: https://wiki.qemu.org/Features/HVF
@@ -561,7 +560,6 @@ S: Maintained
 F: target/i386/hvf/
 
 HVF
-M: Cameron Esfahani <[email protected]>
 M: Roman Bolshakov <[email protected]>
 R: Phil Dennis-Jordan <[email protected]>
 W: https://wiki.qemu.org/Features/HVF
@@ -607,7 +605,6 @@ S: Supported
 F: target/i386/mshv/
 
 X86 Instruction Emulator
-M: Cameron Esfahani <[email protected]>
 M: Roman Bolshakov <[email protected]>
 R: Phil Dennis-Jordan <[email protected]>
 R: Wei Liu <[email protected]>
Signature · 1 line
2.43.0
#16 lore raw

[PULL 10/17] MAINTAINERS: Remove Eduardo Habkost

In reply to Peter Maydell

Eduardo Habkost doesn't wish to be listed in MAINTAINERS any more; remove his email, and also the git trees he used to use.

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

Message-id: [email protected]

---
 MAINTAINERS | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
MAINTAINERS +1 -8
index f2ee7988ed..71cd07acf1 100644
@@ -422,7 +422,6 @@ F: tests/tcg/sparc64/
 X86 TCG CPUs
 M: Paolo Bonzini <[email protected]>
 M: Richard Henderson <[email protected]>
-M: Eduardo Habkost <[email protected]>
 S: Maintained
 F: target/i386/tcg/
 F: tests/tcg/i386/
@@ -430,7 +429,6 @@ F: tests/tcg/x86_64/
 F: hw/i386/
 F: docs/system/i386/cpu.rst
 F: docs/system/cpu-models-x86*
-T: git https://gitlab.com/ehabkost/qemu.git x86-next
 
 Xtensa TCG CPUs
 M: Max Filippov <[email protected]>
@@ -2015,7 +2013,6 @@ F: include/hw/i386/nitro_enclave.h
 F: docs/system/i386/nitro-enclave.rst
 
 Machine core
-M: Eduardo Habkost <[email protected]>
 M: Marcel Apfelbaum <[email protected]>
 R: Philippe Mathieu-Daudé <[email protected]>
 R: Yanan Wang <[email protected]>
@@ -2038,7 +2035,6 @@ F: include/system/numa.h
 F: tests/functional/x86_64/test_cpu_queries.py
 F: tests/functional/generic/test_empty_cpu_model.py
 F: tests/unit/test-smp-parse.c
-T: git https://gitlab.com/ehabkost/qemu.git machine-next
 
 TargetInfo API
 M: Pierrick Bouvier <[email protected]>
@@ -3446,7 +3442,6 @@ S: Maintained
 F: backends/hostmem*.c
 F: include/system/hostmem.h
 F: docs/system/vm-templating.rst
-T: git https://gitlab.com/ehabkost/qemu.git machine-next
 
 Cryptodev Backends
 M: Gonglei <[email protected]>
@@ -3549,7 +3544,6 @@ T: git https://github.com/kostyanf14/qemu.git qga-win32
 QOM
 M: Paolo Bonzini <[email protected]>
 R: Daniel P. Berrange <[email protected]>
-R: Eduardo Habkost <[email protected]>
 S: Supported
 F: docs/devel/qom.rst
 F: docs/qdev-device-use.txt
@@ -3572,8 +3566,7 @@ F: tests/unit/test-qdev-global-props.c
 F: tests/qtest/qom-test.c
 
 QOM boilerplate conversion script
-M: Eduardo Habkost <[email protected]>
-S: Maintained
+S: Orphan
 F: scripts/codeconverter/
 
 QMP
Signature · 1 line
2.43.0
#17 lore raw

[PULL 08/17] MAINTAINERS: Remove Hannes Reinecke

In reply to Peter Maydell

Hannes Reinecke doesn't wish to be listed in MAINTAINERS any more; remove his email from the relevant sections.

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

Message-id: [email protected]

---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
MAINTAINERS +1 -2
index 247799c817..e691ac2662 100644
@@ -2636,9 +2636,8 @@ F: include/block/ufs.h
 F: tests/qtest/ufs-test.c
 
 megasas
-M: Hannes Reinecke <[email protected]>
 L: [email protected]
-S: Supported
+S: Orphan
 F: hw/scsi/megasas.c
 F: hw/scsi/mfi.h
 F: tests/qtest/megasas-test.c
Signature · 1 line
2.43.0
author Applied
#18 lore raw
In reply to Peter Maydell
Quoted 17 lines · Peter Maydell

Some arm changes for rc0, all fairly minor bugfixes.

-- PMM

The following changes since commit fff352b9b6080e580aa1fadd29b4eccf4cb2922a:

Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2026-03-12 15:21:06 +0000)

are available in the Git repository at:

https://gitlab.com/pm215/qemu.git tags/pull-target-arm-20260316

for you to fetch changes up to ed44618b8e6cb394c6b9d3642d9d130b46b8457a:

tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays (2026-03-13 13:27:57 +0000)

Quoted 8 lines

----------------------------------------------------------------
target-arm queue:
* hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug
* semihosting: Correctly byteswap data when CPU is in big-endian mode
* hw/dma/pl080: Fix various minor bugs
* MAINTAINERS: Remove some no-longer active maintainers
* tests/qtest: Use g_strdup_printf() in various arm tests

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0
for any user-visible changes.

-- PMM