* [PULL 00/17] target-arm queue
@ 2026-03-16 10:42 Peter Maydell
2026-03-16 10:42 ` [PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug Peter Maydell
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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(-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 02/17] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian Peter Maydell
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3006
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Yodel Eldar <yodel.eldar@yodel.dev>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20260305140512.1330691-1-peter.maydell@linaro.org
---
hw/net/rtl8139.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 2ad6338ebe..424af73a18 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -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:
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 02/17] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
2026-03-16 10:42 ` [PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 03/17] include/exec: Provide the cpu_internal_tswap() functions Peter Maydell
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
From: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
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.
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260311-semihosting-cpu-tswap-v3-1-8e239575ec08@eonerc.rwth-aachen.de
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
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(-)
diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c
index 4a91c3e8ec..273b9b7c22 100644
--- a/hw/core/cpu-system.c
+++ b/hw/core/cpu-system.c
@@ -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();
}
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 0ba734d0bc..8fcf6cfd0b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -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;
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 7d2f4459d2..04e1f970ca 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -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:
diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h
index 877892373f..7b2d2d2610 100644
--- a/include/hw/core/sysemu-cpu-ops.h
+++ b/include/hw/core/sysemu-cpu-ops.h
@@ -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.
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 7e3e84b4bb..98d09ac065 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -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
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 3d932a5642..191f5726f6 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 03/17] include/exec: Provide the cpu_internal_tswap() functions
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
2026-03-16 10:42 ` [PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug Peter Maydell
2026-03-16 10:42 ` [PULL 02/17] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 04/17] semihosting/uaccess: Use " Peter Maydell
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
From: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
These functions are needed to support semihosting on CPUs that support
runtime-configurable endianness. They should not be used in other contexts.
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Message-id: 20260311-semihosting-cpu-tswap-v3-2-8e239575ec08@eonerc.rwth-aachen.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/exec/tswap.h | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index 9e94fa0021..17ac544454 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -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 */
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 04/17] semihosting/uaccess: Use the cpu_internal_tswap() functions
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (2 preceding siblings ...)
2026-03-16 10:42 ` [PULL 03/17] include/exec: Provide the cpu_internal_tswap() functions Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 05/17] hw/dma/pl080: Handle bogus swidth and dwidth in transfers Peter Maydell
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
From: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
The semihosting ABI [1] states:
> 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
Buglink: https://github.com/taiki-e/semihosting/issues/18
[1]: https://github.com/ARM-software/abi-aa/blob/2025Q1/semihosting/semihosting.rst#the-semihosting-interface
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260311-semihosting-cpu-tswap-v3-3-8e239575ec08@eonerc.rwth-aachen.de
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/semihosting/uaccess.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/semihosting/uaccess.h b/include/semihosting/uaccess.h
index 2093a49827..0911e3b31d 100644
--- a/include/semihosting/uaccess.h
+++ b/include/semihosting/uaccess.h
@@ -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); })
/**
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 05/17] hw/dma/pl080: Handle bogus swidth and dwidth in transfers
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (3 preceding siblings ...)
2026-03-16 10:42 ` [PULL 04/17] semihosting/uaccess: Use " Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 06/17] hw/dma/pl080: Update interrupts after pl080_run() Peter Maydell
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3203
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306152140.2191653-1-peter.maydell@linaro.org
---
hw/dma/pl080.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c
index 3f8acb03de..6262c3f3df 100644
--- a/hw/dma/pl080.c
+++ b/hw/dma/pl080.c
@@ -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);
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 06/17] hw/dma/pl080: Update interrupts after pl080_run()
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (4 preceding siblings ...)
2026-03-16 10:42 ` [PULL 05/17] hw/dma/pl080: Handle bogus swidth and dwidth in transfers Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 07/17] hw/dma/pl080: Ignore bottom 2 bits of LLI register Peter Maydell
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
From: Tao Ding <dingtao0430@163.com>
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
Cc: qemu-stable@nongnu.org
Signed-off-by: Tao Ding <dingtao0430@163.com>
Message-id: 7584486ba62bc6d767c0d132dc843067f8c5efff.1773301927.git.dingtao0430@163.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: Adjusted commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/dma/pl080.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c
index 6262c3f3df..c6dc5c8efa 100644
--- a/hw/dma/pl080.c
+++ b/hw/dma/pl080.c
@@ -227,6 +227,7 @@ again:
if (--s->running)
s->running = 1;
}
+ pl080_update(s);
}
static uint64_t pl080_read(void *opaque, hwaddr offset,
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 07/17] hw/dma/pl080: Ignore bottom 2 bits of LLI register
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (5 preceding siblings ...)
2026-03-16 10:42 ` [PULL 06/17] hw/dma/pl080: Update interrupts after pl080_run() Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 08/17] MAINTAINERS: Remove Hannes Reinecke Peter Maydell
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
From: Tao Ding <dingtao0430@163.com>
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
Cc: qemu-stable@nongnu.org
Signed-off-by: Tao Ding <dingtao0430@163.com>
[PMM: Adjusted commit message]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: cb35c1b622674da7a2b70691402132f691933f2c.1773301927.git.dingtao0430@163.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/dma/pl080.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c
index c6dc5c8efa..627ccbbd81 100644
--- a/hw/dma/pl080.c
+++ b/hw/dma/pl080.c
@@ -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 {
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 08/17] MAINTAINERS: Remove Hannes Reinecke
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (6 preceding siblings ...)
2026-03-16 10:42 ` [PULL 07/17] hw/dma/pl080: Ignore bottom 2 bits of LLI register Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 09/17] MAINTAINERS: Remove Cameron Esfahani Peter Maydell
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-2-peter.maydell@linaro.org
---
MAINTAINERS | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 247799c817..e691ac2662 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2636,9 +2636,8 @@ F: include/block/ufs.h
F: tests/qtest/ufs-test.c
megasas
-M: Hannes Reinecke <hare@suse.com>
L: qemu-block@nongnu.org
-S: Supported
+S: Orphan
F: hw/scsi/megasas.c
F: hw/scsi/mfi.h
F: tests/qtest/megasas-test.c
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 09/17] MAINTAINERS: Remove Cameron Esfahani
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (7 preceding siblings ...)
2026-03-16 10:42 ` [PULL 08/17] MAINTAINERS: Remove Hannes Reinecke Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 10/17] MAINTAINERS: Remove Eduardo Habkost Peter Maydell
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
Cameron Esfahani doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-3-peter.maydell@linaro.org
---
MAINTAINERS | 3 ---
1 file changed, 3 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index e691ac2662..f2ee7988ed 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -553,7 +553,6 @@ F: target/arm/hvf/
F: target/arm/hvf-stub.c
X86 HVF CPUs
-M: Cameron Esfahani <dirty@apple.com>
M: Roman Bolshakov <rbolshakov@ddn.com>
R: Phil Dennis-Jordan <phil@philjordan.eu>
W: https://wiki.qemu.org/Features/HVF
@@ -561,7 +560,6 @@ S: Maintained
F: target/i386/hvf/
HVF
-M: Cameron Esfahani <dirty@apple.com>
M: Roman Bolshakov <rbolshakov@ddn.com>
R: Phil Dennis-Jordan <phil@philjordan.eu>
W: https://wiki.qemu.org/Features/HVF
@@ -607,7 +605,6 @@ S: Supported
F: target/i386/mshv/
X86 Instruction Emulator
-M: Cameron Esfahani <dirty@apple.com>
M: Roman Bolshakov <rbolshakov@ddn.com>
R: Phil Dennis-Jordan <phil@philjordan.eu>
R: Wei Liu <wei.liu@kernel.org>
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 10/17] MAINTAINERS: Remove Eduardo Habkost
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (8 preceding siblings ...)
2026-03-16 10:42 ` [PULL 09/17] MAINTAINERS: Remove Cameron Esfahani Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 11/17] MAINTAINERS: Remove Radoslaw Biernacki Peter Maydell
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-4-peter.maydell@linaro.org
---
MAINTAINERS | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index f2ee7988ed..71cd07acf1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -422,7 +422,6 @@ F: tests/tcg/sparc64/
X86 TCG CPUs
M: Paolo Bonzini <pbonzini@redhat.com>
M: Richard Henderson <richard.henderson@linaro.org>
-M: Eduardo Habkost <eduardo@habkost.net>
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 <jcmvbkbc@gmail.com>
@@ -2015,7 +2013,6 @@ F: include/hw/i386/nitro_enclave.h
F: docs/system/i386/nitro-enclave.rst
Machine core
-M: Eduardo Habkost <eduardo@habkost.net>
M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
R: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Yanan Wang <wangyanan55@huawei.com>
@@ -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 <pierrick.bouvier@linaro.org>
@@ -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 <arei.gonglei@huawei.com>
@@ -3549,7 +3544,6 @@ T: git https://github.com/kostyanf14/qemu.git qga-win32
QOM
M: Paolo Bonzini <pbonzini@redhat.com>
R: Daniel P. Berrange <berrange@redhat.com>
-R: Eduardo Habkost <eduardo@habkost.net>
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 <eduardo@habkost.net>
-S: Maintained
+S: Orphan
F: scripts/codeconverter/
QMP
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 11/17] MAINTAINERS: Remove Radoslaw Biernacki
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (9 preceding siblings ...)
2026-03-16 10:42 ` [PULL 10/17] MAINTAINERS: Remove Eduardo Habkost Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 12/17] MAINTAINERS: Remove Andrey Smirnov Peter Maydell
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
Radoslaw Biernacki doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-5-peter.maydell@linaro.org
---
MAINTAINERS | 1 -
1 file changed, 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 71cd07acf1..9706003812 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1036,7 +1036,6 @@ F: include/hw/misc/imx6_*.h
F: include/hw/ssi/imx_spi.h
SBSA-REF
-M: Radoslaw Biernacki <rad@semihalf.com>
M: Peter Maydell <peter.maydell@linaro.org>
R: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
L: qemu-arm@nongnu.org
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 12/17] MAINTAINERS: Remove Andrey Smirnov
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (10 preceding siblings ...)
2026-03-16 10:42 ` [PULL 11/17] MAINTAINERS: Remove Radoslaw Biernacki Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 13/17] MAINTAINERS: Remove Chris Browy Peter Maydell
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
Andrey Smirnov doesn't wish to be listed in MAINTAINERS any more;
remove his email from the relevant sections.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-6-peter.maydell@linaro.org
---
MAINTAINERS | 1 -
1 file changed, 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 9706003812..06a0bd0383 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -903,7 +903,6 @@ F: docs/system/arm/mcimx6ul-evk.rst
MCIMX7D SABRE / i.MX7
M: Peter Maydell <peter.maydell@linaro.org>
-R: Andrey Smirnov <andrew.smirnov@gmail.com>
L: qemu-arm@nongnu.org
S: Odd Fixes
F: hw/arm/mcimx7d-sabre.c
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 13/17] MAINTAINERS: Remove Chris Browy
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (11 preceding siblings ...)
2026-03-16 10:42 ` [PULL 12/17] MAINTAINERS: Remove Andrey Smirnov Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 14/17] tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays Peter Maydell
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260306120555.2035421-7-peter.maydell@linaro.org
---
MAINTAINERS | 1 -
1 file changed, 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 06a0bd0383..7a0c71e12c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2160,7 +2160,6 @@ F: docs/system/sriov.rst
PCIE DOE
M: Huai-Cheng Kuo <hchkuo@avery-design.com.tw>
-M: Chris Browy <cbrowy@avery-design.com>
S: Supported
F: include/hw/pci/pcie_doe.h
F: hw/pci/pcie_doe.c
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 14/17] tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (12 preceding siblings ...)
2026-03-16 10:42 ` [PULL 13/17] MAINTAINERS: Remove Chris Browy Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 15/17] tests/qtest/arm-cpu-features: " Peter Maydell
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-id: 20260310151507.2973843-2-peter.maydell@linaro.org
---
tests/qtest/ast2700-sgpio-test.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/qtest/ast2700-sgpio-test.c b/tests/qtest/ast2700-sgpio-test.c
index 56c54cca9b..529408ca8f 100644
--- a/tests/qtest/ast2700-sgpio-test.c
+++ b/tests/qtest/ast2700-sgpio-test.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 15/17] tests/qtest/arm-cpu-features: Use g_strdup_printf() instead of char arrays
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (13 preceding siblings ...)
2026-03-16 10:42 ` [PULL 14/17] tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 16/17] tests/qtest/ast2700-gpio-test: " Peter Maydell
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310151507.2973843-3-peter.maydell@linaro.org
---
tests/qtest/arm-cpu-features.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index eb8ddebffb..5444e4d40b 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -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 {
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 16/17] tests/qtest/ast2700-gpio-test: Use g_strdup_printf() instead of char arrays
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (14 preceding siblings ...)
2026-03-16 10:42 ` [PULL 15/17] tests/qtest/arm-cpu-features: " Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 10:42 ` [PULL 17/17] tests/qtest/aspeed_gpio-test: " Peter Maydell
2026-03-16 14:23 ` [PULL 00/17] target-arm queue Peter Maydell
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310153334.3063224-2-peter.maydell@linaro.org
---
tests/qtest/ast2700-gpio-test.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/qtest/ast2700-gpio-test.c b/tests/qtest/ast2700-gpio-test.c
index eeae9bf11f..533feea7da 100644
--- a/tests/qtest/ast2700-gpio-test.c
+++ b/tests/qtest/ast2700-gpio-test.c
@@ -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);
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PULL 17/17] tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (15 preceding siblings ...)
2026-03-16 10:42 ` [PULL 16/17] tests/qtest/ast2700-gpio-test: " Peter Maydell
@ 2026-03-16 10:42 ` Peter Maydell
2026-03-16 14:23 ` [PULL 00/17] target-arm queue Peter Maydell
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 10:42 UTC (permalink / raw)
To: qemu-devel
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.
Reported-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260310153334.3063224-3-peter.maydell@linaro.org
---
tests/qtest/aspeed_gpio-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c
index decbba23c8..029b3731d1 100644
--- a/tests/qtest/aspeed_gpio-test.c
+++ b/tests/qtest/aspeed_gpio-test.c
@@ -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);
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PULL 00/17] target-arm queue
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
` (16 preceding siblings ...)
2026-03-16 10:42 ` [PULL 17/17] tests/qtest/aspeed_gpio-test: " Peter Maydell
@ 2026-03-16 14:23 ` Peter Maydell
17 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2026-03-16 14:23 UTC (permalink / raw)
To: qemu-devel
On Mon, 16 Mar 2026 at 10:42, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> 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
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-03-16 14:24 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 10:42 [PULL 00/17] target-arm queue Peter Maydell
2026-03-16 10:42 ` [PULL 01/17] hw/net/rtl8319: Work around GCC sanitizer / -Wstringop-overflow bug Peter Maydell
2026-03-16 10:42 ` [PULL 02/17] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian Peter Maydell
2026-03-16 10:42 ` [PULL 03/17] include/exec: Provide the cpu_internal_tswap() functions Peter Maydell
2026-03-16 10:42 ` [PULL 04/17] semihosting/uaccess: Use " Peter Maydell
2026-03-16 10:42 ` [PULL 05/17] hw/dma/pl080: Handle bogus swidth and dwidth in transfers Peter Maydell
2026-03-16 10:42 ` [PULL 06/17] hw/dma/pl080: Update interrupts after pl080_run() Peter Maydell
2026-03-16 10:42 ` [PULL 07/17] hw/dma/pl080: Ignore bottom 2 bits of LLI register Peter Maydell
2026-03-16 10:42 ` [PULL 08/17] MAINTAINERS: Remove Hannes Reinecke Peter Maydell
2026-03-16 10:42 ` [PULL 09/17] MAINTAINERS: Remove Cameron Esfahani Peter Maydell
2026-03-16 10:42 ` [PULL 10/17] MAINTAINERS: Remove Eduardo Habkost Peter Maydell
2026-03-16 10:42 ` [PULL 11/17] MAINTAINERS: Remove Radoslaw Biernacki Peter Maydell
2026-03-16 10:42 ` [PULL 12/17] MAINTAINERS: Remove Andrey Smirnov Peter Maydell
2026-03-16 10:42 ` [PULL 13/17] MAINTAINERS: Remove Chris Browy Peter Maydell
2026-03-16 10:42 ` [PULL 14/17] tests/qtest/ast2700-sgpio-test: Use g_strdup_printf() instead of char arrays Peter Maydell
2026-03-16 10:42 ` [PULL 15/17] tests/qtest/arm-cpu-features: " Peter Maydell
2026-03-16 10:42 ` [PULL 16/17] tests/qtest/ast2700-gpio-test: " Peter Maydell
2026-03-16 10:42 ` [PULL 17/17] tests/qtest/aspeed_gpio-test: " Peter Maydell
2026-03-16 14:23 ` [PULL 00/17] target-arm queue Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox