* [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
@ 2025-07-07 17:19 Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Philippe Mathieu-Daudé
` (16 more replies)
0 siblings, 17 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé
Rather than re-spinning the whole "single-binary: Make hw/arm/
common" series, restrict to the API additions, but include
examples of their usefulness (hundreds of virtio objects
removed from default Linux build).
Time passed since I context-switched out of this work so I'm
not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
is in the form Zoltan asked.
Philippe Mathieu-Daudé (14):
target/qmp: Use target_cpu_type()
qemu/target-info: Factor target_arch() out
qemu/target-info: Add %target_arch field to TargetInfo
qemu/target-info: Introduce target_base_arch()
qemu/target-info: Add target_endian_mode()
qemu: Convert target_words_bigendian() to TargetInfo API
gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
qemu: Declare all load/store helpert in 'qemu/bswap.h'
hw/virtio: Build various files once
hw/core/null-machine: Define machine as generic QOM type
hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
meson.build | 1 +
include/exec/tswap.h | 83 +--------------------------
include/gdbstub/helpers.h | 15 ++---
include/hw/arm/machines-qom.h | 31 ++++++++++
include/hw/boards.h | 6 +-
include/qemu/bswap.h | 73 +++++++++++++++++++++++
include/qemu/target-info-impl.h | 8 ++-
include/qemu/target-info-qapi.h | 36 ++++++++++++
include/qemu/target-info.h | 10 +++-
include/system/memory.h | 1 -
include/user/abitypes.h | 1 -
target/ppc/mmu-hash64.h | 2 -
cpu-target.c | 7 ---
hw/acpi/bios-linker-loader.c | 2 -
hw/arm/allwinner-r40.c | 1 -
hw/arm/boot.c | 2 +
hw/arm/npcm7xx.c | 2 +-
hw/block/hd-geometry.c | 1 -
hw/char/riscv_htif.c | 1 -
hw/core/cpu-system.c | 2 +-
hw/core/machine-qmp-cmds.c | 8 +--
hw/core/null-machine.c | 20 ++++++-
hw/cxl/cxl-events.c | 2 -
hw/display/artist.c | 1 +
hw/display/ati.c | 1 +
hw/display/vga.c | 2 +-
hw/net/can/ctucan_core.c | 1 -
hw/net/lan9118.c | 1 +
hw/net/rtl8139.c | 1 +
hw/net/vmxnet3.c | 1 -
hw/pci-host/gt64120.c | 1 +
hw/pci-host/pnv_phb3.c | 1 +
hw/pci-host/pnv_phb4.c | 1 +
hw/pci-host/ppce500.c | 1 -
hw/pci-host/sh_pci.c | 1 -
hw/s390x/s390-pci-inst.c | 1 +
hw/sensor/lsm303dlhc_mag.c | 1 -
hw/smbios/smbios.c | 1 +
hw/vfio/migration-multifd.c | 1 -
hw/virtio/virtio-config-io.c | 1 -
hw/virtio/virtio-pci.c | 1 +
hw/virtio/virtio.c | 2 +-
hw/vmapple/virtio-blk.c | 1 -
system/memory.c | 1 +
system/qtest.c | 1 +
target-info-qom.c | 24 ++++++++
target-info-stub.c | 3 +
target-info.c | 33 +++++++++++
target/arm/arm-qmp-cmds.c | 3 +-
target/arm/cpu.c | 1 -
target/arm/machine.c | 12 ++++
target/i386/tcg/system/excp_helper.c | 1 -
target/i386/xsave_helper.c | 1 -
target/loongarch/loongarch-qmp-cmds.c | 3 +-
target/mips/system/mips-qmp-cmds.c | 3 +-
target/riscv/vector_helper.c | 1 -
tests/tcg/plugins/mem.c | 1 +
hw/block/meson.build | 6 +-
hw/virtio/meson.build | 20 ++++---
59 files changed, 302 insertions(+), 149 deletions(-)
create mode 100644 include/hw/arm/machines-qom.h
create mode 100644 include/qemu/target-info-qapi.h
create mode 100644 target-info-qom.c
--
2.49.0
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type()
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
@ 2025-07-07 17:19 ` Philippe Mathieu-Daudé
2025-07-07 20:05 ` Richard Henderson
2025-07-07 17:19 ` [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Philippe Mathieu-Daudé
` (15 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Peter Maydell, Song Gao, Huacai Chen, Aurelien Jarno, Jiaxun Yang,
Aleksandar Rikalo
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/arm-qmp-cmds.c | 3 ++-
target/loongarch/loongarch-qmp-cmds.c | 3 ++-
target/mips/system/mips-qmp-cmds.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c
index cefd2352638..d292c974c44 100644
--- a/target/arm/arm-qmp-cmds.c
+++ b/target/arm/arm-qmp-cmds.c
@@ -21,6 +21,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/target-info.h"
#include "hw/boards.h"
#include "kvm_arm.h"
#include "qapi/error.h"
@@ -241,7 +242,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
CpuDefinitionInfoList *cpu_list = NULL;
GSList *list;
- list = object_class_get_list(TYPE_ARM_CPU, false);
+ list = object_class_get_list(target_cpu_type(), false);
g_slist_foreach(list, arm_cpu_add_definition, &cpu_list);
g_slist_free(list);
diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loongarch-qmp-cmds.c
index f5f1cd0009d..1d8cd32f5fc 100644
--- a/target/loongarch/loongarch-qmp-cmds.c
+++ b/target/loongarch/loongarch-qmp-cmds.c
@@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/target-info.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-machine.h"
#include "cpu.h"
@@ -32,7 +33,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
CpuDefinitionInfoList *cpu_list = NULL;
GSList *list;
- list = object_class_get_list(TYPE_LOONGARCH_CPU, false);
+ list = object_class_get_list(target_cpu_type(), false);
g_slist_foreach(list, loongarch_cpu_add_definition, &cpu_list);
g_slist_free(list);
diff --git a/target/mips/system/mips-qmp-cmds.c b/target/mips/system/mips-qmp-cmds.c
index d98d6623f2f..b6a2874f2dd 100644
--- a/target/mips/system/mips-qmp-cmds.c
+++ b/target/mips/system/mips-qmp-cmds.c
@@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/target-info.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-machine.h"
#include "cpu.h"
@@ -40,7 +41,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
CpuDefinitionInfoList *cpu_list = NULL;
GSList *list;
- list = object_class_get_list(TYPE_MIPS_CPU, false);
+ list = object_class_get_list(target_cpu_type(), false);
g_slist_foreach(list, mips_cpu_add_definition, &cpu_list);
g_slist_free(list);
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Philippe Mathieu-Daudé
@ 2025-07-07 17:19 ` Philippe Mathieu-Daudé
2025-07-07 20:06 ` Richard Henderson
2025-07-09 15:24 ` Zhao Liu
2025-07-07 17:19 ` [PATCH-for-10.1 v6 03/14] qemu/target-info: Add %target_arch field to TargetInfo Philippe Mathieu-Daudé
` (14 subsequent siblings)
16 siblings, 2 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
To keep "qemu/target-info.h" self-contained to native
types, declare target_arch() -- which returns a QAPI
type -- in "qemu/target-info-qapi.h".
No logical change.
Keeping native types in "qemu/target-info.h" is necessary
to keep building tests such tests/tcg/plugins/mem.c, as
per the comment added in commit ecbcc9ead2f ("tests/tcg:
add a system test to check memory instrumentation"):
/*
* plugins should not include anything from QEMU aside from the
* API header. However as this is a test plugin to exercise the
* internals of QEMU and we want to avoid needless code duplication we
* do so here. bswap.h is pretty self-contained although it needs a
* few things provided by compiler.h.
*/
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/target-info-qapi.h | 21 +++++++++++++++++++++
include/qemu/target-info.h | 2 +-
hw/core/machine-qmp-cmds.c | 8 +++-----
target-info.c | 8 ++++++++
4 files changed, 33 insertions(+), 6 deletions(-)
create mode 100644 include/qemu/target-info-qapi.h
diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qapi.h
new file mode 100644
index 00000000000..dae92c47eb1
--- /dev/null
+++ b/include/qemu/target-info-qapi.h
@@ -0,0 +1,21 @@
+/*
+ * QEMU target info API (returning QAPI types)
+ *
+ * Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QEMU_TARGET_INFO_EXTRA_H
+#define QEMU_TARGET_INFO_EXTRA_H
+
+#include "qapi/qapi-types-machine.h"
+
+/**
+ * target_arch:
+ *
+ * Returns: QAPI SysEmuTarget enum (i.e. SYS_EMU_TARGET_X86_64).
+ */
+SysEmuTarget target_arch(void);
+
+#endif
diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
index 850a2958b9c..dde0e7d968a 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -1,5 +1,5 @@
/*
- * QEMU target info API
+ * QEMU target info API (returning native types)
*
* Copyright (c) Linaro
*
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index d82043e1c68..cd98daedd18 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -19,7 +19,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi/type-helpers.h"
#include "qemu/uuid.h"
-#include "qemu/target-info.h"
+#include "qemu/target-info-qapi.h"
#include "qom/qom-qobject.h"
#include "system/hostmem.h"
#include "system/hw_accel.h"
@@ -37,8 +37,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
MachineState *ms = MACHINE(qdev_get_machine());
MachineClass *mc = MACHINE_GET_CLASS(ms);
CpuInfoFastList *head = NULL, **tail = &head;
- SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, target_name(),
- -1, &error_abort);
+ SysEmuTarget target = target_arch();
CPUState *cpu;
CPU_FOREACH(cpu) {
@@ -139,8 +138,7 @@ QemuTargetInfo *qmp_query_target(Error **errp)
{
QemuTargetInfo *info = g_malloc0(sizeof(*info));
- info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
- &error_abort);
+ info->arch = target_arch();
return info;
}
diff --git a/target-info.c b/target-info.c
index 16fdca7aaaf..9ebabec988f 100644
--- a/target-info.c
+++ b/target-info.c
@@ -8,7 +8,9 @@
#include "qemu/osdep.h"
#include "qemu/target-info.h"
+#include "qemu/target-info-qapi.h"
#include "qemu/target-info-impl.h"
+#include "qapi/error.h"
const char *target_name(void)
{
@@ -20,6 +22,12 @@ unsigned target_long_bits(void)
return target_info()->long_bits;
}
+SysEmuTarget target_arch(void)
+{
+ return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
+ &error_abort);
+}
+
const char *target_cpu_type(void)
{
return target_info()->cpu_type;
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 03/14] qemu/target-info: Add %target_arch field to TargetInfo
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Philippe Mathieu-Daudé
@ 2025-07-07 17:19 ` Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 04/14] qemu/target-info: Introduce target_base_arch() Philippe Mathieu-Daudé
` (13 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/target-info-impl.h | 4 +++-
target-info-stub.c | 1 +
target-info.c | 9 +++++++--
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h
index 1b51cbcfe1b..a8b34d150ab 100644
--- a/include/qemu/target-info-impl.h
+++ b/include/qemu/target-info-impl.h
@@ -9,11 +9,13 @@
#ifndef QEMU_TARGET_INFO_IMPL_H
#define QEMU_TARGET_INFO_IMPL_H
-#include "qemu/target-info.h"
+#include "qapi/qapi-types-machine.h"
typedef struct TargetInfo {
/* runtime equivalent of TARGET_NAME definition */
const char *target_name;
+ /* related to TARGET_ARCH definition */
+ SysEmuTarget target_arch;
/* runtime equivalent of TARGET_LONG_BITS definition */
unsigned long_bits;
/* runtime equivalent of CPU_RESOLVING_TYPE definition */
diff --git a/target-info-stub.c b/target-info-stub.c
index fecc0e71286..2e4407ff04b 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -14,6 +14,7 @@
static const TargetInfo target_info_stub = {
.target_name = TARGET_NAME,
+ .target_arch = SYS_EMU_TARGET__MAX,
.long_bits = TARGET_LONG_BITS,
.cpu_type = CPU_RESOLVING_TYPE,
.machine_typename = TYPE_MACHINE,
diff --git a/target-info.c b/target-info.c
index 9ebabec988f..8e29553b4ef 100644
--- a/target-info.c
+++ b/target-info.c
@@ -24,8 +24,13 @@ unsigned target_long_bits(void)
SysEmuTarget target_arch(void)
{
- return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
- &error_abort);
+ SysEmuTarget arch = target_info()->target_arch;
+
+ if (arch == SYS_EMU_TARGET__MAX) {
+ arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
+ &error_abort);
+ }
+ return arch;
}
const char *target_cpu_type(void)
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 04/14] qemu/target-info: Introduce target_base_arch()
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-07-07 17:19 ` [PATCH-for-10.1 v6 03/14] qemu/target-info: Add %target_arch field to TargetInfo Philippe Mathieu-Daudé
@ 2025-07-07 17:19 ` Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 05/14] qemu/target-info: Add target_endian_mode() Philippe Mathieu-Daudé
` (12 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé
target_base_arch() returns the base architecture as in QEMU
target/$arch/ path. For example, X86_64 is implemented in the
target/i386/ so its QEMU base arch is 'i386'.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/target-info-impl.h | 2 ++
include/qemu/target-info-qapi.h | 7 +++++++
target-info-stub.c | 1 +
target-info.c | 10 ++++++++++
4 files changed, 20 insertions(+)
diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h
index a8b34d150ab..c5aea6fa6d2 100644
--- a/include/qemu/target-info-impl.h
+++ b/include/qemu/target-info-impl.h
@@ -16,6 +16,8 @@ typedef struct TargetInfo {
const char *target_name;
/* related to TARGET_ARCH definition */
SysEmuTarget target_arch;
+ /* related to TARGET_BASE_ARCH definition (target/${base_arch}/ path) */
+ SysEmuTarget target_base_arch;
/* runtime equivalent of TARGET_LONG_BITS definition */
unsigned long_bits;
/* runtime equivalent of CPU_RESOLVING_TYPE definition */
diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qapi.h
index dae92c47eb1..5d63fc4ab84 100644
--- a/include/qemu/target-info-qapi.h
+++ b/include/qemu/target-info-qapi.h
@@ -18,4 +18,11 @@
*/
SysEmuTarget target_arch(void);
+/**
+ * target_base_arch:
+ *
+ * Returns: QAPI SysEmuTarget enum (i.e. SYS_EMU_TARGET_I386).
+ */
+SysEmuTarget target_base_arch(void);
+
#endif
diff --git a/target-info-stub.c b/target-info-stub.c
index 2e4407ff04b..c0f438b45c4 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -15,6 +15,7 @@
static const TargetInfo target_info_stub = {
.target_name = TARGET_NAME,
.target_arch = SYS_EMU_TARGET__MAX,
+ .target_base_arch = SYS_EMU_TARGET__MAX,
.long_bits = TARGET_LONG_BITS,
.cpu_type = CPU_RESOLVING_TYPE,
.machine_typename = TYPE_MACHINE,
diff --git a/target-info.c b/target-info.c
index 8e29553b4ef..46780ec5450 100644
--- a/target-info.c
+++ b/target-info.c
@@ -33,6 +33,16 @@ SysEmuTarget target_arch(void)
return arch;
}
+SysEmuTarget target_base_arch(void)
+{
+ SysEmuTarget base_arch = target_info()->target_base_arch;
+
+ if (base_arch == SYS_EMU_TARGET__MAX) {
+ base_arch = target_arch();
+ }
+ return base_arch;
+}
+
const char *target_cpu_type(void)
{
return target_info()->cpu_type;
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 05/14] qemu/target-info: Add target_endian_mode()
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2025-07-07 17:19 ` [PATCH-for-10.1 v6 04/14] qemu/target-info: Introduce target_base_arch() Philippe Mathieu-Daudé
@ 2025-07-07 17:19 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 06/14] qemu: Convert target_words_bigendian() to TargetInfo API Philippe Mathieu-Daudé
` (11 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé
target_endian_mode() returns the default endianness (QAPI type)
of a target.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/target-info-impl.h | 2 ++
include/qemu/target-info-qapi.h | 8 ++++++++
target-info-stub.c | 1 +
target-info.c | 5 +++++
4 files changed, 16 insertions(+)
diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h
index c5aea6fa6d2..065cd59d2e8 100644
--- a/include/qemu/target-info-impl.h
+++ b/include/qemu/target-info-impl.h
@@ -24,6 +24,8 @@ typedef struct TargetInfo {
const char *cpu_type;
/* QOM typename machines for this binary must implement */
const char *machine_typename;
+ /* related to TARGET_BIG_ENDIAN definition */
+ EndianMode endianness;
} TargetInfo;
/**
diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qapi.h
index 5d63fc4ab84..749f874084c 100644
--- a/include/qemu/target-info-qapi.h
+++ b/include/qemu/target-info-qapi.h
@@ -9,6 +9,7 @@
#ifndef QEMU_TARGET_INFO_EXTRA_H
#define QEMU_TARGET_INFO_EXTRA_H
+#include "qapi/qapi-types-common.h"
#include "qapi/qapi-types-machine.h"
/**
@@ -25,4 +26,11 @@ SysEmuTarget target_arch(void);
*/
SysEmuTarget target_base_arch(void);
+/**
+ * target_endian_mode:
+ *
+ * Returns: QAPI EndianMode enum (i.e. ENDIAN_MODE_LITTLE).
+ */
+EndianMode target_endian_mode(void);
+
#endif
diff --git a/target-info-stub.c b/target-info-stub.c
index c0f438b45c4..5fa7fc93114 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -19,6 +19,7 @@ static const TargetInfo target_info_stub = {
.long_bits = TARGET_LONG_BITS,
.cpu_type = CPU_RESOLVING_TYPE,
.machine_typename = TYPE_MACHINE,
+ .endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
};
const TargetInfo *target_info(void)
diff --git a/target-info.c b/target-info.c
index 46780ec5450..2659aecd8d1 100644
--- a/target-info.c
+++ b/target-info.c
@@ -52,3 +52,8 @@ const char *target_machine_typename(void)
{
return target_info()->machine_typename;
}
+
+EndianMode target_endian_mode(void)
+{
+ return target_info()->endianness;
+}
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 06/14] qemu: Convert target_words_bigendian() to TargetInfo API
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2025-07-07 17:19 ` [PATCH-for-10.1 v6 05/14] qemu/target-info: Add target_endian_mode() Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 07/14] gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() Philippe Mathieu-Daudé
` (10 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu,
Gerd Hoffmann, Peter Xu, David Hildenbrand, Fabiano Rosas,
Laurent Vivier
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/tswap.h | 13 +------------
include/qemu/target-info.h | 8 ++++++++
cpu-target.c | 7 -------
hw/core/cpu-system.c | 2 +-
hw/display/vga.c | 2 +-
hw/virtio/virtio.c | 2 +-
system/memory.c | 1 +
system/qtest.c | 1 +
target-info.c | 5 +++++
9 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index 49511f26117..55ffa633598 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -9,18 +9,7 @@
#define TSWAP_H
#include "qemu/bswap.h"
-
-/**
- * target_big_endian:
- * Returns true if the (default) endianness of the target is big endian,
- * false otherwise. Common code should normally never need to know about the
- * endianness of the target, so please do *not* use this function unless you
- * know very well what you are doing!
- */
-bool target_big_endian(void);
-#ifdef COMPILING_PER_TARGET
-#define target_big_endian() TARGET_BIG_ENDIAN
-#endif
+#include "qemu/target-info.h"
/*
* If we're in target-specific code, we can hard-code the swapping
diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
index dde0e7d968a..18a8c4ff6e8 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -38,4 +38,12 @@ const char *target_machine_typename(void);
*/
const char *target_cpu_type(void);
+/**
+ * target_big_endian:
+ *
+ * Returns: %true if the (default) endianness of the target is big endian,
+ * %false otherwise.
+ */
+bool target_big_endian(void);
+
#endif
diff --git a/cpu-target.c b/cpu-target.c
index 1c90a307593..20db5ff3108 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -22,7 +22,6 @@
#include "system/accel-ops.h"
#include "system/cpus.h"
#include "exec/cpu-common.h"
-#include "exec/tswap.h"
#include "exec/replay-core.h"
#include "exec/log.h"
#include "hw/core/cpu.h"
@@ -85,9 +84,3 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
#endif
abort();
}
-
-#undef target_big_endian
-bool target_big_endian(void)
-{
- return TARGET_BIG_ENDIAN;
-}
diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c
index 3c84176a0c5..a975405d3a0 100644
--- a/hw/core/cpu-system.c
+++ b/hw/core/cpu-system.c
@@ -24,7 +24,7 @@
#include "exec/cputlb.h"
#include "system/memory.h"
#include "exec/tb-flush.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
#include "hw/qdev-core.h"
#include "hw/qdev-properties.h"
#include "hw/core/sysemu-cpu-ops.h"
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 20475ebbd31..90b89cf4044 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -26,7 +26,7 @@
#include "qemu/units.h"
#include "system/reset.h"
#include "qapi/error.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
#include "hw/display/vga.h"
#include "hw/i386/x86.h"
#include "hw/pci/pci.h"
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 82a285a31d1..0f4d28033d7 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -20,7 +20,7 @@
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
-#include "exec/tswap.h"
+#include "qemu/target-info.h"
#include "qom/object_interfaces.h"
#include "hw/core/cpu.h"
#include "hw/virtio/virtio.h"
diff --git a/system/memory.c b/system/memory.c
index e8d9b15b28f..38da62f5052 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -22,6 +22,7 @@
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/qemu-print.h"
+#include "qemu/target-info.h"
#include "qom/object.h"
#include "trace.h"
#include "system/ram_addr.h"
diff --git a/system/qtest.c b/system/qtest.c
index 301b03be2d3..fa42c9f9215 100644
--- a/system/qtest.c
+++ b/system/qtest.c
@@ -29,6 +29,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/cutils.h"
+#include "qemu/target-info.h"
#include "qom/object_interfaces.h"
#define MAX_IRQ 256
diff --git a/target-info.c b/target-info.c
index 2659aecd8d1..758b430d94a 100644
--- a/target-info.c
+++ b/target-info.c
@@ -57,3 +57,8 @@ EndianMode target_endian_mode(void)
{
return target_info()->endianness;
}
+
+bool target_big_endian(void)
+{
+ return target_endian_mode() == ENDIAN_MODE_BIG;
+}
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 07/14] gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 06/14] qemu: Convert target_words_bigendian() to TargetInfo API Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h' Philippe Mathieu-Daudé
` (9 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé
Check endianness at runtime to remove the target-specific
TARGET_BIG_ENDIAN definition.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/gdbstub/helpers.h | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/gdbstub/helpers.h b/include/gdbstub/helpers.h
index 6f7cc48adcb..1411b136d5c 100644
--- a/include/gdbstub/helpers.h
+++ b/include/gdbstub/helpers.h
@@ -16,6 +16,7 @@
#error "gdbstub helpers should only be included by target specific code"
#endif
+#include "qemu/target-info.h"
#include "exec/tswap.h"
#include "cpu-param.h"
@@ -55,18 +56,14 @@ static inline int gdb_get_reg64(GByteArray *buf, uint64_t val)
static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi,
uint64_t val_lo)
{
+ bool be = target_big_endian();
uint64_t to_quad;
-#if TARGET_BIG_ENDIAN
- to_quad = tswap64(val_hi);
+
+ to_quad = tswap64(be ? val_hi : val_lo);
g_byte_array_append(buf, (uint8_t *) &to_quad, 8);
- to_quad = tswap64(val_lo);
+ to_quad = tswap64(be ? val_lo : val_hi);
g_byte_array_append(buf, (uint8_t *) &to_quad, 8);
-#else
- to_quad = tswap64(val_lo);
- g_byte_array_append(buf, (uint8_t *) &to_quad, 8);
- to_quad = tswap64(val_hi);
- g_byte_array_append(buf, (uint8_t *) &to_quad, 8);
-#endif
+
return 16;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h'
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 07/14] gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:22 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Philippe Mathieu-Daudé
` (8 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Igor Mammedov, Ani Sinha, Peter Maydell, Beniamino Galvani,
Strahinja Jankovic, Tyrone Ting, Hao Wu, John Snow, Kevin Wolf,
Hanna Reitz, Palmer Dabbelt, Alistair Francis, Weiwei Li,
Daniel Henrique Barboza, Liu Zhiwei, Marc-André Lureau,
Jonathan Cameron, Fan Ni, Helge Deller, Pavel Pisa,
Francisco Iglesias, Vikram Garhwal, Jason Wang, Dmitry Fleytman,
Aurelien Jarno, Nicholas Piggin, Frédéric Barrat,
Bernhard Beschow, Yoshinori Sato, Magnus Damm, Matthew Rosato,
Eric Farman, Halil Pasic, Christian Borntraeger,
David Hildenbrand, Ilya Leoshkevich, Thomas Huth, Alex Williamson,
Cédric Le Goater, Alexander Graf, Phil Dennis-Jordan,
Peter Xu, Riku Voipio, Eduardo Habkost, Zhao Liu, Alexandre Iooss,
Mahmoud Mandour
Restrict "exec/tswap.h" to the tswap*() methods,
move the load/store helpers with the other ones
declared in "qemu/bswap.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/tswap.h | 70 --------------------------
include/qemu/bswap.h | 73 ++++++++++++++++++++++++++++
include/system/memory.h | 1 -
include/user/abitypes.h | 1 -
target/ppc/mmu-hash64.h | 2 -
hw/acpi/bios-linker-loader.c | 2 -
hw/arm/allwinner-r40.c | 1 -
hw/arm/boot.c | 2 +
hw/arm/npcm7xx.c | 2 +-
hw/block/hd-geometry.c | 1 -
hw/char/riscv_htif.c | 1 -
hw/cxl/cxl-events.c | 2 -
hw/display/artist.c | 1 +
hw/display/ati.c | 1 +
hw/net/can/ctucan_core.c | 1 -
hw/net/lan9118.c | 1 +
hw/net/rtl8139.c | 1 +
hw/net/vmxnet3.c | 1 -
hw/pci-host/gt64120.c | 1 +
hw/pci-host/pnv_phb3.c | 1 +
hw/pci-host/pnv_phb4.c | 1 +
hw/pci-host/ppce500.c | 1 -
hw/pci-host/sh_pci.c | 1 -
hw/s390x/s390-pci-inst.c | 1 +
hw/sensor/lsm303dlhc_mag.c | 1 -
hw/smbios/smbios.c | 1 +
hw/vfio/migration-multifd.c | 1 -
hw/virtio/virtio-pci.c | 1 +
hw/vmapple/virtio-blk.c | 1 -
target/arm/cpu.c | 1 -
target/i386/tcg/system/excp_helper.c | 1 -
target/i386/xsave_helper.c | 1 -
target/riscv/vector_helper.c | 1 -
tests/tcg/plugins/mem.c | 1 +
34 files changed, 87 insertions(+), 93 deletions(-)
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index 55ffa633598..72219e2c431 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -69,74 +69,4 @@ static inline void tswap64s(uint64_t *s)
}
}
-/* Return ld{word}_{le,be}_p following target endianness. */
-#define LOAD_IMPL(word, args...) \
-do { \
- if (target_big_endian()) { \
- return glue(glue(ld, word), _be_p)(args); \
- } else { \
- return glue(glue(ld, word), _le_p)(args); \
- } \
-} while (0)
-
-static inline int lduw_p(const void *ptr)
-{
- LOAD_IMPL(uw, ptr);
-}
-
-static inline int ldsw_p(const void *ptr)
-{
- LOAD_IMPL(sw, ptr);
-}
-
-static inline int ldl_p(const void *ptr)
-{
- LOAD_IMPL(l, ptr);
-}
-
-static inline uint64_t ldq_p(const void *ptr)
-{
- LOAD_IMPL(q, ptr);
-}
-
-static inline uint64_t ldn_p(const void *ptr, int sz)
-{
- LOAD_IMPL(n, ptr, sz);
-}
-
-#undef LOAD_IMPL
-
-/* Call st{word}_{le,be}_p following target endianness. */
-#define STORE_IMPL(word, args...) \
-do { \
- if (target_big_endian()) { \
- glue(glue(st, word), _be_p)(args); \
- } else { \
- glue(glue(st, word), _le_p)(args); \
- } \
-} while (0)
-
-
-static inline void stw_p(void *ptr, uint16_t v)
-{
- STORE_IMPL(w, ptr, v);
-}
-
-static inline void stl_p(void *ptr, uint32_t v)
-{
- STORE_IMPL(l, ptr, v);
-}
-
-static inline void stq_p(void *ptr, uint64_t v)
-{
- STORE_IMPL(q, ptr, v);
-}
-
-static inline void stn_p(void *ptr, int sz, uint64_t v)
-{
- STORE_IMPL(n, ptr, sz, v);
-}
-
-#undef STORE_IMPL
-
#endif /* TSWAP_H */
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 9a117645360..39ba64046a6 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -1,6 +1,8 @@
#ifndef BSWAP_H
#define BSWAP_H
+#include "qemu/target-info.h"
+
#undef bswap16
#define bswap16(_x) __builtin_bswap16(_x)
#undef bswap32
@@ -432,4 +434,75 @@ DO_STN_LDN_P(be)
#undef le_bswaps
#undef be_bswaps
+
+/* Return ld{word}_{le,be}_p following target endianness. */
+#define LOAD_IMPL(word, args...) \
+do { \
+ if (target_big_endian()) { \
+ return glue(glue(ld, word), _be_p)(args); \
+ } else { \
+ return glue(glue(ld, word), _le_p)(args); \
+ } \
+} while (0)
+
+static inline int lduw_p(const void *ptr)
+{
+ LOAD_IMPL(uw, ptr);
+}
+
+static inline int ldsw_p(const void *ptr)
+{
+ LOAD_IMPL(sw, ptr);
+}
+
+static inline int ldl_p(const void *ptr)
+{
+ LOAD_IMPL(l, ptr);
+}
+
+static inline uint64_t ldq_p(const void *ptr)
+{
+ LOAD_IMPL(q, ptr);
+}
+
+static inline uint64_t ldn_p(const void *ptr, int sz)
+{
+ LOAD_IMPL(n, ptr, sz);
+}
+
+#undef LOAD_IMPL
+
+/* Call st{word}_{le,be}_p following target endianness. */
+#define STORE_IMPL(word, args...) \
+do { \
+ if (target_big_endian()) { \
+ glue(glue(st, word), _be_p)(args); \
+ } else { \
+ glue(glue(st, word), _le_p)(args); \
+ } \
+} while (0)
+
+
+static inline void stw_p(void *ptr, uint16_t v)
+{
+ STORE_IMPL(w, ptr, v);
+}
+
+static inline void stl_p(void *ptr, uint32_t v)
+{
+ STORE_IMPL(l, ptr, v);
+}
+
+static inline void stq_p(void *ptr, uint64_t v)
+{
+ STORE_IMPL(q, ptr, v);
+}
+
+static inline void stn_p(void *ptr, int sz, uint64_t v)
+{
+ STORE_IMPL(n, ptr, sz, v);
+}
+
+#undef STORE_IMPL
+
#endif /* BSWAP_H */
diff --git a/include/system/memory.h b/include/system/memory.h
index 46248d4a52c..3ba34d49ba3 100644
--- a/include/system/memory.h
+++ b/include/system/memory.h
@@ -19,7 +19,6 @@
#include "exec/memattrs.h"
#include "exec/memop.h"
#include "exec/ramlist.h"
-#include "exec/tswap.h"
#include "qemu/bswap.h"
#include "qemu/queue.h"
#include "qemu/int128.h"
diff --git a/include/user/abitypes.h b/include/user/abitypes.h
index 7528124b62f..be7a8765238 100644
--- a/include/user/abitypes.h
+++ b/include/user/abitypes.h
@@ -6,7 +6,6 @@
#endif
#include "exec/cpu-defs.h"
-#include "exec/tswap.h"
#include "user/tswap-target.h"
#ifdef TARGET_ABI32
diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h
index b8fb12a9705..ae8d4b37aed 100644
--- a/target/ppc/mmu-hash64.h
+++ b/target/ppc/mmu-hash64.h
@@ -1,8 +1,6 @@
#ifndef MMU_HASH64_H
#define MMU_HASH64_H
-#include "exec/tswap.h"
-
#ifndef CONFIG_USER_ONLY
#ifdef TARGET_PPC64
diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
index 108061828b1..c9ffe449aac 100644
--- a/hw/acpi/bios-linker-loader.c
+++ b/hw/acpi/bios-linker-loader.c
@@ -22,8 +22,6 @@
#include "hw/acpi/bios-linker-loader.h"
#include "hw/nvram/fw_cfg.h"
-#include "qemu/bswap.h"
-
/*
* Linker/loader is a paravirtualized interface that passes commands to guest.
* The commands can be used to request guest to
diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
index 0bf700865c2..c8eda39957c 100644
--- a/hw/arm/allwinner-r40.c
+++ b/hw/arm/allwinner-r40.c
@@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
-#include "qemu/bswap.h"
#include "qemu/module.h"
#include "qemu/units.h"
#include "hw/boards.h"
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index becd827af13..d391cd01bb1 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -15,6 +15,7 @@
#include "hw/arm/boot.h"
#include "hw/arm/linux-boot-if.h"
#include "cpu.h"
+#include "exec/tswap.h"
#include "exec/target_page.h"
#include "system/kvm.h"
#include "system/tcg.h"
@@ -29,6 +30,7 @@
#include "qemu/config-file.h"
#include "qemu/option.h"
#include "qemu/units.h"
+#include "qemu/bswap.h"
/* Kernel boot protocol is specified in the kernel docs
* Documentation/arm/Booting and Documentation/arm64/booting.txt
diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c
index 2f30c49df55..ecfae328a96 100644
--- a/hw/arm/npcm7xx.c
+++ b/hw/arm/npcm7xx.c
@@ -24,7 +24,7 @@
#include "hw/qdev-clock.h"
#include "hw/qdev-properties.h"
#include "qapi/error.h"
-#include "qemu/bswap.h"
+#include "exec/tswap.h"
#include "qemu/units.h"
#include "system/system.h"
#include "target/arm/cpu-qom.h"
diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
index f3939e73f42..db221901cf4 100644
--- a/hw/block/hd-geometry.c
+++ b/hw/block/hd-geometry.c
@@ -33,7 +33,6 @@
#include "qemu/osdep.h"
#include "system/block-backend.h"
#include "qapi/qapi-types-block.h"
-#include "qemu/bswap.h"
#include "hw/block/block.h"
#include "trace.h"
diff --git a/hw/char/riscv_htif.c b/hw/char/riscv_htif.c
index c884be5d757..a78ea9b01c0 100644
--- a/hw/char/riscv_htif.c
+++ b/hw/char/riscv_htif.c
@@ -29,7 +29,6 @@
#include "qemu/timer.h"
#include "qemu/error-report.h"
#include "system/address-spaces.h"
-#include "exec/tswap.h"
#include "system/dma.h"
#include "system/runstate.h"
#include "trace.h"
diff --git a/hw/cxl/cxl-events.c b/hw/cxl/cxl-events.c
index 12dee2e4675..f90470930d6 100644
--- a/hw/cxl/cxl-events.c
+++ b/hw/cxl/cxl-events.c
@@ -8,8 +8,6 @@
*/
#include "qemu/osdep.h"
-
-#include "qemu/bswap.h"
#include "qemu/error-report.h"
#include "hw/pci/msi.h"
#include "hw/pci/msix.h"
diff --git a/hw/display/artist.c b/hw/display/artist.c
index 3fafc8a222b..3c884c92437 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -12,6 +12,7 @@
#include "qemu/log.h"
#include "qemu/module.h"
#include "qemu/units.h"
+#include "qemu/bswap.h"
#include "qapi/error.h"
#include "hw/sysbus.h"
#include "hw/loader.h"
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 7de27732cdc..f7c0006a879 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -22,6 +22,7 @@
#include "vga-access.h"
#include "hw/qdev-properties.h"
#include "vga_regs.h"
+#include "qemu/bswap.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "qemu/error-report.h"
diff --git a/hw/net/can/ctucan_core.c b/hw/net/can/ctucan_core.c
index 17131a4e18f..6bd99c477b2 100644
--- a/hw/net/can/ctucan_core.c
+++ b/hw/net/can/ctucan_core.c
@@ -28,7 +28,6 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
-#include "qemu/bswap.h"
#include "qemu/bitops.h"
#include "hw/irq.h"
#include "migration/vmstate.h"
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index 6dda1e5c940..3017e129710 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -21,6 +21,7 @@
#include "hw/ptimer.h"
#include "hw/qdev-properties.h"
#include "qapi/error.h"
+#include "qemu/bswap.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include <zlib.h> /* for crc32 */
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 654a087d80a..324fb932aac 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -57,6 +57,7 @@
#include "system/dma.h"
#include "qemu/module.h"
#include "qemu/timer.h"
+#include "qemu/bswap.h"
#include "net/net.h"
#include "net/eth.h"
#include "system/system.h"
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 7c0ca56b7c0..af73aa8ef28 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -22,7 +22,6 @@
#include "net/tap.h"
#include "net/checksum.h"
#include "system/system.h"
-#include "qemu/bswap.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "hw/pci/msix.h"
diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c
index b12a25696c4..b1d96f62fe9 100644
--- a/hw/pci-host/gt64120.c
+++ b/hw/pci-host/gt64120.c
@@ -28,6 +28,7 @@
#include "qapi/error.h"
#include "qemu/units.h"
#include "qemu/log.h"
+#include "qemu/bswap.h"
#include "hw/qdev-properties.h"
#include "hw/registerfields.h"
#include "hw/pci/pci_device.h"
diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c
index a4335f44f22..5d8383fac30 100644
--- a/hw/pci-host/pnv_phb3.c
+++ b/hw/pci-host/pnv_phb3.c
@@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
#include "qemu/log.h"
+#include "qemu/bswap.h"
#include "qapi/visitor.h"
#include "qapi/error.h"
#include "hw/pci-host/pnv_phb3_regs.h"
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 77ea35299d3..18992054e83 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
#include "qemu/log.h"
+#include "qemu/bswap.h"
#include "qapi/visitor.h"
#include "qapi/error.h"
#include "target/ppc/cpu.h"
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index 52269b05bb1..975d191ccb8 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -20,7 +20,6 @@
#include "migration/vmstate.h"
#include "hw/pci/pci_device.h"
#include "hw/pci/pci_host.h"
-#include "qemu/bswap.h"
#include "hw/pci-host/ppce500.h"
#include "qom/object.h"
diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c
index de8f6a84aab..62fb945075f 100644
--- a/hw/pci-host/sh_pci.c
+++ b/hw/pci-host/sh_pci.c
@@ -28,7 +28,6 @@
#include "hw/irq.h"
#include "hw/pci/pci_device.h"
#include "hw/pci/pci_host.h"
-#include "qemu/bswap.h"
#include "qemu/module.h"
#include "qom/object.h"
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index b5dddb22b84..a3bb5aa2216 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -16,6 +16,7 @@
#include "exec/target_page.h"
#include "system/memory.h"
#include "qemu/error-report.h"
+#include "qemu/bswap.h"
#include "system/hw_accel.h"
#include "hw/boards.h"
#include "hw/pci/pci_device.h"
diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c
index f9e501da840..cd5773ae64e 100644
--- a/hw/sensor/lsm303dlhc_mag.c
+++ b/hw/sensor/lsm303dlhc_mag.c
@@ -28,7 +28,6 @@
#include "qapi/visitor.h"
#include "qemu/module.h"
#include "qemu/log.h"
-#include "qemu/bswap.h"
enum LSM303DLHCMagReg {
LSM303DLHC_MAG_REG_CRA = 0x00,
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index ad4cd6721e6..1ac063cfb4b 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -17,6 +17,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
+#include "qemu/bswap.h"
#include "qapi/error.h"
#include "qemu/config-file.h"
#include "qemu/module.h"
diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c
index 850a3194887..69e57833dbd 100644
--- a/hw/vfio/migration-multifd.c
+++ b/hw/vfio/migration-multifd.c
@@ -13,7 +13,6 @@
#include "hw/vfio/vfio-device.h"
#include "migration/misc.h"
#include "qapi/error.h"
-#include "qemu/bswap.h"
#include "qemu/error-report.h"
#include "qemu/lockable.h"
#include "qemu/main-loop.h"
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index fba2372c93b..767216d7959 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -30,6 +30,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qemu/bswap.h"
#include "hw/pci/msi.h"
#include "hw/pci/msix.h"
#include "hw/loader.h"
diff --git a/hw/vmapple/virtio-blk.c b/hw/vmapple/virtio-blk.c
index 532b5649ab7..9de9aaae0bf 100644
--- a/hw/vmapple/virtio-blk.c
+++ b/hw/vmapple/virtio-blk.c
@@ -19,7 +19,6 @@
#include "hw/vmapple/vmapple.h"
#include "hw/virtio/virtio-blk.h"
#include "hw/virtio/virtio-pci.h"
-#include "qemu/bswap.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "qapi/error.h"
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index ebac86f70d3..baaa13aed6d 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -23,7 +23,6 @@
#include "qemu/timer.h"
#include "qemu/log.h"
#include "exec/page-vary.h"
-#include "exec/tswap.h"
#include "target/arm/idau.h"
#include "qemu/module.h"
#include "qapi/error.h"
diff --git a/target/i386/tcg/system/excp_helper.c b/target/i386/tcg/system/excp_helper.c
index c1626215877..50040f6fcaf 100644
--- a/target/i386/tcg/system/excp_helper.c
+++ b/target/i386/tcg/system/excp_helper.c
@@ -25,7 +25,6 @@
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "exec/tlb-flags.h"
-#include "exec/tswap.h"
#include "tcg/helper-tcg.h"
typedef struct TranslateParams {
diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c
index 24ab7be8e9a..996e9f3bfef 100644
--- a/target/i386/xsave_helper.c
+++ b/target/i386/xsave_helper.c
@@ -5,7 +5,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
-#include "exec/tswap.h"
void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen)
{
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index b41c29da0be..7c67d67a13f 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -27,7 +27,6 @@
#include "exec/helper-proto.h"
#include "exec/tlb-flags.h"
#include "exec/target_page.h"
-#include "exec/tswap.h"
#include "fpu/softfloat.h"
#include "tcg/tcg-gvec-desc.h"
#include "internals.h"
diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c
index ca4e8883dd2..9649bce99ca 100644
--- a/tests/tcg/plugins/mem.c
+++ b/tests/tcg/plugins/mem.c
@@ -20,6 +20,7 @@
* few things provided by compiler.h.
*/
#include <compiler.h>
+#include <stdbool.h>
#include <bswap.h>
#include <qemu-plugin.h>
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h' Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 19:25 ` BALATON Zoltan
2025-07-08 10:17 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
` (7 subsequent siblings)
16 siblings, 2 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Kevin Wolf, Hanna Reitz
Now than various VirtIO files don't use target specific
API anymore, we can move them to the system_ss[] source
set to build them once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/virtio/virtio-config-io.c | 1 -
hw/block/meson.build | 6 ++++--
hw/virtio/meson.build | 20 +++++++++++---------
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c
index ad78e0b9bc5..f58d90b6e31 100644
--- a/hw/virtio/virtio-config-io.c
+++ b/hw/virtio/virtio-config-io.c
@@ -11,7 +11,6 @@
#include "qemu/osdep.h"
#include "hw/virtio/virtio.h"
-#include "cpu.h"
uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr)
{
diff --git a/hw/block/meson.build b/hw/block/meson.build
index 655704471a5..43ed296cf47 100644
--- a/hw/block/meson.build
+++ b/hw/block/meson.build
@@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80_sfdp.c'))
system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
-specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c', 'virtio-blk-common.c'))
-specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c', 'virtio-blk-common.c'))
+specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
+system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-common.c'))
+specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
+system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('virtio-blk-common.c'))
subdir('dataplane')
diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
index 164f6fd995a..3ea7b3cec83 100644
--- a/hw/virtio/meson.build
+++ b/hw/virtio/meson.build
@@ -1,6 +1,7 @@
system_virtio_ss = ss.source_set()
system_virtio_ss.add(files('virtio-bus.c'))
system_virtio_ss.add(files('iothread-vq-mapping.c'))
+system_virtio_ss.add(files('virtio-config-io.c'))
system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c'))
system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c'))
system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c'))
@@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')
specific_virtio_ss = ss.source_set()
specific_virtio_ss.add(files('virtio.c'))
-specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c'))
+specific_virtio_ss.add(files('virtio-qmp.c'))
if have_vhost
system_virtio_ss.add(files('vhost.c'))
- specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
+ system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
if have_vhost_user
# fixme - this really should be generic
specific_virtio_ss.add(files('vhost-user.c'))
@@ -43,22 +44,22 @@ if have_vhost
endif
if have_vhost_vdpa
system_virtio_ss.add(files('vhost-vdpa.c'))
- specific_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
+ system_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
endif
else
system_virtio_ss.add(files('vhost-stub.c'))
endif
+system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
+system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c'))
specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs.c'))
specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem.c'))
specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c'))
-specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
-specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
-specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('virtio-nsm.c', 'cbor-helpers.c'), libcbor])
specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c'))
-specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
-specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SCMI'], if_true: files('vhost-user-scmi-pci.c'))
+system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm.c'))
+system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-helpers.c'), libcbor])
+system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
virtio_pci_ss = ss.source_set()
virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-pci.c'))
@@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk-
virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-user-scsi-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio-input-host-pci.c'))
@@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-pci.c'))
virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.c'))
-specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
+system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 22:59 ` Richard Henderson
2025-07-09 15:36 ` Zhao Liu
2025-07-07 17:20 ` [PATCH-for-10.1 v6 11/14] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces Philippe Mathieu-Daudé
` (6 subsequent siblings)
16 siblings, 2 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
While DEFINE_MACHINE() is a succinct macro, it doesn't
allow registering QOM interfaces to the defined machine.
Convert to the generic DEFINE_TYPES() in preparation to
register interfaces.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/core/null-machine.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index a6e477a2d88..3e03771d570 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -42,8 +42,10 @@ static void machine_none_init(MachineState *mch)
}
}
-static void machine_none_machine_init(MachineClass *mc)
+static void null_machine_class_init(ObjectClass *oc, const void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "empty machine";
mc->init = machine_none_init;
mc->max_cpus = 1;
@@ -55,4 +57,12 @@ static void machine_none_machine_init(MachineClass *mc)
mc->no_cdrom = 1;
}
-DEFINE_MACHINE("none", machine_none_machine_init)
+static const TypeInfo null_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("none"),
+ .parent = TYPE_MACHINE,
+ .class_init = null_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(null_machine_types)
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 11/14] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Philippe Mathieu-Daudé
` (5 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Marc-André Lureau, Daniel P. Berrangé
Define the TYPE_TARGET_ARM_MACHINE and TYPE_TARGET_AARCH64_MACHINE
QOM interface names to allow machines to implement them.
Register these interfaces in common code in target_info-qom.c used
by all binaries because QOM interfaces must be registered before
being checked (see next commit with the 'none' machine).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
meson.build | 1 +
include/hw/arm/machines-qom.h | 18 ++++++++++++++++++
target-info-qom.c | 24 ++++++++++++++++++++++++
3 files changed, 43 insertions(+)
create mode 100644 include/hw/arm/machines-qom.h
create mode 100644 target-info-qom.c
diff --git a/meson.build b/meson.build
index b5f74aa37a7..a6cdccd8094 100644
--- a/meson.build
+++ b/meson.build
@@ -3879,6 +3879,7 @@ common_ss.add(pagevary)
specific_ss.add(files('page-target.c', 'page-vary-target.c'))
common_ss.add(files('target-info.c'))
+system_ss.add(files('target-info-qom.c'))
specific_ss.add(files('target-info-stub.c'))
subdir('backends')
diff --git a/include/hw/arm/machines-qom.h b/include/hw/arm/machines-qom.h
new file mode 100644
index 00000000000..a17225f5f92
--- /dev/null
+++ b/include/hw/arm/machines-qom.h
@@ -0,0 +1,18 @@
+/*
+ * QOM type definitions for ARM / Aarch64 machines
+ *
+ * Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_ARM_MACHINES_QOM_H
+#define HW_ARM_MACHINES_QOM_H
+
+#define TYPE_TARGET_ARM_MACHINE \
+ "target-info-arm-machine"
+
+#define TYPE_TARGET_AARCH64_MACHINE \
+ "target-info-aarch64-machine"
+
+#endif
diff --git a/target-info-qom.c b/target-info-qom.c
new file mode 100644
index 00000000000..7fd58d24818
--- /dev/null
+++ b/target-info-qom.c
@@ -0,0 +1,24 @@
+/*
+ * QEMU binary/target API (QOM types)
+ *
+ * Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qom/object.h"
+#include "hw/arm/machines-qom.h"
+
+static const TypeInfo target_info_types[] = {
+ {
+ .name = TYPE_TARGET_ARM_MACHINE,
+ .parent = TYPE_INTERFACE,
+ },
+ {
+ .name = TYPE_TARGET_AARCH64_MACHINE,
+ .parent = TYPE_INTERFACE,
+ },
+};
+
+DEFINE_TYPES(target_info_types)
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 11/14] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 23:00 ` Richard Henderson
2025-07-07 17:20 ` [PATCH-for-10.1 v6 13/14] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro Philippe Mathieu-Daudé
` (4 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
When we'll start to use target_machine_typename() to filter
machines for the ARM/Aarch64 binaries, the 'none' machine
would be filtered out. Register the proper interfaces to keep
it available.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/core/null-machine.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 3e03771d570..bd3ca6c7719 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -16,6 +16,7 @@
#include "hw/boards.h"
#include "system/address-spaces.h"
#include "hw/core/cpu.h"
+#include "hw/arm/machines-qom.h"
static void machine_none_init(MachineState *mch)
{
@@ -62,6 +63,11 @@ static const TypeInfo null_machine_types[] = {
.name = MACHINE_TYPE_NAME("none"),
.parent = TYPE_MACHINE,
.class_init = null_machine_class_init,
+ .interfaces = (const InterfaceInfo[]) {
+ { TYPE_TARGET_AARCH64_MACHINE },
+ { TYPE_TARGET_ARM_MACHINE },
+ { },
+ },
},
};
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH-for-10.1 v6 13/14] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 14/14] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros Philippe Mathieu-Daudé
` (3 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
DEFINE_MACHINE_WITH_INTERFACES() is similar to DEFINE_MACHINE()
but allows to pass a InterfaceInfo[] pointer.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/hw/boards.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f424b2b5058..91ccb68113c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -761,7 +761,7 @@ struct MachineState {
} \
} while (0)
-#define DEFINE_MACHINE(namestr, machine_initfn) \
+#define DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, ifaces) \
static void machine_initfn##_class_init(ObjectClass *oc, const void *data) \
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
@@ -771,6 +771,7 @@ struct MachineState {
.name = MACHINE_TYPE_NAME(namestr), \
.parent = TYPE_MACHINE, \
.class_init = machine_initfn##_class_init, \
+ .interfaces = ifaces, \
}; \
static void machine_initfn##_register_types(void) \
{ \
@@ -778,6 +779,9 @@ struct MachineState {
} \
type_init(machine_initfn##_register_types)
+#define DEFINE_MACHINE(namestr, machine_initfn) \
+ DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, NULL)
+
extern GlobalProperty hw_compat_10_0[];
extern const size_t hw_compat_10_0_len;
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC PATCH-for-10.1 v6 14/14] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2025-07-07 17:20 ` [PATCH-for-10.1 v6 13/14] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro Philippe Mathieu-Daudé
@ 2025-07-07 17:20 ` Philippe Mathieu-Daudé
2025-07-07 17:55 ` [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Michael S. Tsirkin
` (2 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:20 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Philippe Mathieu-Daudé,
Peter Maydell
A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro
will be available on qemu-system-arm and qemu-system-aarch64
binaries.
One defined with DEFINE_MACHINE_AARCH64() will only be available
in the qemu-system-aarch64 binary.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/arm/machines-qom.h | 13 +++++++++++++
target/arm/machine.c | 12 ++++++++++++
2 files changed, 25 insertions(+)
diff --git a/include/hw/arm/machines-qom.h b/include/hw/arm/machines-qom.h
index a17225f5f92..b71a24ceb95 100644
--- a/include/hw/arm/machines-qom.h
+++ b/include/hw/arm/machines-qom.h
@@ -9,10 +9,23 @@
#ifndef HW_ARM_MACHINES_QOM_H
#define HW_ARM_MACHINES_QOM_H
+#include "hw/boards.h"
+
#define TYPE_TARGET_ARM_MACHINE \
"target-info-arm-machine"
#define TYPE_TARGET_AARCH64_MACHINE \
"target-info-aarch64-machine"
+extern const InterfaceInfo arm_aarch64_machine_interfaces[];
+extern const InterfaceInfo aarch64_machine_interfaces[];
+
+#define DEFINE_MACHINE_ARM_AARCH64(namestr, machine_initfn) \
+ DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, \
+ arm_aarch64_machine_interfaces)
+
+#define DEFINE_MACHINE_AARCH64(namestr, machine_initfn) \
+ DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, \
+ aarch64_machine_interfaces)
+
#endif
diff --git a/target/arm/machine.c b/target/arm/machine.c
index e442d485241..61ad3b681c7 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -9,6 +9,7 @@
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
#include "target/arm/gtimer.h"
+#include "hw/arm/machines-qom.h"
static bool vfp_needed(void *opaque)
{
@@ -1102,3 +1103,14 @@ const VMStateDescription vmstate_arm_cpu = {
NULL
}
};
+
+const InterfaceInfo arm_aarch64_machine_interfaces[] = {
+ { TYPE_TARGET_ARM_MACHINE },
+ { TYPE_TARGET_AARCH64_MACHINE },
+ { }
+};
+
+const InterfaceInfo aarch64_machine_interfaces[] = {
+ { TYPE_TARGET_AARCH64_MACHINE },
+ { }
+};
--
2.49.0
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h'
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h' Philippe Mathieu-Daudé
@ 2025-07-07 17:22 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-07 17:22 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Igor Mammedov, Ani Sinha,
Peter Maydell, Beniamino Galvani, Strahinja Jankovic, Tyrone Ting,
Hao Wu, John Snow, Kevin Wolf, Hanna Reitz, Palmer Dabbelt,
Alistair Francis, Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
Marc-André Lureau, Jonathan Cameron, Fan Ni, Helge Deller,
Pavel Pisa, Francisco Iglesias, Vikram Garhwal, Jason Wang,
Dmitry Fleytman, Aurelien Jarno, Nicholas Piggin,
Frédéric Barrat, Bernhard Beschow, Yoshinori Sato,
Magnus Damm, Matthew Rosato, Eric Farman, Halil Pasic,
Christian Borntraeger, David Hildenbrand, Ilya Leoshkevich,
Thomas Huth, Alex Williamson, Cédric Le Goater,
Alexander Graf, Phil Dennis-Jordan, Peter Xu, Riku Voipio,
Eduardo Habkost, Zhao Liu, Alexandre Iooss, Mahmoud Mandour
On 7/7/25 19:20, Philippe Mathieu-Daudé wrote:
Oops typo "helper" in subject.
> Restrict "exec/tswap.h" to the tswap*() methods,
> move the load/store helpers with the other ones
> declared in "qemu/bswap.h".
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/tswap.h | 70 --------------------------
> include/qemu/bswap.h | 73 ++++++++++++++++++++++++++++
> include/system/memory.h | 1 -
> include/user/abitypes.h | 1 -
> target/ppc/mmu-hash64.h | 2 -
> hw/acpi/bios-linker-loader.c | 2 -
> hw/arm/allwinner-r40.c | 1 -
> hw/arm/boot.c | 2 +
> hw/arm/npcm7xx.c | 2 +-
> hw/block/hd-geometry.c | 1 -
> hw/char/riscv_htif.c | 1 -
> hw/cxl/cxl-events.c | 2 -
> hw/display/artist.c | 1 +
> hw/display/ati.c | 1 +
> hw/net/can/ctucan_core.c | 1 -
> hw/net/lan9118.c | 1 +
> hw/net/rtl8139.c | 1 +
> hw/net/vmxnet3.c | 1 -
> hw/pci-host/gt64120.c | 1 +
> hw/pci-host/pnv_phb3.c | 1 +
> hw/pci-host/pnv_phb4.c | 1 +
> hw/pci-host/ppce500.c | 1 -
> hw/pci-host/sh_pci.c | 1 -
> hw/s390x/s390-pci-inst.c | 1 +
> hw/sensor/lsm303dlhc_mag.c | 1 -
> hw/smbios/smbios.c | 1 +
> hw/vfio/migration-multifd.c | 1 -
> hw/virtio/virtio-pci.c | 1 +
> hw/vmapple/virtio-blk.c | 1 -
> target/arm/cpu.c | 1 -
> target/i386/tcg/system/excp_helper.c | 1 -
> target/i386/xsave_helper.c | 1 -
> target/riscv/vector_helper.c | 1 -
> tests/tcg/plugins/mem.c | 1 +
> 34 files changed, 87 insertions(+), 93 deletions(-)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (13 preceding siblings ...)
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 14/14] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros Philippe Mathieu-Daudé
@ 2025-07-07 17:55 ` Michael S. Tsirkin
2025-07-08 10:15 ` Alex Bennée
2025-07-08 10:27 ` Philippe Mathieu-Daudé
2025-07-07 19:28 ` BALATON Zoltan
2025-07-08 17:10 ` Philippe Mathieu-Daudé
16 siblings, 2 replies; 30+ messages in thread
From: Michael S. Tsirkin @ 2025-07-07 17:55 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv
On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.
I think I'd prefer to defer cleanups to post 10.1 - already
too much on my plate as I was out sick. Unless there's a reason
I'm missing to rush this in? Is there a feature we want in
10.1 that depends on it?
> Philippe Mathieu-Daudé (14):
> target/qmp: Use target_cpu_type()
> qemu/target-info: Factor target_arch() out
> qemu/target-info: Add %target_arch field to TargetInfo
> qemu/target-info: Introduce target_base_arch()
> qemu/target-info: Add target_endian_mode()
> qemu: Convert target_words_bigendian() to TargetInfo API
> gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
> qemu: Declare all load/store helpert in 'qemu/bswap.h'
> hw/virtio: Build various files once
> hw/core/null-machine: Define machine as generic QOM type
> hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
> hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
> hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
> hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
>
> meson.build | 1 +
> include/exec/tswap.h | 83 +--------------------------
> include/gdbstub/helpers.h | 15 ++---
> include/hw/arm/machines-qom.h | 31 ++++++++++
> include/hw/boards.h | 6 +-
> include/qemu/bswap.h | 73 +++++++++++++++++++++++
> include/qemu/target-info-impl.h | 8 ++-
> include/qemu/target-info-qapi.h | 36 ++++++++++++
> include/qemu/target-info.h | 10 +++-
> include/system/memory.h | 1 -
> include/user/abitypes.h | 1 -
> target/ppc/mmu-hash64.h | 2 -
> cpu-target.c | 7 ---
> hw/acpi/bios-linker-loader.c | 2 -
> hw/arm/allwinner-r40.c | 1 -
> hw/arm/boot.c | 2 +
> hw/arm/npcm7xx.c | 2 +-
> hw/block/hd-geometry.c | 1 -
> hw/char/riscv_htif.c | 1 -
> hw/core/cpu-system.c | 2 +-
> hw/core/machine-qmp-cmds.c | 8 +--
> hw/core/null-machine.c | 20 ++++++-
> hw/cxl/cxl-events.c | 2 -
> hw/display/artist.c | 1 +
> hw/display/ati.c | 1 +
> hw/display/vga.c | 2 +-
> hw/net/can/ctucan_core.c | 1 -
> hw/net/lan9118.c | 1 +
> hw/net/rtl8139.c | 1 +
> hw/net/vmxnet3.c | 1 -
> hw/pci-host/gt64120.c | 1 +
> hw/pci-host/pnv_phb3.c | 1 +
> hw/pci-host/pnv_phb4.c | 1 +
> hw/pci-host/ppce500.c | 1 -
> hw/pci-host/sh_pci.c | 1 -
> hw/s390x/s390-pci-inst.c | 1 +
> hw/sensor/lsm303dlhc_mag.c | 1 -
> hw/smbios/smbios.c | 1 +
> hw/vfio/migration-multifd.c | 1 -
> hw/virtio/virtio-config-io.c | 1 -
> hw/virtio/virtio-pci.c | 1 +
> hw/virtio/virtio.c | 2 +-
> hw/vmapple/virtio-blk.c | 1 -
> system/memory.c | 1 +
> system/qtest.c | 1 +
> target-info-qom.c | 24 ++++++++
> target-info-stub.c | 3 +
> target-info.c | 33 +++++++++++
> target/arm/arm-qmp-cmds.c | 3 +-
> target/arm/cpu.c | 1 -
> target/arm/machine.c | 12 ++++
> target/i386/tcg/system/excp_helper.c | 1 -
> target/i386/xsave_helper.c | 1 -
> target/loongarch/loongarch-qmp-cmds.c | 3 +-
> target/mips/system/mips-qmp-cmds.c | 3 +-
> target/riscv/vector_helper.c | 1 -
> tests/tcg/plugins/mem.c | 1 +
> hw/block/meson.build | 6 +-
> hw/virtio/meson.build | 20 ++++---
> 59 files changed, 302 insertions(+), 149 deletions(-)
> create mode 100644 include/hw/arm/machines-qom.h
> create mode 100644 include/qemu/target-info-qapi.h
> create mode 100644 target-info-qom.c
>
> --
> 2.49.0
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once
2025-07-07 17:20 ` [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Philippe Mathieu-Daudé
@ 2025-07-07 19:25 ` BALATON Zoltan
2025-07-08 10:17 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2025-07-07 19:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Michael S. Tsirkin, qemu-s390x, qemu-arm,
Alex Bennée, Pierrick Bouvier, qemu-block, Richard Henderson,
qemu-ppc, Paolo Bonzini, qemu-riscv, Kevin Wolf, Hanna Reitz
[-- Attachment #1: Type: text/plain, Size: 129 bytes --]
On Mon, 7 Jul 2025, Philippe Mathieu-Daudé wrote:
> Now than various VirtIO files don't use target specific
Typo: than -> that.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (14 preceding siblings ...)
2025-07-07 17:55 ` [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Michael S. Tsirkin
@ 2025-07-07 19:28 ` BALATON Zoltan
2025-07-08 17:10 ` Philippe Mathieu-Daudé
16 siblings, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2025-07-07 19:28 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Michael S. Tsirkin, qemu-s390x, qemu-arm,
Alex Bennée, Pierrick Bouvier, qemu-block, Richard Henderson,
qemu-ppc, Paolo Bonzini, qemu-riscv
[-- Attachment #1: Type: text/plain, Size: 4601 bytes --]
On Mon, 7 Jul 2025, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.
I've sent the patch here:
https://patchew.org/QEMU/cover.1751494995.git.balaton@eik.bme.hu/3c2aa5b895adbb5244b643a6672603d65dce4298.1751494995.git.balaton@eik.bme.hu/
that will hopefully be merged before the freeze so you can rebase on that.
Regards,
BALATON Zoltan
> Philippe Mathieu-Daudé (14):
> target/qmp: Use target_cpu_type()
> qemu/target-info: Factor target_arch() out
> qemu/target-info: Add %target_arch field to TargetInfo
> qemu/target-info: Introduce target_base_arch()
> qemu/target-info: Add target_endian_mode()
> qemu: Convert target_words_bigendian() to TargetInfo API
> gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
> qemu: Declare all load/store helpert in 'qemu/bswap.h'
> hw/virtio: Build various files once
> hw/core/null-machine: Define machine as generic QOM type
> hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
> hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
> hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
> hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
>
> meson.build | 1 +
> include/exec/tswap.h | 83 +--------------------------
> include/gdbstub/helpers.h | 15 ++---
> include/hw/arm/machines-qom.h | 31 ++++++++++
> include/hw/boards.h | 6 +-
> include/qemu/bswap.h | 73 +++++++++++++++++++++++
> include/qemu/target-info-impl.h | 8 ++-
> include/qemu/target-info-qapi.h | 36 ++++++++++++
> include/qemu/target-info.h | 10 +++-
> include/system/memory.h | 1 -
> include/user/abitypes.h | 1 -
> target/ppc/mmu-hash64.h | 2 -
> cpu-target.c | 7 ---
> hw/acpi/bios-linker-loader.c | 2 -
> hw/arm/allwinner-r40.c | 1 -
> hw/arm/boot.c | 2 +
> hw/arm/npcm7xx.c | 2 +-
> hw/block/hd-geometry.c | 1 -
> hw/char/riscv_htif.c | 1 -
> hw/core/cpu-system.c | 2 +-
> hw/core/machine-qmp-cmds.c | 8 +--
> hw/core/null-machine.c | 20 ++++++-
> hw/cxl/cxl-events.c | 2 -
> hw/display/artist.c | 1 +
> hw/display/ati.c | 1 +
> hw/display/vga.c | 2 +-
> hw/net/can/ctucan_core.c | 1 -
> hw/net/lan9118.c | 1 +
> hw/net/rtl8139.c | 1 +
> hw/net/vmxnet3.c | 1 -
> hw/pci-host/gt64120.c | 1 +
> hw/pci-host/pnv_phb3.c | 1 +
> hw/pci-host/pnv_phb4.c | 1 +
> hw/pci-host/ppce500.c | 1 -
> hw/pci-host/sh_pci.c | 1 -
> hw/s390x/s390-pci-inst.c | 1 +
> hw/sensor/lsm303dlhc_mag.c | 1 -
> hw/smbios/smbios.c | 1 +
> hw/vfio/migration-multifd.c | 1 -
> hw/virtio/virtio-config-io.c | 1 -
> hw/virtio/virtio-pci.c | 1 +
> hw/virtio/virtio.c | 2 +-
> hw/vmapple/virtio-blk.c | 1 -
> system/memory.c | 1 +
> system/qtest.c | 1 +
> target-info-qom.c | 24 ++++++++
> target-info-stub.c | 3 +
> target-info.c | 33 +++++++++++
> target/arm/arm-qmp-cmds.c | 3 +-
> target/arm/cpu.c | 1 -
> target/arm/machine.c | 12 ++++
> target/i386/tcg/system/excp_helper.c | 1 -
> target/i386/xsave_helper.c | 1 -
> target/loongarch/loongarch-qmp-cmds.c | 3 +-
> target/mips/system/mips-qmp-cmds.c | 3 +-
> target/riscv/vector_helper.c | 1 -
> tests/tcg/plugins/mem.c | 1 +
> hw/block/meson.build | 6 +-
> hw/virtio/meson.build | 20 ++++---
> 59 files changed, 302 insertions(+), 149 deletions(-)
> create mode 100644 include/hw/arm/machines-qom.h
> create mode 100644 include/qemu/target-info-qapi.h
> create mode 100644 target-info-qom.c
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type()
2025-07-07 17:19 ` [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Philippe Mathieu-Daudé
@ 2025-07-07 20:05 ` Richard Henderson
0 siblings, 0 replies; 30+ messages in thread
From: Richard Henderson @ 2025-07-07 20:05 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, qemu-ppc, Paolo Bonzini, qemu-riscv,
Peter Maydell, Song Gao, Huacai Chen, Aurelien Jarno, Jiaxun Yang,
Aleksandar Rikalo
On 7/7/25 11:19, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> target/arm/arm-qmp-cmds.c | 3 ++-
> target/loongarch/loongarch-qmp-cmds.c | 3 ++-
> target/mips/system/mips-qmp-cmds.c | 3 ++-
> 3 files changed, 6 insertions(+), 3 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out
2025-07-07 17:19 ` [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Philippe Mathieu-Daudé
@ 2025-07-07 20:06 ` Richard Henderson
2025-07-09 15:24 ` Zhao Liu
1 sibling, 0 replies; 30+ messages in thread
From: Richard Henderson @ 2025-07-07 20:06 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, qemu-ppc, Paolo Bonzini, qemu-riscv,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
On 7/7/25 11:19, Philippe Mathieu-Daudé wrote:
> To keep "qemu/target-info.h" self-contained to native
> types, declare target_arch() -- which returns a QAPI
> type -- in "qemu/target-info-qapi.h".
>
> No logical change.
>
> Keeping native types in "qemu/target-info.h" is necessary
> to keep building tests such tests/tcg/plugins/mem.c, as
> per the comment added in commit ecbcc9ead2f ("tests/tcg:
> add a system test to check memory instrumentation"):
>
> /*
> * plugins should not include anything from QEMU aside from the
> * API header. However as this is a test plugin to exercise the
> * internals of QEMU and we want to avoid needless code duplication we
> * do so here. bswap.h is pretty self-contained although it needs a
> * few things provided by compiler.h.
> */
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> include/qemu/target-info-qapi.h | 21 +++++++++++++++++++++
> include/qemu/target-info.h | 2 +-
> hw/core/machine-qmp-cmds.c | 8 +++-----
> target-info.c | 8 ++++++++
> 4 files changed, 33 insertions(+), 6 deletions(-)
> create mode 100644 include/qemu/target-info-qapi.h
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type
2025-07-07 17:20 ` [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
@ 2025-07-07 22:59 ` Richard Henderson
2025-07-09 15:36 ` Zhao Liu
1 sibling, 0 replies; 30+ messages in thread
From: Richard Henderson @ 2025-07-07 22:59 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, qemu-ppc, Paolo Bonzini, qemu-riscv,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
On 7/7/25 11:20, Philippe Mathieu-Daudé wrote:
> While DEFINE_MACHINE() is a succinct macro, it doesn't
> allow registering QOM interfaces to the defined machine.
> Convert to the generic DEFINE_TYPES() in preparation to
> register interfaces.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> hw/core/null-machine.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
> index a6e477a2d88..3e03771d570 100644
> --- a/hw/core/null-machine.c
> +++ b/hw/core/null-machine.c
> @@ -42,8 +42,10 @@ static void machine_none_init(MachineState *mch)
> }
> }
>
> -static void machine_none_machine_init(MachineClass *mc)
> +static void null_machine_class_init(ObjectClass *oc, const void *data)
> {
> + MachineClass *mc = MACHINE_CLASS(oc);
> +
> mc->desc = "empty machine";
> mc->init = machine_none_init;
> mc->max_cpus = 1;
> @@ -55,4 +57,12 @@ static void machine_none_machine_init(MachineClass *mc)
> mc->no_cdrom = 1;
> }
>
> -DEFINE_MACHINE("none", machine_none_machine_init)
> +static const TypeInfo null_machine_types[] = {
> + {
> + .name = MACHINE_TYPE_NAME("none"),
> + .parent = TYPE_MACHINE,
> + .class_init = null_machine_class_init,
> + },
> +};
> +
> +DEFINE_TYPES(null_machine_types)
Ought this use DEFINE_MACHINE_WITH_INTERFACES that you introduce later?
r~
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
2025-07-07 17:20 ` [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Philippe Mathieu-Daudé
@ 2025-07-07 23:00 ` Richard Henderson
0 siblings, 0 replies; 30+ messages in thread
From: Richard Henderson @ 2025-07-07 23:00 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, qemu-ppc, Paolo Bonzini, qemu-riscv,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu
On 7/7/25 11:20, Philippe Mathieu-Daudé wrote:
> When we'll start to use target_machine_typename() to filter
> machines for the ARM/Aarch64 binaries, the 'none' machine
> would be filtered out. Register the proper interfaces to keep
> it available.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> hw/core/null-machine.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
> index 3e03771d570..bd3ca6c7719 100644
> --- a/hw/core/null-machine.c
> +++ b/hw/core/null-machine.c
> @@ -16,6 +16,7 @@
> #include "hw/boards.h"
> #include "system/address-spaces.h"
> #include "hw/core/cpu.h"
> +#include "hw/arm/machines-qom.h"
>
> static void machine_none_init(MachineState *mch)
> {
> @@ -62,6 +63,11 @@ static const TypeInfo null_machine_types[] = {
> .name = MACHINE_TYPE_NAME("none"),
> .parent = TYPE_MACHINE,
> .class_init = null_machine_class_init,
> + .interfaces = (const InterfaceInfo[]) {
> + { TYPE_TARGET_AARCH64_MACHINE },
> + { TYPE_TARGET_ARM_MACHINE },
> + { },
> + },
> },
> };
>
Ought this use DEFINE_MACHINE_WITH_INTERFACES?
r~
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
2025-07-07 17:55 ` [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Michael S. Tsirkin
@ 2025-07-08 10:15 ` Alex Bennée
2025-07-08 10:27 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 30+ messages in thread
From: Alex Bennée @ 2025-07-08 10:15 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-s390x, qemu-arm,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv
"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
>> Rather than re-spinning the whole "single-binary: Make hw/arm/
>> common" series, restrict to the API additions, but include
>> examples of their usefulness (hundreds of virtio objects
>> removed from default Linux build).
>> Time passed since I context-switched out of this work so I'm
>> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
>> is in the form Zoltan asked.
>
> I think I'd prefer to defer cleanups to post 10.1 - already
> too much on my plate as I was out sick. Unless there's a reason
> I'm missing to rush this in? Is there a feature we want in
> 10.1 that depends on it?
This is all part of reducing the number of duplicate builds of device
models which after the stubs VirtIO is the main remaining sub-system due
for clean-up:
➜ ./.gitlab-ci.d/check-units.py ./builds/system/compile_commands.json -n 80
Total source files: 3595
Total build units: 5658
Most rebuilt units:
../../dump/win_dump.c built 29 times
../../cpu-target.c built 29 times
../../system/arch_init.c built 29 times
../../system/globals-target.c built 29 times
../../page-target.c built 29 times
../../page-vary-target.c built 29 times
../../target-info-stub.c built 29 times
../../migration/ram.c built 29 times
../../migration/target.c built 29 times
../../monitor/hmp-cmds-target.c built 29 times
../../monitor/hmp-target.c built 29 times
../../accel/accel-target.c built 29 times
../../accel/stubs/hvf-stub.c built 29 times
../../accel/stubs/nvmm-stub.c built 29 times
../../accel/stubs/whpx-stub.c built 29 times
../../accel/qtest/qtest.c built 29 times
../../system/main.c built 29 times
../../hw/i386/kvm/xen-stubs.c built 27 times
../../accel/stubs/xen-stub.c built 27 times
../../accel/stubs/kvm-stub.c built 27 times
../../hw/9pfs/virtio-9p-device.c built 23 times
../../hw/block/virtio-blk.c built 23 times
../../hw/block/virtio-blk-common.c built 23 times
../../hw/char/virtio-serial-bus.c built 23 times
../../hw/net/virtio-net.c built 23 times
../../hw/scsi/virtio-scsi.c built 23 times
../../hw/scsi/vhost-scsi-common.c built 23 times
../../hw/virtio/virtio.c built 23 times
../../hw/virtio/virtio-config-io.c built 23 times
../../hw/virtio/virtio-qmp.c built 23 times
../../hw/virtio/vhost-backend.c built 23 times
../../hw/virtio/vhost-iova-tree.c built 23 times
../../hw/virtio/vhost-user.c built 23 times
../../hw/virtio/vhost-shadow-virtqueue.c built 23 times
../../hw/virtio/virtio-balloon.c built 23 times
../../hw/virtio/vhost-user-fs.c built 23 times
../../hw/virtio/vhost-vsock.c built 23 times
../../hw/virtio/vhost-user-vsock.c built 23 times
../../hw/virtio/virtio-rng.c built 23 times
../../hw/block/vhost-user-blk.c built 22 times
../../hw/vfio/listener.c built 22 times
../../hw/vfio/container-base.c built 22 times
../../hw/vfio/container.c built 22 times
../../hw/vfio/helpers.c built 22 times
../../hw/vfio/pci-quirks.c built 22 times
../../hw/vfio/pci.c built 22 times
../../hw/virtio/vhost-vsock-pci.c built 22 times
../../hw/virtio/vhost-user-vsock-pci.c built 22 times
../../hw/virtio/vhost-user-blk-pci.c built 22 times
../../hw/virtio/vhost-user-scsi-pci.c built 22 times
../../hw/virtio/vhost-scsi-pci.c built 22 times
../../hw/virtio/vhost-user-fs-pci.c built 22 times
../../hw/virtio/virtio-crypto-pci.c built 22 times
../../hw/virtio/virtio-input-host-pci.c built 22 times
../../hw/virtio/virtio-input-pci.c built 22 times
../../hw/virtio/virtio-rng-pci.c built 22 times
../../hw/virtio/virtio-balloon-pci.c built 22 times
../../hw/virtio/virtio-9p-pci.c built 22 times
../../hw/virtio/virtio-scsi-pci.c built 22 times
../../hw/virtio/virtio-blk-pci.c built 22 times
../../hw/virtio/virtio-net-pci.c built 22 times
../../hw/virtio/virtio-serial-pci.c built 22 times
../../hw/virtio/virtio-iommu-pci.c built 22 times
../../hw/virtio/vdpa-dev-pci.c built 22 times
../../tests/unit/iothread.c built 16 times
../../hw/nvram/fw_cfg-acpi.c built 13 times
../../semihosting/guestfd.c built 11 times
../../semihosting/syscalls.c built 11 times
../../tests/qtest/tpm-emu.c built 8 times
../../hw/vfio/platform.c built 7 times
../../tests/qtest/tpm-util.c built 7 times
../../tests/qtest/tpm-tests.c built 7 times
../../hw/virtio/virtio-mem.c built 5 times
../../hw/virtio/virtio-mem-pci.c built 5 times
../../hw/virtio/virtio-md-pci.c built 5 times
../../tests/unit/socket-helpers.c built 5 times
../../tests/unit/io-channel-helpers.c built 5 times
../../fpu/softfloat.c built 4 times
../../semihosting/arm-compat-semi.c built 4 times
../../target/mips/system/addr.c built 4 times
Aside from reducing build times and overall load on the CI systems its
required to advance the single-binary QEMU build and get us closer to
being able to do proper heterogeneous emulation.
I don't think missing 10.1 would be critical for the single binary proof
of concept but obviously as with all changes that touch the whole code
base the longer the review takes the more time they spend in re-base
hell.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once
2025-07-07 17:20 ` [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Philippe Mathieu-Daudé
2025-07-07 19:25 ` BALATON Zoltan
@ 2025-07-08 10:17 ` Philippe Mathieu-Daudé
2025-07-08 12:47 ` Manos Pitsidianakis
1 sibling, 1 reply; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-08 10:17 UTC (permalink / raw)
To: qemu-devel, Manos Pitsidianakis
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv, Kevin Wolf, Hanna Reitz
(Forgot to Cc Manos)
On 7/7/25 19:20, Philippe Mathieu-Daudé wrote:
> Now than various VirtIO files don't use target specific
> API anymore, we can move them to the system_ss[] source
> set to build them once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/virtio/virtio-config-io.c | 1 -
> hw/block/meson.build | 6 ++++--
> hw/virtio/meson.build | 20 +++++++++++---------
> 3 files changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c
> index ad78e0b9bc5..f58d90b6e31 100644
> --- a/hw/virtio/virtio-config-io.c
> +++ b/hw/virtio/virtio-config-io.c
> @@ -11,7 +11,6 @@
>
> #include "qemu/osdep.h"
> #include "hw/virtio/virtio.h"
> -#include "cpu.h"
>
> uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr)
> {
> diff --git a/hw/block/meson.build b/hw/block/meson.build
> index 655704471a5..43ed296cf47 100644
> --- a/hw/block/meson.build
> +++ b/hw/block/meson.build
> @@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80_sfdp.c'))
> system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
> system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
>
> -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c', 'virtio-blk-common.c'))
> -specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c', 'virtio-blk-common.c'))
> +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> +system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-common.c'))
> +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
> +system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('virtio-blk-common.c'))
>
> subdir('dataplane')
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index 164f6fd995a..3ea7b3cec83 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -1,6 +1,7 @@
> system_virtio_ss = ss.source_set()
> system_virtio_ss.add(files('virtio-bus.c'))
> system_virtio_ss.add(files('iothread-vq-mapping.c'))
> +system_virtio_ss.add(files('virtio-config-io.c'))
> system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c'))
> system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c'))
> system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c'))
> @@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')
>
> specific_virtio_ss = ss.source_set()
> specific_virtio_ss.add(files('virtio.c'))
> -specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c'))
> +specific_virtio_ss.add(files('virtio-qmp.c'))
>
> if have_vhost
> system_virtio_ss.add(files('vhost.c'))
> - specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> + system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> if have_vhost_user
> # fixme - this really should be generic
> specific_virtio_ss.add(files('vhost-user.c'))
> @@ -43,22 +44,22 @@ if have_vhost
> endif
> if have_vhost_vdpa
> system_virtio_ss.add(files('vhost-vdpa.c'))
> - specific_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> + system_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> endif
> else
> system_virtio_ss.add(files('vhost-stub.c'))
> endif
> +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
> +system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
>
> specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c'))
> specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs.c'))
> specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem.c'))
> specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c'))
> -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
> -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
> -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('virtio-nsm.c', 'cbor-helpers.c'), libcbor])
> specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c'))
> -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
> -specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SCMI'], if_true: files('vhost-user-scmi-pci.c'))
> +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm.c'))
> +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-helpers.c'), libcbor])
> +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
>
> virtio_pci_ss = ss.source_set()
> virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-pci.c'))
> @@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk-
> virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-user-scsi-pci.c'))
> virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pci.c'))
> virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs-pci.c'))
> +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi-pci.c'))
>
> virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto-pci.c'))
> virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio-input-host-pci.c'))
> @@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem-pci.c'))
> virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-pci.c'))
> virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.c'))
>
> -specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
> +system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
>
> system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
> system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
2025-07-07 17:55 ` [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Michael S. Tsirkin
2025-07-08 10:15 ` Alex Bennée
@ 2025-07-08 10:27 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-08 10:27 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: qemu-devel, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv
On 7/7/25 19:55, Michael S. Tsirkin wrote:
> On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
>> Rather than re-spinning the whole "single-binary: Make hw/arm/
>> common" series, restrict to the API additions, but include
>> examples of their usefulness (hundreds of virtio objects
>> removed from default Linux build).
>> Time passed since I context-switched out of this work so I'm
>> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
>> is in the form Zoltan asked.
>
>
> I think I'd prefer to defer cleanups to post 10.1 - already
> too much on my plate as I was out sick. Unless there's a reason
> I'm missing to rush this in? Is there a feature we want in
> 10.1 that depends on it?
Fair enough for the virtio patch.
Hopefully the previous ones (TargetInfo related, not touching
virtio) could get in (you don't have to look a them ;P).
>
>> Philippe Mathieu-Daudé (14):
>> target/qmp: Use target_cpu_type()
>> qemu/target-info: Factor target_arch() out
>> qemu/target-info: Add %target_arch field to TargetInfo
>> qemu/target-info: Introduce target_base_arch()
>> qemu/target-info: Add target_endian_mode()
>> qemu: Convert target_words_bigendian() to TargetInfo API
>> gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
>> qemu: Declare all load/store helpert in 'qemu/bswap.h'
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once
2025-07-08 10:17 ` Philippe Mathieu-Daudé
@ 2025-07-08 12:47 ` Manos Pitsidianakis
0 siblings, 0 replies; 30+ messages in thread
From: Manos Pitsidianakis @ 2025-07-08 12:47 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Michael S. Tsirkin, qemu-s390x, qemu-arm,
Alex Bennée, Pierrick Bouvier, qemu-block, Richard Henderson,
qemu-ppc, Paolo Bonzini, qemu-riscv, Kevin Wolf, Hanna Reitz
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
On Tue, Jul 8, 2025 at 1:17 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> (Forgot to Cc Manos)
>
> On 7/7/25 19:20, Philippe Mathieu-Daudé wrote:
> > Now than various VirtIO files don't use target specific
> > API anymore, we can move them to the system_ss[] source
> > set to build them once.
> >
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> > hw/virtio/virtio-config-io.c | 1 -
> > hw/block/meson.build | 6 ++++--
> > hw/virtio/meson.build | 20 +++++++++++---------
> > 3 files changed, 15 insertions(+), 12 deletions(-)
> >
> > diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c
> > index ad78e0b9bc5..f58d90b6e31 100644
> > --- a/hw/virtio/virtio-config-io.c
> > +++ b/hw/virtio/virtio-config-io.c
> > @@ -11,7 +11,6 @@
> >
> > #include "qemu/osdep.h"
> > #include "hw/virtio/virtio.h"
> > -#include "cpu.h"
> >
> > uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr)
> > {
> > diff --git a/hw/block/meson.build b/hw/block/meson.build
> > index 655704471a5..43ed296cf47 100644
> > --- a/hw/block/meson.build
> > +++ b/hw/block/meson.build
> > @@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80_sfdp.c'))
> > system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
> > system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
> >
> > -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c', 'virtio-blk-common.c'))
> > -specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c', 'virtio-blk-common.c'))
> > +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> > +system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-common.c'))
> > +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
> > +system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('virtio-blk-common.c'))
> >
> > subdir('dataplane')
> > diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> > index 164f6fd995a..3ea7b3cec83 100644
> > --- a/hw/virtio/meson.build
> > +++ b/hw/virtio/meson.build
> > @@ -1,6 +1,7 @@
> > system_virtio_ss = ss.source_set()
> > system_virtio_ss.add(files('virtio-bus.c'))
> > system_virtio_ss.add(files('iothread-vq-mapping.c'))
> > +system_virtio_ss.add(files('virtio-config-io.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c'))
> > @@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')
> >
> > specific_virtio_ss = ss.source_set()
> > specific_virtio_ss.add(files('virtio.c'))
> > -specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c'))
> > +specific_virtio_ss.add(files('virtio-qmp.c'))
> >
> > if have_vhost
> > system_virtio_ss.add(files('vhost.c'))
> > - specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> > + system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> > if have_vhost_user
> > # fixme - this really should be generic
> > specific_virtio_ss.add(files('vhost-user.c'))
> > @@ -43,22 +44,22 @@ if have_vhost
> > endif
> > if have_vhost_vdpa
> > system_virtio_ss.add(files('vhost-vdpa.c'))
> > - specific_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> > + system_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> > endif
> > else
> > system_virtio_ss.add(files('vhost-stub.c'))
> > endif
> > +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
> >
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('virtio-nsm.c', 'cbor-helpers.c'), libcbor])
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
> > -specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SCMI'], if_true: files('vhost-user-scmi-pci.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-helpers.c'), libcbor])
> > +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi.c'))
> >
> > virtio_pci_ss = ss.source_set()
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-pci.c'))
> > @@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk-
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-user-scsi-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs-pci.c'))
> > +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-user-scmi-pci.c'))
> >
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio-input-host-pci.c'))
> > @@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.c'))
> >
> > -specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
> > +system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
> >
> > system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
> > system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
` (15 preceding siblings ...)
2025-07-07 19:28 ` BALATON Zoltan
@ 2025-07-08 17:10 ` Philippe Mathieu-Daudé
16 siblings, 0 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-08 17:10 UTC (permalink / raw)
To: qemu-devel
Cc: Michael S. Tsirkin, qemu-s390x, qemu-arm, Alex Bennée,
Pierrick Bouvier, qemu-block, Richard Henderson, qemu-ppc,
Paolo Bonzini, qemu-riscv
On 7/7/25 19:19, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.
>
> Philippe Mathieu-Daudé (14):
> target/qmp: Use target_cpu_type()
> qemu/target-info: Factor target_arch() out
> qemu/target-info: Add %target_arch field to TargetInfo
> qemu/target-info: Introduce target_base_arch()
> qemu/target-info: Add target_endian_mode()
> qemu: Convert target_words_bigendian() to TargetInfo API
> gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
> qemu: Declare all load/store helpert in 'qemu/bswap.h'
> hw/virtio: Build various files once
Sorry, I cut this branch incorrectly, I should have posted only up
to here, as the rest isn't required. I'll respin for clarity.
> hw/core/null-machine: Define machine as generic QOM type
> hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
> hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
> hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
> hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out
2025-07-07 17:19 ` [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Philippe Mathieu-Daudé
2025-07-07 20:06 ` Richard Henderson
@ 2025-07-09 15:24 ` Zhao Liu
1 sibling, 0 replies; 30+ messages in thread
From: Zhao Liu @ 2025-07-09 15:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Michael S. Tsirkin, qemu-s390x, qemu-arm,
Alex Bennée, Pierrick Bouvier, qemu-block, Richard Henderson,
qemu-ppc, Paolo Bonzini, qemu-riscv, Eduardo Habkost,
Marcel Apfelbaum, Yanan Wang
On Mon, Jul 07, 2025 at 07:19:56PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Mon, 7 Jul 2025 19:19:56 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch()
> out
> X-Mailer: git-send-email 2.49.0
>
> To keep "qemu/target-info.h" self-contained to native
> types, declare target_arch() -- which returns a QAPI
> type -- in "qemu/target-info-qapi.h".
>
> No logical change.
>
> Keeping native types in "qemu/target-info.h" is necessary
> to keep building tests such tests/tcg/plugins/mem.c, as
> per the comment added in commit ecbcc9ead2f ("tests/tcg:
> add a system test to check memory instrumentation"):
>
> /*
> * plugins should not include anything from QEMU aside from the
> * API header. However as this is a test plugin to exercise the
> * internals of QEMU and we want to avoid needless code duplication we
> * do so here. bswap.h is pretty self-contained although it needs a
> * few things provided by compiler.h.
> */
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/qemu/target-info-qapi.h | 21 +++++++++++++++++++++
> include/qemu/target-info.h | 2 +-
> hw/core/machine-qmp-cmds.c | 8 +++-----
> target-info.c | 8 ++++++++
> 4 files changed, 33 insertions(+), 6 deletions(-)
> create mode 100644 include/qemu/target-info-qapi.h
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type
2025-07-07 17:20 ` [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
2025-07-07 22:59 ` Richard Henderson
@ 2025-07-09 15:36 ` Zhao Liu
1 sibling, 0 replies; 30+ messages in thread
From: Zhao Liu @ 2025-07-09 15:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Michael S. Tsirkin, qemu-s390x, qemu-arm,
Alex Bennée, Pierrick Bouvier, qemu-block, Richard Henderson,
qemu-ppc, Paolo Bonzini, qemu-riscv, Eduardo Habkost,
Marcel Apfelbaum, Yanan Wang
On Mon, Jul 07, 2025 at 07:20:04PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Mon, 7 Jul 2025 19:20:04 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as
> generic QOM type
> X-Mailer: git-send-email 2.49.0
>
> While DEFINE_MACHINE() is a succinct macro, it doesn't
> allow registering QOM interfaces to the defined machine.
> Convert to the generic DEFINE_TYPES() in preparation to
> register interfaces.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> hw/core/null-machine.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2025-07-09 15:17 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 17:19 [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Philippe Mathieu-Daudé
2025-07-07 20:05 ` Richard Henderson
2025-07-07 17:19 ` [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Philippe Mathieu-Daudé
2025-07-07 20:06 ` Richard Henderson
2025-07-09 15:24 ` Zhao Liu
2025-07-07 17:19 ` [PATCH-for-10.1 v6 03/14] qemu/target-info: Add %target_arch field to TargetInfo Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 04/14] qemu/target-info: Introduce target_base_arch() Philippe Mathieu-Daudé
2025-07-07 17:19 ` [PATCH-for-10.1 v6 05/14] qemu/target-info: Add target_endian_mode() Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 06/14] qemu: Convert target_words_bigendian() to TargetInfo API Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 07/14] gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() Philippe Mathieu-Daudé
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h' Philippe Mathieu-Daudé
2025-07-07 17:22 ` Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Philippe Mathieu-Daudé
2025-07-07 19:25 ` BALATON Zoltan
2025-07-08 10:17 ` Philippe Mathieu-Daudé
2025-07-08 12:47 ` Manos Pitsidianakis
2025-07-07 17:20 ` [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
2025-07-07 22:59 ` Richard Henderson
2025-07-09 15:36 ` Zhao Liu
2025-07-07 17:20 ` [PATCH-for-10.1 v6 11/14] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces Philippe Mathieu-Daudé
2025-07-07 17:20 ` [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Philippe Mathieu-Daudé
2025-07-07 23:00 ` Richard Henderson
2025-07-07 17:20 ` [PATCH-for-10.1 v6 13/14] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro Philippe Mathieu-Daudé
2025-07-07 17:20 ` [RFC PATCH-for-10.1 v6 14/14] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros Philippe Mathieu-Daudé
2025-07-07 17:55 ` [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros Michael S. Tsirkin
2025-07-08 10:15 ` Alex Bennée
2025-07-08 10:27 ` Philippe Mathieu-Daudé
2025-07-07 19:28 ` BALATON Zoltan
2025-07-08 17:10 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).