* [PATCH 00/34] single-binary: Select the softmmu target through -machine <type>
@ 2026-10-14 9:31 Yonggang Luo
2026-10-14 9:31 ` [PATCH 01/34] qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums Yonggang Luo
` (15 more replies)
0 siblings, 16 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
MachineClass::targets declares each machine's supported targets as a
uint64_t QEMU_ARCH_* mask.
In the combined executable, a machine can be selected from
<target>-<machine-name> when <machine-name> is ambitious.
Otherwise we can use <machine-name> to directly select a target.
Renaming SysEmuTarget to EmuTarget prepares the enum for both system and
user-mode targets before introducing more usage of it.
Rationale:
https://lore.kernel.org/qemu-devel/d6217459-1e55-4da0-a49f-bde8215d8c0e@oss.qualcomm.com/
The "virt" machines need distinct QOM names to coexist in a combined binary
or test. Their existing CLI names and aliases are preserved.
Other indirect call of target_info() in class_init/type_init is removed by
serveral commits, this is a prepare for select <target> by -machine $type.
As target_info() will be NULL till the target is selected under machine_select.
The commits through "hw: add MachineClass::targets with a usage and test"
add a minimal demo/test for introduce MachineClass::targets
The next group, through
"meson: build combined qemu-system for multi-target configurations",
enabled the test guard to prevent introduce future calling
target_info() in type_init or class_init
These two boundaries provide possible merge points.
"targets" be exported along with MachineInfo in commit
"qmp: Expose supported targets in query-machines", so that the qmp know
how to set proper $<target>-<machine-name>.
The rest commits is the introduce of support of <target> select from
`-machine $type`.
Yonggang Luo (34):
qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits
qapi: rename SysEmuTarget to EmuTarget
qapi: add missing Linux user-mode targets to EmuTarget
meson: define TARGET_ARCH_VARIANT to target_name only
target-info: prepare the QOM target list before
module_call_init(MODULE_INIT_QOM)
hw: add MachineClass::targets with a usage and test
accel: register CPU parent for each target
meson: collect Rust crates for combined system target
module: Add module_allow_all_arch for allow all modules be loaded
target/arm: defer max-v8 initializer selection until CPU creation
hw/microblaze: defer PetaLogix endianness default until init
hw/pci: Avoid guard loadparm with target_s390x() for s390x in
class_init
hw/scsi: Avoid guard loadparm with target_s390x() for s390x in
class_init
hw/virtio/virtio-mem: Avoid call to target_info() in class_init
target-info: add a combined-binary query stub
machine: allow -M name to differ from QOM type
hw/riscv/virt: use unique QOM name
hw/arm/virt: use unique QOM name
hw/or1k/virt: use unique QOM name
hw/hexagon/virt: use unique QOM name
hw/loongarch/virt: use unique QOM name
hw/m68k/virt: use unique QOM name
hw/xtensa/virt: use unique QOM name
qapi: return MachineInfo typename from query-machines
machine: match the versioned virt example to arm virt
hw: Add MachineClass.targets for all "virt" machines for all possible
targets
system/arch_init: update qemu_arch_available to handle non-target
select condition
meson: build combined qemu-system for multi-target configurations
qmp: Expose supported targets in query-machines
system/vl: select target from machine name in combined binaries
system/vl: handle cpu/device help properly for multi-target qemu
qdev: Handle device alias ambiguous under multi-target qemu
MAINTAINERS | 2 +
accel/accel-common.c | 6 +-
accel/accel-internal.h | 1 +
accel/accel-system.c | 24 +++
accel/accel-user.c | 7 +
backends/igvm.c | 4 +-
hw/alpha/dp264.c | 2 +
hw/arm/virt.c | 56 +++----
hw/core/machine-qmp-cmds.c | 19 ++-
hw/core/machine.c | 9 ++
hw/hexagon/virt.c | 25 +++-
hw/loongarch/virt.c | 47 +++---
hw/m68k/virt.c | 39 +++--
hw/microblaze/petalogix_s3adsp1800_mmu.c | 11 +-
hw/misc/vmlaunchupdate.c | 6 +-
hw/or1k/virt.c | 22 +--
hw/pci/pci.c | 18 ++-
hw/riscv/virt.c | 28 ++--
hw/scsi/scsi-disk.c | 18 ++-
hw/uefi/ovmf-log.c | 4 +-
hw/virtio/virtio-mem.c | 26 ++--
hw/xtensa/virt.c | 24 ++-
include/hw/arm/virt.h | 5 +-
include/hw/core/boards.h | 45 ++++--
include/hw/hexagon/virt.h | 5 +-
include/hw/loongarch/virt.h | 5 +-
include/hw/riscv/virt.h | 5 +-
include/monitor/qdev.h | 7 +
include/qemu/base-arch-defs.h | 80 ++++++----
include/qemu/module.h | 2 +
include/qemu/target-info-def.h | 2 +-
include/qemu/target-info-qapi.h | 4 +-
include/qemu/target-info-qom.h | 4 +
include/qemu/target-info.h | 7 +
meson.build | 82 +++++++++-
monitor/monitor-hmp-internal.h | 2 +-
qapi/machine.json | 44 +++---
qapi/pragma.json | 4 +-
qom/object.c | 4 +-
stubs/meson.build | 1 +
stubs/target-info.c | 10 ++
system/arch_init.c | 12 +-
system/qdev-monitor.c | 54 ++++++-
system/target-info.c | 10 ++
system/vl.c | 181 ++++++++++++++++++++---
target-info-def.c | 2 +-
target-info-qom.c | 26 +++-
target-info.c | 38 ++---
target/arm/tcg/cpu-max-v8.c | 17 ++-
tests/qtest/fuzz/fuzz.c | 2 +-
tests/qtest/qom-test.c | 65 +++++++-
tests/unit/meson.build | 4 +-
tests/unit/test-multi-target.c | 67 ++++++++-
util/module.c | 10 +-
54 files changed, 915 insertions(+), 289 deletions(-)
create mode 100644 stubs/target-info.c
create mode 100644 system/target-info.c
--
2.55.0.windows.3
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 01/34] qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 02/34] qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL Yonggang Luo
` (14 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/base-arch-defs.h | 60 ++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 29 deletions(-)
diff --git a/include/qemu/base-arch-defs.h b/include/qemu/base-arch-defs.h
index f33465738c9..806ad8094a4 100644
--- a/include/qemu/base-arch-defs.h
+++ b/include/qemu/base-arch-defs.h
@@ -9,36 +9,38 @@
#include "qapi/qapi-types-machine.h"
+#define QEMU_ARCH_BIT(target) (1UL << (target))
+
enum {
- QEMU_ARCH_ALPHA = (1UL << SYS_EMU_TARGET_ALPHA),
- QEMU_ARCH_ARM = (1UL << SYS_EMU_TARGET_ARM) |
- (1UL << SYS_EMU_TARGET_AARCH64),
- QEMU_ARCH_I386 = (1UL << SYS_EMU_TARGET_I386) |
- (1UL << SYS_EMU_TARGET_X86_64),
- QEMU_ARCH_M68K = (1UL << SYS_EMU_TARGET_M68K),
- QEMU_ARCH_MICROBLAZE = (1UL << SYS_EMU_TARGET_MICROBLAZE),
- QEMU_ARCH_MIPS = (1UL << SYS_EMU_TARGET_MIPS) |
- (1UL << SYS_EMU_TARGET_MIPSEL) |
- (1UL << SYS_EMU_TARGET_MIPS64) |
- (1UL << SYS_EMU_TARGET_MIPS64EL),
- QEMU_ARCH_PPC = (1UL << SYS_EMU_TARGET_PPC) |
- (1UL << SYS_EMU_TARGET_PPC64),
- QEMU_ARCH_S390X = (1UL << SYS_EMU_TARGET_S390X),
- QEMU_ARCH_SH4 = (1UL << SYS_EMU_TARGET_SH4) |
- (1UL << SYS_EMU_TARGET_SH4EB),
- QEMU_ARCH_SPARC = (1UL << SYS_EMU_TARGET_SPARC) |
- (1UL << SYS_EMU_TARGET_SPARC64),
- QEMU_ARCH_XTENSA = (1UL << SYS_EMU_TARGET_XTENSA) |
- (1UL << SYS_EMU_TARGET_XTENSAEB),
- QEMU_ARCH_OR1K = (1UL << SYS_EMU_TARGET_OR1K),
- QEMU_ARCH_TRICORE = (1UL << SYS_EMU_TARGET_TRICORE),
- QEMU_ARCH_HPPA = (1UL << SYS_EMU_TARGET_HPPA),
- QEMU_ARCH_RISCV = (1UL << SYS_EMU_TARGET_RISCV32) |
- (1UL << SYS_EMU_TARGET_RISCV64),
- QEMU_ARCH_RX = (1UL << SYS_EMU_TARGET_RX),
- QEMU_ARCH_AVR = (1UL << SYS_EMU_TARGET_AVR),
- QEMU_ARCH_HEXAGON = (1UL << SYS_EMU_TARGET_HEXAGON),
- QEMU_ARCH_LOONGARCH = (1UL << SYS_EMU_TARGET_LOONGARCH64),
+ QEMU_ARCH_ALPHA = QEMU_ARCH_BIT(SYS_EMU_TARGET_ALPHA),
+ QEMU_ARCH_ARM = QEMU_ARCH_BIT(SYS_EMU_TARGET_ARM) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64),
+ QEMU_ARCH_I386 = QEMU_ARCH_BIT(SYS_EMU_TARGET_I386) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_X86_64),
+ QEMU_ARCH_M68K = QEMU_ARCH_BIT(SYS_EMU_TARGET_M68K),
+ QEMU_ARCH_MICROBLAZE = QEMU_ARCH_BIT(SYS_EMU_TARGET_MICROBLAZE),
+ QEMU_ARCH_MIPS = QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPSEL) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS64) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS64EL),
+ QEMU_ARCH_PPC = QEMU_ARCH_BIT(SYS_EMU_TARGET_PPC) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_PPC64),
+ QEMU_ARCH_S390X = QEMU_ARCH_BIT(SYS_EMU_TARGET_S390X),
+ QEMU_ARCH_SH4 = QEMU_ARCH_BIT(SYS_EMU_TARGET_SH4) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_SH4EB),
+ QEMU_ARCH_SPARC = QEMU_ARCH_BIT(SYS_EMU_TARGET_SPARC) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_SPARC64),
+ QEMU_ARCH_XTENSA = QEMU_ARCH_BIT(SYS_EMU_TARGET_XTENSA) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_XTENSAEB),
+ QEMU_ARCH_OR1K = QEMU_ARCH_BIT(SYS_EMU_TARGET_OR1K),
+ QEMU_ARCH_TRICORE = QEMU_ARCH_BIT(SYS_EMU_TARGET_TRICORE),
+ QEMU_ARCH_HPPA = QEMU_ARCH_BIT(SYS_EMU_TARGET_HPPA),
+ QEMU_ARCH_RISCV = QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV32) |
+ QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV64),
+ QEMU_ARCH_RX = QEMU_ARCH_BIT(SYS_EMU_TARGET_RX),
+ QEMU_ARCH_AVR = QEMU_ARCH_BIT(SYS_EMU_TARGET_AVR),
+ QEMU_ARCH_HEXAGON = QEMU_ARCH_BIT(SYS_EMU_TARGET_HEXAGON),
+ QEMU_ARCH_LOONGARCH = QEMU_ARCH_BIT(SYS_EMU_TARGET_LOONGARCH64),
QEMU_ARCH_ALL = UINT32_MAX,
};
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 02/34] qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
2026-10-14 9:31 ` [PATCH 01/34] qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 03/34] qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits Yonggang Luo
` (13 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This is more precise, so we can iterate all target_arch with QEMU_ARCH_ALL
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/base-arch-defs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/base-arch-defs.h b/include/qemu/base-arch-defs.h
index 806ad8094a4..a6478c2d3ff 100644
--- a/include/qemu/base-arch-defs.h
+++ b/include/qemu/base-arch-defs.h
@@ -41,7 +41,7 @@ enum {
QEMU_ARCH_AVR = QEMU_ARCH_BIT(SYS_EMU_TARGET_AVR),
QEMU_ARCH_HEXAGON = QEMU_ARCH_BIT(SYS_EMU_TARGET_HEXAGON),
QEMU_ARCH_LOONGARCH = QEMU_ARCH_BIT(SYS_EMU_TARGET_LOONGARCH64),
- QEMU_ARCH_ALL = UINT32_MAX,
+ QEMU_ARCH_ALL = QEMU_ARCH_BIT(SYS_EMU_TARGET__MAX) - 1,
};
QEMU_BUILD_BUG_ON(SYS_EMU_TARGET__MAX > 32);
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 03/34] qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
2026-10-14 9:31 ` [PATCH 01/34] qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums Yonggang Luo
2026-10-14 9:31 ` [PATCH 02/34] qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget Yonggang Luo
` (12 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
SYS_EMU_TARGET__MAX is already 29, nearing the 32-target limit.
So increase width of QEMU_ARCH_* masks enums and related types;
So that we can add needed Linux user-mode targets to EmuTarget;
And also enabled the possibility add more system-mode targets in future.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/base-arch-defs.h | 7 ++++---
monitor/monitor-hmp-internal.h | 2 +-
system/arch_init.c | 4 ++--
system/qdev-monitor.c | 2 +-
system/vl.c | 2 +-
5 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/include/qemu/base-arch-defs.h b/include/qemu/base-arch-defs.h
index a6478c2d3ff..f2e3bc54203 100644
--- a/include/qemu/base-arch-defs.h
+++ b/include/qemu/base-arch-defs.h
@@ -9,7 +9,7 @@
#include "qapi/qapi-types-machine.h"
-#define QEMU_ARCH_BIT(target) (1UL << (target))
+#define QEMU_ARCH_BIT(target) (1ULL << (target))
enum {
QEMU_ARCH_ALPHA = QEMU_ARCH_BIT(SYS_EMU_TARGET_ALPHA),
@@ -44,7 +44,8 @@ enum {
QEMU_ARCH_ALL = QEMU_ARCH_BIT(SYS_EMU_TARGET__MAX) - 1,
};
-QEMU_BUILD_BUG_ON(SYS_EMU_TARGET__MAX > 32);
+/* Keep target-specific masks within qemu_opt_set_number()'s int64_t range. */
+QEMU_BUILD_BUG_ON(SYS_EMU_TARGET__MAX > 63);
/**
* qemu_arch_available:
@@ -52,6 +53,6 @@ QEMU_BUILD_BUG_ON(SYS_EMU_TARGET__MAX > 32);
*
* Return whether the current target architecture is contained in @arch_bitmask
*/
-bool qemu_arch_available(uint32_t arch_bitmask);
+bool qemu_arch_available(uint64_t arch_bitmask);
#endif
diff --git a/monitor/monitor-hmp-internal.h b/monitor/monitor-hmp-internal.h
index 4e2430551ab..b61d2717076 100644
--- a/monitor/monitor-hmp-internal.h
+++ b/monitor/monitor-hmp-internal.h
@@ -69,7 +69,7 @@ typedef struct HMPCommand {
* Allow to restrict the command for a particular set of
* target architectures.
*/
- uint32_t arch_bitmask;
+ uint64_t arch_bitmask;
bool coroutine;
} HMPCommand;
diff --git a/system/arch_init.c b/system/arch_init.c
index 1ad2f3d6f78..b8362b12a6d 100644
--- a/system/arch_init.c
+++ b/system/arch_init.c
@@ -26,7 +26,7 @@
#include "qemu/bitops.h"
#include "qemu/target-info-qapi.h"
-bool qemu_arch_available(uint32_t arch_bitmask)
+bool qemu_arch_available(uint64_t arch_bitmask)
{
- return extract32(arch_bitmask, target_arch(), 1);
+ return extract64(arch_bitmask, target_arch(), 1);
}
diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
index 8185822daa7..b3ca619f3c9 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -54,7 +54,7 @@ typedef struct QDevAlias
{
const char *typename;
const char *alias;
- uint32_t arch_mask;
+ uint64_t arch_mask;
} QDevAlias;
/* default virtio transport per architecture */
diff --git a/system/vl.c b/system/vl.c
index 468a9fc247a..fbe580746d3 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -928,7 +928,7 @@ typedef struct QEMUOption {
const char *name;
int flags;
int index;
- uint32_t arch_mask;
+ uint64_t arch_mask;
} QEMUOption;
static const QEMUOption qemu_options[] = {
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (2 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 03/34] qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 11:24 ` Markus Armbruster
2026-10-14 9:31 ` [PATCH 05/34] qapi: add missing Linux user-mode targets " Yonggang Luo
` (11 subsequent siblings)
15 siblings, 1 reply; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
As now it's also expressing user-mode targets.
This changes the type name exposed by query-qmp-schema; enum values and
serialized target values remain unchanged.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
backends/igvm.c | 4 +--
hw/core/machine-qmp-cmds.c | 2 +-
hw/misc/vmlaunchupdate.c | 6 ++--
hw/uefi/ovmf-log.c | 4 +--
hw/virtio/virtio-mem.c | 14 ++++----
include/qemu/base-arch-defs.h | 62 ++++++++++++++++-----------------
include/qemu/target-info-def.h | 2 +-
include/qemu/target-info-qapi.h | 4 +--
qapi/machine.json | 8 ++---
qapi/pragma.json | 4 +--
target-info-def.c | 2 +-
target-info.c | 26 +++++++-------
12 files changed, 69 insertions(+), 69 deletions(-)
diff --git a/backends/igvm.c b/backends/igvm.c
index 58f3097e851..f4045bb8651 100644
--- a/backends/igvm.c
+++ b/backends/igvm.c
@@ -535,7 +535,7 @@ static int qigvm_directive_vp_context(QIgvm *ctx, const uint8_t *header_data,
vp_context->gpa, data,
igvm_get_buffer_size(ctx->cfg->file, data_handle),
CGS_PAGE_TYPE_VMSA, vp_context->vp_index, errp);
- } else if (target_arch() == SYS_EMU_TARGET_X86_64) {
+ } else if (target_arch() == EMU_TARGET_X86_64) {
result = qigvm_x86_set_vp_context(data, vp_context->vp_index, errp);
} else {
error_setg(
@@ -647,7 +647,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const uint8_t *header_data,
if (ctx->machine_state->cgs && ctx->cgsc->get_mem_map_entry) {
get_mem_map_entry = ctx->cgsc->get_mem_map_entry;
- } else if (target_arch() == SYS_EMU_TARGET_X86_64) {
+ } else if (target_arch() == EMU_TARGET_X86_64) {
get_mem_map_entry = qigvm_x86_get_mem_map_entry;
} else {
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 9c08b17510a..bc614a75c7d 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -64,7 +64,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 = target_arch();
+ EmuTarget target = target_arch();
CPUState *cpu;
CPU_FOREACH(cpu) {
diff --git a/hw/misc/vmlaunchupdate.c b/hw/misc/vmlaunchupdate.c
index 847d2d963f1..95cb2263828 100644
--- a/hw/misc/vmlaunchupdate.c
+++ b/hw/misc/vmlaunchupdate.c
@@ -35,7 +35,7 @@ static VMLaunchUpdateState *vm_launchupdate_find(void)
static bool vmlaunchupdate_supported(void)
{
- return target_arch() == SYS_EMU_TARGET_X86_64;
+ return target_arch() == EMU_TARGET_X86_64;
}
static void init_vm_launch_update(VMLaunchUpdateState *s)
@@ -192,7 +192,7 @@ static void launch_update_write(void *dev, off_t offset, size_t len)
/* process guest provided IGVM image */
if (s->launch_update.control & VM_LAUNCHUPDATE_FORMAT_IGVM) {
- if (target_arch() == SYS_EMU_TARGET_X86_64) {
+ if (target_arch() == EMU_TARGET_X86_64) {
addr = le64_to_cpu(s->launch_update.fw_image_addr);
size = le64_to_cpu(s->launch_update.fw_image_size);
rc = process_x86_igvm(s, addr, size);
@@ -229,7 +229,7 @@ static void vmlaunch_reset_enter(Object *obj, ResetType type)
{
VMLaunchUpdateState *s = VMLAUNCHUPDATE(obj);
- if (target_arch() != SYS_EMU_TARGET_X86_64) {
+ if (target_arch() != EMU_TARGET_X86_64) {
return;
}
diff --git a/hw/uefi/ovmf-log.c b/hw/uefi/ovmf-log.c
index c4e6a506410..2d8961b80ec 100644
--- a/hw/uefi/ovmf-log.c
+++ b/hw/uefi/ovmf-log.c
@@ -114,7 +114,7 @@ static dma_addr_t find_ovmf_log(void)
MachineState *ms = MACHINE(qdev_get_machine());
dma_addr_t start, end, offset;
- if (target_arch() == SYS_EMU_TARGET_X86_64 &&
+ if (target_arch() == EMU_TARGET_X86_64 &&
object_dynamic_cast(OBJECT(ms), TYPE_X86_MACHINE)) {
X86MachineState *x86ms = X86_MACHINE(ms);
@@ -133,7 +133,7 @@ static dma_addr_t find_ovmf_log(void)
return find_ovmf_log_range(start, end);
}
- if (target_arch() == SYS_EMU_TARGET_AARCH64 &&
+ if (target_arch() == EMU_TARGET_AARCH64 &&
object_dynamic_cast(OBJECT(ms), TYPE_VIRT_MACHINE)) {
VirtMachineState *vms = VIRT_MACHINE(ms);
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 7130ed852d9..a4110d61312 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -43,8 +43,8 @@ static bool virtio_mem_has_legacy_guests(void)
* legacy guests.
*/
switch (target_arch()) {
- case SYS_EMU_TARGET_I386:
- case SYS_EMU_TARGET_X86_64:
+ case EMU_TARGET_I386:
+ case EMU_TARGET_X86_64:
return true;
default:
return false;
@@ -181,12 +181,12 @@ static bool virtio_mem_has_shared_zeropage(RAMBlock *rb)
static uint64_t virtio_mem_usable_extent_size(void)
{
switch (target_arch()) {
- case SYS_EMU_TARGET_I386:
- case SYS_EMU_TARGET_X86_64:
- case SYS_EMU_TARGET_S390X:
+ case EMU_TARGET_I386:
+ case EMU_TARGET_X86_64:
+ case EMU_TARGET_S390X:
return 2 * 128 * MiB;
- case SYS_EMU_TARGET_AARCH64:
- case SYS_EMU_TARGET_ARM:
+ case EMU_TARGET_AARCH64:
+ case EMU_TARGET_ARM:
return 2 * 512 * MiB;
default:
g_assert_not_reached();
diff --git a/include/qemu/base-arch-defs.h b/include/qemu/base-arch-defs.h
index f2e3bc54203..7ddecc3d0be 100644
--- a/include/qemu/base-arch-defs.h
+++ b/include/qemu/base-arch-defs.h
@@ -12,40 +12,40 @@
#define QEMU_ARCH_BIT(target) (1ULL << (target))
enum {
- QEMU_ARCH_ALPHA = QEMU_ARCH_BIT(SYS_EMU_TARGET_ALPHA),
- QEMU_ARCH_ARM = QEMU_ARCH_BIT(SYS_EMU_TARGET_ARM) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64),
- QEMU_ARCH_I386 = QEMU_ARCH_BIT(SYS_EMU_TARGET_I386) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_X86_64),
- QEMU_ARCH_M68K = QEMU_ARCH_BIT(SYS_EMU_TARGET_M68K),
- QEMU_ARCH_MICROBLAZE = QEMU_ARCH_BIT(SYS_EMU_TARGET_MICROBLAZE),
- QEMU_ARCH_MIPS = QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPSEL) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS64) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_MIPS64EL),
- QEMU_ARCH_PPC = QEMU_ARCH_BIT(SYS_EMU_TARGET_PPC) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_PPC64),
- QEMU_ARCH_S390X = QEMU_ARCH_BIT(SYS_EMU_TARGET_S390X),
- QEMU_ARCH_SH4 = QEMU_ARCH_BIT(SYS_EMU_TARGET_SH4) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_SH4EB),
- QEMU_ARCH_SPARC = QEMU_ARCH_BIT(SYS_EMU_TARGET_SPARC) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_SPARC64),
- QEMU_ARCH_XTENSA = QEMU_ARCH_BIT(SYS_EMU_TARGET_XTENSA) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_XTENSAEB),
- QEMU_ARCH_OR1K = QEMU_ARCH_BIT(SYS_EMU_TARGET_OR1K),
- QEMU_ARCH_TRICORE = QEMU_ARCH_BIT(SYS_EMU_TARGET_TRICORE),
- QEMU_ARCH_HPPA = QEMU_ARCH_BIT(SYS_EMU_TARGET_HPPA),
- QEMU_ARCH_RISCV = QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV32) |
- QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV64),
- QEMU_ARCH_RX = QEMU_ARCH_BIT(SYS_EMU_TARGET_RX),
- QEMU_ARCH_AVR = QEMU_ARCH_BIT(SYS_EMU_TARGET_AVR),
- QEMU_ARCH_HEXAGON = QEMU_ARCH_BIT(SYS_EMU_TARGET_HEXAGON),
- QEMU_ARCH_LOONGARCH = QEMU_ARCH_BIT(SYS_EMU_TARGET_LOONGARCH64),
- QEMU_ARCH_ALL = QEMU_ARCH_BIT(SYS_EMU_TARGET__MAX) - 1,
+ QEMU_ARCH_ALPHA = QEMU_ARCH_BIT(EMU_TARGET_ALPHA),
+ QEMU_ARCH_ARM = QEMU_ARCH_BIT(EMU_TARGET_ARM) |
+ QEMU_ARCH_BIT(EMU_TARGET_AARCH64),
+ QEMU_ARCH_I386 = QEMU_ARCH_BIT(EMU_TARGET_I386) |
+ QEMU_ARCH_BIT(EMU_TARGET_X86_64),
+ QEMU_ARCH_M68K = QEMU_ARCH_BIT(EMU_TARGET_M68K),
+ QEMU_ARCH_MICROBLAZE = QEMU_ARCH_BIT(EMU_TARGET_MICROBLAZE),
+ QEMU_ARCH_MIPS = QEMU_ARCH_BIT(EMU_TARGET_MIPS) |
+ QEMU_ARCH_BIT(EMU_TARGET_MIPSEL) |
+ QEMU_ARCH_BIT(EMU_TARGET_MIPS64) |
+ QEMU_ARCH_BIT(EMU_TARGET_MIPS64EL),
+ QEMU_ARCH_PPC = QEMU_ARCH_BIT(EMU_TARGET_PPC) |
+ QEMU_ARCH_BIT(EMU_TARGET_PPC64),
+ QEMU_ARCH_S390X = QEMU_ARCH_BIT(EMU_TARGET_S390X),
+ QEMU_ARCH_SH4 = QEMU_ARCH_BIT(EMU_TARGET_SH4) |
+ QEMU_ARCH_BIT(EMU_TARGET_SH4EB),
+ QEMU_ARCH_SPARC = QEMU_ARCH_BIT(EMU_TARGET_SPARC) |
+ QEMU_ARCH_BIT(EMU_TARGET_SPARC64),
+ QEMU_ARCH_XTENSA = QEMU_ARCH_BIT(EMU_TARGET_XTENSA) |
+ QEMU_ARCH_BIT(EMU_TARGET_XTENSAEB),
+ QEMU_ARCH_OR1K = QEMU_ARCH_BIT(EMU_TARGET_OR1K),
+ QEMU_ARCH_TRICORE = QEMU_ARCH_BIT(EMU_TARGET_TRICORE),
+ QEMU_ARCH_HPPA = QEMU_ARCH_BIT(EMU_TARGET_HPPA),
+ QEMU_ARCH_RISCV = QEMU_ARCH_BIT(EMU_TARGET_RISCV32) |
+ QEMU_ARCH_BIT(EMU_TARGET_RISCV64),
+ QEMU_ARCH_RX = QEMU_ARCH_BIT(EMU_TARGET_RX),
+ QEMU_ARCH_AVR = QEMU_ARCH_BIT(EMU_TARGET_AVR),
+ QEMU_ARCH_HEXAGON = QEMU_ARCH_BIT(EMU_TARGET_HEXAGON),
+ QEMU_ARCH_LOONGARCH = QEMU_ARCH_BIT(EMU_TARGET_LOONGARCH64),
+ QEMU_ARCH_ALL = QEMU_ARCH_BIT(EMU_TARGET__MAX) - 1,
};
/* Keep target-specific masks within qemu_opt_set_number()'s int64_t range. */
-QEMU_BUILD_BUG_ON(SYS_EMU_TARGET__MAX > 63);
+QEMU_BUILD_BUG_ON(EMU_TARGET__MAX > 63);
/**
* qemu_arch_available:
diff --git a/include/qemu/target-info-def.h b/include/qemu/target-info-def.h
index 8019d2c7196..479f7ddd39c 100644
--- a/include/qemu/target-info-def.h
+++ b/include/qemu/target-info-def.h
@@ -16,7 +16,7 @@ typedef struct TargetInfo {
/* runtime equivalent of TARGET_NAME definition */
const char *target_name;
/* related to TARGET_ARCH definition */
- SysEmuTarget target_arch;
+ EmuTarget target_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 d5ce0523238..42a78ee38bc 100644
--- a/include/qemu/target-info-qapi.h
+++ b/include/qemu/target-info-qapi.h
@@ -15,9 +15,9 @@
/**
* target_arch:
*
- * Returns: QAPI SysEmuTarget enum (e.g. SYS_EMU_TARGET_X86_64).
+ * Returns: QAPI EmuTarget enum (e.g. EMU_TARGET_X86_64).
*/
-SysEmuTarget target_arch(void);
+EmuTarget target_arch(void);
/**
* target_endian_mode:
diff --git a/qapi/machine.json b/qapi/machine.json
index 9b145c635ba..07fac4f0764 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -14,7 +14,7 @@
{ 'include': 'machine-common.json' }
##
-# @SysEmuTarget:
+# @EmuTarget:
# The comprehensive enumeration of QEMU system emulation
# ("softmmu") targets. Run "./configure --help" in the project
# root directory, and look for the \*-softmmu targets near the
@@ -35,7 +35,7 @@
#
# Since: 3.0
##
-{ 'enum' : 'SysEmuTarget',
+{ 'enum' : 'EmuTarget',
'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
'mips64el', 'mipsel', 'or1k', 'ppc',
@@ -95,7 +95,7 @@
'qom-path' : 'str',
'thread-id' : 'int',
'*props' : 'CpuInstanceProperties',
- 'target' : 'SysEmuTarget' },
+ 'target' : 'EmuTarget' },
'discriminator' : 'target',
'data' : { 's390x' : 'CpuInfoS390' } }
@@ -281,7 +281,7 @@
# Since: 1.2
##
{ 'struct': 'QemuTargetInfo',
- 'data': { 'arch': 'SysEmuTarget' } }
+ 'data': { 'arch': 'EmuTarget' } }
##
# @query-target:
diff --git a/qapi/pragma.json b/qapi/pragma.json
index 342cedc42e7..93a710ee937 100644
--- a/qapi/pragma.json
+++ b/qapi/pragma.json
@@ -72,7 +72,7 @@
'SsidSizeMode',
'String',
'StringWrapper',
- 'SysEmuTarget',
+ 'EmuTarget',
'ThrottleGroupProperties',
'VncPrimaryAuth',
'VncVencryptSubAuth',
@@ -109,7 +109,7 @@
'QKeyCode', # send-key, input-sent-event
'QapiErrorClass', # QMP error replies
'SshHostKeyCheckMode', # blockdev-add, -blockdev
- 'SysEmuTarget', # query-cpu-fast, query-target
+ 'EmuTarget', # query-cpu-fast, query-target
'UuidInfo', # query-uuid
'VncClientInfo', # query-vnc, query-vnc-servers, ...
'X86CPURegister32' # qom-get of x86 CPU properties
diff --git a/target-info-def.c b/target-info-def.c
index bcf9cfe1e43..028816f4cf1 100644
--- a/target-info-def.c
+++ b/target-info-def.c
@@ -26,7 +26,7 @@ QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
static const TargetInfo target_info_stub = {
.target_name = TARGET_NAME,
- .target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH_VARIANT),
+ .target_arch = glue(EMU_TARGET_, TARGET_ARCH_VARIANT),
.long_bits = TARGET_LONG_BITS,
.cpu_type = CPU_RESOLVING_TYPE,
.endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
diff --git a/target-info.c b/target-info.c
index 6b365113955..241be2b5563 100644
--- a/target-info.c
+++ b/target-info.c
@@ -22,7 +22,7 @@ unsigned target_long_bits(void)
return target_info()->long_bits;
}
-SysEmuTarget target_arch(void)
+EmuTarget target_arch(void)
{
return target_info()->target_arch;
}
@@ -45,8 +45,8 @@ bool target_big_endian(void)
bool target_base_arm(void)
{
switch (target_arch()) {
- case SYS_EMU_TARGET_ARM:
- case SYS_EMU_TARGET_AARCH64:
+ case EMU_TARGET_ARM:
+ case EMU_TARGET_AARCH64:
return true;
default:
return false;
@@ -55,29 +55,29 @@ bool target_base_arm(void)
bool target_arm(void)
{
- return target_arch() == SYS_EMU_TARGET_ARM;
+ return target_arch() == EMU_TARGET_ARM;
}
bool target_aarch64(void)
{
- return target_arch() == SYS_EMU_TARGET_AARCH64;
+ return target_arch() == EMU_TARGET_AARCH64;
}
bool target_m68k(void)
{
- return target_arch() == SYS_EMU_TARGET_M68K;
+ return target_arch() == EMU_TARGET_M68K;
}
bool target_or1k(void)
{
- return target_arch() == SYS_EMU_TARGET_OR1K;
+ return target_arch() == EMU_TARGET_OR1K;
}
bool target_base_ppc(void)
{
switch (target_arch()) {
- case SYS_EMU_TARGET_PPC:
- case SYS_EMU_TARGET_PPC64:
+ case EMU_TARGET_PPC:
+ case EMU_TARGET_PPC64:
return true;
default:
return false;
@@ -86,20 +86,20 @@ bool target_base_ppc(void)
bool target_ppc(void)
{
- return target_arch() == SYS_EMU_TARGET_PPC;
+ return target_arch() == EMU_TARGET_PPC;
}
bool target_ppc64(void)
{
- return target_arch() == SYS_EMU_TARGET_PPC64;
+ return target_arch() == EMU_TARGET_PPC64;
}
bool target_s390x(void)
{
- return target_arch() == SYS_EMU_TARGET_S390X;
+ return target_arch() == EMU_TARGET_S390X;
}
bool target_riscv64(void)
{
- return target_arch() == SYS_EMU_TARGET_RISCV64;
+ return target_arch() == EMU_TARGET_RISCV64;
}
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (3 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 10:24 ` Philippe Mathieu-Daudé
2026-10-14 17:26 ` Pierrick Bouvier
2026-10-14 9:31 ` [PATCH 06/34] meson: define TARGET_ARCH_VARIANT to target_name only Yonggang Luo
` (10 subsequent siblings)
15 siblings, 2 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This usermode targets:
aarch64_be
armeb
microblazeel
mipsn32
mipsn32el
ppc64le
sparc32plus
are not in machine.json
This is a prepare for directly using TARGET_ARCH_VARIANT latter.
Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
So that we can define TARGET_ARCH_VARIANT to target_name directly
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/base-arch-defs.h | 13 +++++++++++++
qapi/machine.json | 25 +++++++++++++------------
target-info.c | 26 +++++++++-----------------
3 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/include/qemu/base-arch-defs.h b/include/qemu/base-arch-defs.h
index 7ddecc3d0be..6f3dadcc3a8 100644
--- a/include/qemu/base-arch-defs.h
+++ b/include/qemu/base-arch-defs.h
@@ -11,25 +11,38 @@
#define QEMU_ARCH_BIT(target) (1ULL << (target))
+/* Unsuffixed family masks cover system targets; _ALL includes user targets. */
enum {
QEMU_ARCH_ALPHA = QEMU_ARCH_BIT(EMU_TARGET_ALPHA),
QEMU_ARCH_ARM = QEMU_ARCH_BIT(EMU_TARGET_ARM) |
QEMU_ARCH_BIT(EMU_TARGET_AARCH64),
+ QEMU_ARCH_ARM_ALL = QEMU_ARCH_ARM |
+ QEMU_ARCH_BIT(EMU_TARGET_AARCH64_BE) |
+ QEMU_ARCH_BIT(EMU_TARGET_ARMEB),
QEMU_ARCH_I386 = QEMU_ARCH_BIT(EMU_TARGET_I386) |
QEMU_ARCH_BIT(EMU_TARGET_X86_64),
QEMU_ARCH_M68K = QEMU_ARCH_BIT(EMU_TARGET_M68K),
QEMU_ARCH_MICROBLAZE = QEMU_ARCH_BIT(EMU_TARGET_MICROBLAZE),
+ QEMU_ARCH_MICROBLAZE_ALL = QEMU_ARCH_MICROBLAZE |
+ QEMU_ARCH_BIT(EMU_TARGET_MICROBLAZEEL),
QEMU_ARCH_MIPS = QEMU_ARCH_BIT(EMU_TARGET_MIPS) |
QEMU_ARCH_BIT(EMU_TARGET_MIPSEL) |
QEMU_ARCH_BIT(EMU_TARGET_MIPS64) |
QEMU_ARCH_BIT(EMU_TARGET_MIPS64EL),
+ QEMU_ARCH_MIPS_ALL = QEMU_ARCH_MIPS |
+ QEMU_ARCH_BIT(EMU_TARGET_MIPSN32) |
+ QEMU_ARCH_BIT(EMU_TARGET_MIPSN32EL),
QEMU_ARCH_PPC = QEMU_ARCH_BIT(EMU_TARGET_PPC) |
QEMU_ARCH_BIT(EMU_TARGET_PPC64),
+ QEMU_ARCH_PPC_ALL = QEMU_ARCH_PPC |
+ QEMU_ARCH_BIT(EMU_TARGET_PPC64LE),
QEMU_ARCH_S390X = QEMU_ARCH_BIT(EMU_TARGET_S390X),
QEMU_ARCH_SH4 = QEMU_ARCH_BIT(EMU_TARGET_SH4) |
QEMU_ARCH_BIT(EMU_TARGET_SH4EB),
QEMU_ARCH_SPARC = QEMU_ARCH_BIT(EMU_TARGET_SPARC) |
QEMU_ARCH_BIT(EMU_TARGET_SPARC64),
+ QEMU_ARCH_SPARC_ALL = QEMU_ARCH_SPARC |
+ QEMU_ARCH_BIT(EMU_TARGET_SPARC32PLUS),
QEMU_ARCH_XTENSA = QEMU_ARCH_BIT(EMU_TARGET_XTENSA) |
QEMU_ARCH_BIT(EMU_TARGET_XTENSAEB),
QEMU_ARCH_OR1K = QEMU_ARCH_BIT(EMU_TARGET_OR1K),
diff --git a/qapi/machine.json b/qapi/machine.json
index 07fac4f0764..a3d6e08a847 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -15,11 +15,10 @@
##
# @EmuTarget:
-# The comprehensive enumeration of QEMU system emulation
-# ("softmmu") targets. Run "./configure --help" in the project
-# root directory, and look for the \*-softmmu targets near the
-# "--target-list" option. The individual target constants are not
-# documented here, for the time being.
+# The comprehensive enumeration of QEMU system and user-mode
+# emulation targets. Run "./configure --help" in the project root
+# directory, and look for the targets near the "--target-list"
+# option. Individual target constants are not documented here.
#
# @rx: since 5.0
#
@@ -30,17 +29,19 @@
# @hexagon: since 11.0
#
# .. note:: The resulting QMP strings can be appended to the
-# "qemu-system-" prefix to produce the corresponding QEMU
-# executable name. This is true even for "qemu-system-x86_64".
+# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
+# for user-mode emulation, to produce the corresponding executable
+# name, where that target supports the respective emulation mode.
#
# Since: 3.0
##
{ 'enum' : 'EmuTarget',
- 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
- 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
- 'mips64el', 'mipsel', 'or1k', 'ppc',
- 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
- 'sh4eb', 'sparc', 'sparc64', 'tricore',
+ 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
+ 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
+ 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
+ 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
+ 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
+ 'sparc32plus', 'sparc64', 'tricore',
'x86_64', 'xtensa', 'xtensaeb' ] }
##
diff --git a/target-info.c b/target-info.c
index 241be2b5563..b2abcd55bd3 100644
--- a/target-info.c
+++ b/target-info.c
@@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/base-arch-defs.h"
#include "qemu/target-info.h"
#include "qemu/target-info-qapi.h"
#include "qemu/target-info-def.h"
@@ -44,23 +45,19 @@ bool target_big_endian(void)
bool target_base_arm(void)
{
- switch (target_arch()) {
- case EMU_TARGET_ARM:
- case EMU_TARGET_AARCH64:
- return true;
- default:
- return false;
- }
+ return (QEMU_ARCH_ARM_ALL & QEMU_ARCH_BIT(target_arch())) != 0;
}
bool target_arm(void)
{
- return target_arch() == EMU_TARGET_ARM;
+ return target_arch() == EMU_TARGET_ARM ||
+ target_arch() == EMU_TARGET_ARMEB;
}
bool target_aarch64(void)
{
- return target_arch() == EMU_TARGET_AARCH64;
+ return target_arch() == EMU_TARGET_AARCH64 ||
+ target_arch() == EMU_TARGET_AARCH64_BE;
}
bool target_m68k(void)
@@ -75,13 +72,7 @@ bool target_or1k(void)
bool target_base_ppc(void)
{
- switch (target_arch()) {
- case EMU_TARGET_PPC:
- case EMU_TARGET_PPC64:
- return true;
- default:
- return false;
- }
+ return (QEMU_ARCH_PPC_ALL & QEMU_ARCH_BIT(target_arch())) != 0;
}
bool target_ppc(void)
@@ -91,7 +82,8 @@ bool target_ppc(void)
bool target_ppc64(void)
{
- return target_arch() == EMU_TARGET_PPC64;
+ return target_arch() == EMU_TARGET_PPC64 ||
+ target_arch() == EMU_TARGET_PPC64LE;
}
bool target_s390x(void)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 06/34] meson: define TARGET_ARCH_VARIANT to target_name only
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (4 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 05/34] qapi: add missing Linux user-mode targets " Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 07/34] target-info: prepare the QOM target list before module_call_init(MODULE_INIT_QOM) Yonggang Luo
` (9 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
So target_arch() only related to target_name.to_upper(), simplify
it's meaning
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
meson.build | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 255c887e8e6..3460d031a95 100644
--- a/meson.build
+++ b/meson.build
@@ -3290,11 +3290,7 @@ fdt_required = []
foreach target : target_dirs
target_name = target.split('-')[0]
config_target = { 'TARGET_NAME': target_name }
- if target.endswith('linux-user')
- config_target += { 'TARGET_ARCH_VARIANT': 'TARGET_ARCH' }
- else
- config_target += { 'TARGET_ARCH_VARIANT': target_name.to_upper() }
- endif
+ config_target += { 'TARGET_ARCH_VARIANT': target_name.to_upper() }
if target.endswith('linux-user')
if host_os != 'linux'
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 07/34] target-info: prepare the QOM target list before module_call_init(MODULE_INIT_QOM)
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (5 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 06/34] meson: define TARGET_ARCH_VARIANT to target_name only Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 08/34] hw: add MachineClass::targets with a usage and test Yonggang Luo
` (8 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
We can not retrieve target list when do call to module_call_init(MODULE_INIT_QOM)
But in future, we need iterate target list inside type_init referenced functions for
generate all QOM variants depends on target list(without select the target).
So we have to prepare the QOM target list before module_call_init(MODULE_INIT_QOM)
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/target-info-qom.h | 4 ++++
system/vl.c | 2 +-
target-info-qom.c | 26 +++++++++++++++++++++++++-
tests/qtest/fuzz/fuzz.c | 2 +-
tests/unit/test-multi-target.c | 20 +++++++++++++-------
5 files changed, 44 insertions(+), 10 deletions(-)
diff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h
index ba2e4370afb..031d9ce32a5 100644
--- a/include/qemu/target-info-qom.h
+++ b/include/qemu/target-info-qom.h
@@ -25,6 +25,10 @@ typedef struct TargetInfoQomClass {
OBJECT_DECLARE_TYPE(TargetInfoQom, TargetInfoQomClass, TARGET_INFO)
+/* Initialize before MODULE_INIT_QOM; cache is owned by this module. */
+void target_info_qom_init(void);
+GSList *target_info_qom_get_targets(void);
+
void target_info_qom_set_target(void);
void target_info_qom_set_target_info(const TargetInfo *ti);
diff --git a/system/vl.c b/system/vl.c
index fbe580746d3..a7684abdd3a 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2914,7 +2914,7 @@ void qemu_init(int argc, char **argv)
os_setup_limits();
- module_call_init(MODULE_INIT_TARGET_INFO);
+ target_info_qom_init();
target_info_qom_set_target();
module_init_info(qemu_modinfo);
diff --git a/target-info-qom.c b/target-info-qom.c
index aeeedb7e818..8d3f2b7280b 100644
--- a/target-info-qom.c
+++ b/target-info-qom.c
@@ -8,6 +8,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "qemu/module.h"
#include "qom/object.h"
#include "qemu/target-info-def.h"
#include "qemu/target-info-init.h"
@@ -34,6 +35,29 @@ static const TypeInfo target_info_parent_type = {
DEFINE_TARGET_INFO_TYPE(target_info_parent_type)
static const TargetInfo *target_info_ptr;
+static GSList *target_info_classes;
+static bool target_info_initialized;
+
+void target_info_qom_init(void)
+{
+ if (target_info_initialized) {
+ return;
+ }
+
+ module_call_init(MODULE_INIT_TARGET_INFO);
+ /*
+ * Avoid enumerating target-info classes during QOM registration,
+ * which can leave unrelated types incomplete.
+ */
+ target_info_classes = object_class_get_list(TYPE_TARGET_INFO, false);
+ target_info_initialized = true;
+}
+
+GSList *target_info_qom_get_targets(void)
+{
+ assert(target_info_initialized);
+ return target_info_classes;
+}
const TargetInfo *target_info(void)
{
@@ -42,7 +66,7 @@ const TargetInfo *target_info(void)
void target_info_qom_set_target(void)
{
- g_autoptr(GSList) targets = object_class_get_list(TYPE_TARGET_INFO, false);
+ GSList *targets = target_info_qom_get_targets();
size_t num_found = g_slist_length(targets);
if (num_found != 1) {
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index a3a131c80f8..570fc0b45b2 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -173,7 +173,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
/* Initialize qgraph and modules */
qos_graph_init();
- module_call_init(MODULE_INIT_TARGET_INFO);
+ target_info_qom_init();
target_info_qom_set_target();
module_call_init(MODULE_INIT_FUZZ_TARGET);
module_call_init(MODULE_INIT_QOM);
diff --git a/tests/unit/test-multi-target.c b/tests/unit/test-multi-target.c
index 89b55bb1632..a91fe8e6d07 100644
--- a/tests/unit/test-multi-target.c
+++ b/tests/unit/test-multi-target.c
@@ -30,23 +30,29 @@
/* stub for system/main.c */
int (*qemu_main)(void);
+static GSList *targets;
+
static void test_qom_types_are_unique(void)
{
- module_call_init(MODULE_INIT_TARGET_INFO);
- g_autoptr(GSList) targets = object_class_get_list(TYPE_TARGET_INFO, false);
g_assert(targets);
- const TargetInfo *first_ti = TARGET_INFO_CLASS(targets->data)->target_info;
- target_info_qom_set_target_info(first_ti);
-
- /* register all types */
- module_call_init(MODULE_INIT_QOM);
/* trigger type_initialize for all types */
object_class_get_list("", false);
+
+ g_assert_true(targets == target_info_qom_get_targets());
}
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
+ target_info_qom_init();
+ targets = target_info_qom_get_targets();
+
+ const TargetInfo *first_ti = TARGET_INFO_CLASS(targets->data)->target_info;
+ target_info_qom_set_target_info(first_ti);
+
+ /* register all types */
+ module_call_init(MODULE_INIT_QOM);
+
g_test_add_func("/multi-targets/qom-types-are-unique",
test_qom_types_are_unique);
return g_test_run();
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 08/34] hw: add MachineClass::targets with a usage and test
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (6 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 07/34] target-info: prepare the QOM target list before module_call_init(MODULE_INIT_QOM) Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 09/34] accel: register CPU parent for each target Yonggang Luo
` (7 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
Add a target bitmask to MachineClass, defaulting to QEMU_ARCH_ALL.
Update "clipper" machine as a demo/test
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
hw/alpha/dp264.c | 2 ++
hw/core/machine.c | 3 +++
include/hw/core/boards.h | 6 ++++++
tests/unit/test-multi-target.c | 33 ++++++++++++++++++++++++++++++++-
4 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index f928e0cee82..6be573c88bc 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -7,6 +7,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/base-arch-defs.h"
#include "target/alpha/cpu.h"
#include "exec/target_page.h"
#include "elf.h"
@@ -203,6 +204,7 @@ static void clipper_init(MachineState *machine)
static void clipper_machine_init(MachineClass *mc)
{
+ mc->targets = QEMU_ARCH_ALPHA;
mc->desc = "Alpha DP264/CLIPPER";
mc->init = clipper_init;
mc->block_default_type = IF_IDE;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index d9ac4b419a3..5c6f3cb0f68 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -11,6 +11,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/base-arch-defs.h"
#include "qemu/units.h"
#include "qemu/accel.h"
#include "system/replay.h"
@@ -1068,6 +1069,8 @@ static void machine_class_init(ObjectClass *oc, const void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ mc->targets = QEMU_ARCH_ALL;
+
/* Default 128 MB as guest ram size */
mc->default_ram_size = 128 * MiB;
mc->rom_file_has_mr = true;
diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h
index d0e4ad98201..d7713c45836 100644
--- a/include/hw/core/boards.h
+++ b/include/hw/core/boards.h
@@ -186,6 +186,11 @@ typedef struct {
* MachineClass:
* @deprecation_reason: If set, the machine is marked as deprecated. The
* string should provide some clear information about what to use instead.
+ * @targets: bitmask of EmuTarget values supported by this machine. Each
+ * target is represented by QEMU_ARCH_BIT(EMU_TARGET_*).
+ * QEMU_ARCH_* masks may be used when the machine supports every target
+ * in that architecture family. Defaults to QEMU_ARCH_ALL; machines that
+ * support a narrower set of targets should declare that set explicitly.
* @max_cpus: maximum number of CPUs supported. Default: 1
* @min_cpus: minimum number of CPUs supported. Default: 1
* @default_cpus: number of CPUs instantiated if none are specified. Default: 1
@@ -273,6 +278,7 @@ struct MachineClass {
const char *alias;
const char *desc;
const char *deprecation_reason;
+ uint64_t targets;
void (*init)(MachineState *state);
void (*reset)(MachineState *state, ResetType type);
diff --git a/tests/unit/test-multi-target.c b/tests/unit/test-multi-target.c
index a91fe8e6d07..c2922e0fed5 100644
--- a/tests/unit/test-multi-target.c
+++ b/tests/unit/test-multi-target.c
@@ -13,6 +13,8 @@
*/
#include "qemu/osdep.h"
+#include "hw/core/boards.h"
+#include "qemu/base-arch-defs.h"
#include "qemu/module.h"
#include "qemu/target-info.h"
#include "qemu/target-info-qom.h"
@@ -32,6 +34,17 @@ int (*qemu_main)(void);
static GSList *targets;
+static bool target_arch_available(uint64_t arch_mask)
+{
+ for (GSList *l = targets; l; l = l->next) {
+ const TargetInfo *ti = TARGET_INFO_CLASS(l->data)->target_info;
+ if (QEMU_ARCH_BIT(ti->target_arch) & arch_mask) {
+ return true;
+ }
+ }
+ return false;
+}
+
static void test_qom_types_are_unique(void)
{
g_assert(targets);
@@ -41,6 +54,22 @@ static void test_qom_types_are_unique(void)
g_assert_true(targets == target_info_qom_get_targets());
}
+static void test_machine_targets(void)
+{
+ ObjectClass *oc;
+
+ oc = object_class_by_name(TYPE_MACHINE);
+ g_assert_nonnull(oc);
+ g_assert_cmpuint(MACHINE_CLASS(oc)->targets, ==, QEMU_ARCH_ALL);
+
+ if (target_arch_available(QEMU_ARCH_ALPHA)) {
+ oc = object_class_by_name(MACHINE_TYPE_NAME("clipper"));
+ g_assert_nonnull(oc);
+ g_assert_cmpuint(MACHINE_CLASS(oc)->targets, ==,
+ QEMU_ARCH_BIT(EMU_TARGET_ALPHA));
+ }
+}
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -54,6 +83,8 @@ int main(int argc, char **argv)
module_call_init(MODULE_INIT_QOM);
g_test_add_func("/multi-targets/qom-types-are-unique",
- test_qom_types_are_unique);
+ test_qom_types_are_unique);
+ g_test_add_func("/multi-targets/machine-targets",
+ test_machine_targets);
return g_test_run();
}
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 09/34] accel: register CPU parent for each target
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (7 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 08/34] hw: add MachineClass::targets with a usage and test Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 10/34] meson: collect Rust crates for combined system target Yonggang Luo
` (6 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
Now we need use the prepared target-list to register different accel-$cpu_type
parent QOM type. So that multi-target won't error missing parent for different
accel for different arch.
Also add a test for it in test-multi-target.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
accel/accel-common.c | 6 ++----
accel/accel-internal.h | 1 +
accel/accel-system.c | 24 ++++++++++++++++++++++++
accel/accel-user.c | 7 +++++++
tests/unit/test-multi-target.c | 15 +++++++++++++++
5 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/accel/accel-common.c b/accel/accel-common.c
index 00a400243f0..0f4e202d8f8 100644
--- a/accel/accel-common.c
+++ b/accel/accel-common.c
@@ -130,9 +130,9 @@ static const TypeInfo accel_types[] = {
DEFINE_TYPES(accel_types)
-static void register_accel_target_type(void)
+void accel_register_cpu_type(const char *cpu_type)
{
- g_autofree char *name = g_strconcat("accel-", target_cpu_type(), NULL);
+ g_autofree char *name = g_strconcat("accel-", cpu_type, NULL);
const TypeInfo accel_cpu_type = {
.name = name,
.parent = TYPE_OBJECT,
@@ -142,5 +142,3 @@ static void register_accel_target_type(void)
type_register_static(&accel_cpu_type);
}
-
-type_init(register_accel_target_type);
diff --git a/accel/accel-internal.h b/accel/accel-internal.h
index d3a4422cbf7..2b6f58526d3 100644
--- a/accel/accel-internal.h
+++ b/accel/accel-internal.h
@@ -13,5 +13,6 @@
#include "qemu/accel.h"
void accel_init_ops_interfaces(AccelClass *ac);
+void accel_register_cpu_type(const char *cpu_type);
#endif /* ACCEL_SYSTEM_H */
diff --git a/accel/accel-system.c b/accel/accel-system.c
index 1325b23864c..fdfa85179ee 100644
--- a/accel/accel-system.c
+++ b/accel/accel-system.c
@@ -25,6 +25,8 @@
#include "qemu/osdep.h"
#include "qemu/accel.h"
+#include "qemu/target-info-def.h"
+#include "qemu/target-info-qom.h"
#include "qom/compat-properties.h"
#include "qapi/qapi-commands-accelerator.h"
#include "monitor/monitor.h"
@@ -32,6 +34,7 @@
#include "hw/core/boards.h"
#include "hw/core/cpu.h"
#include "accel/accel-ops.h"
+#include "accel/accel-cpu.h"
#include "accel/accel-cpu-ops.h"
#include "system/cpus.h"
#include "qemu/error-report.h"
@@ -124,6 +127,27 @@ static const TypeInfo accel_ops_type_info = {
static void accel_system_register_types(void)
{
+ GSList *targets = target_info_qom_get_targets();
+ const TargetInfo *ti, *prev_ti;
+
type_register_static(&accel_ops_type_info);
+
+ for (GSList *l = targets; l; l = l->next) {
+ bool duplicate = false;
+
+ ti = TARGET_INFO_CLASS(l->data)->target_info;
+ for (GSList *prev = targets; prev != l; prev = prev->next) {
+ prev_ti = TARGET_INFO_CLASS(prev->data)->target_info;
+ if (g_str_equal(prev_ti->cpu_type, ti->cpu_type)) {
+ duplicate = true;
+ break;
+ }
+ }
+ if (duplicate) {
+ continue;
+ }
+
+ accel_register_cpu_type(ti->cpu_type);
+ }
}
type_init(accel_system_register_types);
diff --git a/accel/accel-user.c b/accel/accel-user.c
index 7d192306a65..85ede70e5bd 100644
--- a/accel/accel-user.c
+++ b/accel/accel-user.c
@@ -9,8 +9,15 @@
#include "qemu/osdep.h"
#include "qemu/accel.h"
+#include "qemu/target-info.h"
#include "accel-internal.h"
+static void register_accel_target_type(void)
+{
+ accel_register_cpu_type(target_cpu_type());
+}
+type_init(register_accel_target_type);
+
void accel_init_ops_interfaces(AccelClass *ac)
{
/* nothing */
diff --git a/tests/unit/test-multi-target.c b/tests/unit/test-multi-target.c
index c2922e0fed5..704e3297ef9 100644
--- a/tests/unit/test-multi-target.c
+++ b/tests/unit/test-multi-target.c
@@ -17,6 +17,7 @@
#include "qemu/base-arch-defs.h"
#include "qemu/module.h"
#include "qemu/target-info.h"
+#include "qemu/target-info-def.h"
#include "qemu/target-info-qom.h"
#include "qom/object.h"
@@ -70,6 +71,18 @@ static void test_machine_targets(void)
}
}
+static void test_accel_cpu_parent_per_target(void)
+{
+ g_assert(targets);
+
+ for (GSList *l = targets; l; l = l->next) {
+ const TargetInfo *ti = TARGET_INFO_CLASS(l->data)->target_info;
+ g_autofree char *name = g_strconcat("accel-", ti->cpu_type, NULL);
+
+ g_assert_nonnull(object_class_by_name(name));
+ }
+}
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -86,5 +99,7 @@ int main(int argc, char **argv)
test_qom_types_are_unique);
g_test_add_func("/multi-targets/machine-targets",
test_machine_targets);
+ g_test_add_func("/multi-targets/accel-cpu-parent-per-target",
+ test_accel_cpu_parent_per_target);
return g_test_run();
}
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 10/34] meson: collect Rust crates for combined system target
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (8 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 09/34] accel: register CPU parent for each target Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 11/34] module: Add module_allow_all_arch for allow all modules be loaded Yonggang Luo
` (5 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
multi_target_crates += main_rs is not fine, that may repeat crates.
So we need collect crates from different $arch directly, and unique
them to a new list. then reuse 'rust_multi_target.rs' to generate it
properly
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
meson.build | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 3460d031a95..f54687e19dc 100644
--- a/meson.build
+++ b/meson.build
@@ -4431,7 +4431,11 @@ foreach target : target_dirs
multi_target_libs += lib
multi_target_deps += arch_deps
multi_target_deps += target_stubs
- multi_target_crates += main_rs
+ foreach crate : crates
+ if crate not in multi_target_crates
+ multi_target_crates += crate
+ endif
+ endforeach
endif
execs = [{
'name': 'qemu-system-' + target_name,
@@ -4516,6 +4520,18 @@ endforeach
# Other build targets
+# Use collected crate names, not per-target main_rs sources, for the combined root.
+if multi_target_crates.length() > 0
+ multi_target_crates = custom_target(
+ 'rust_multi_target.rs',
+ output: 'rust_multi_target.rs',
+ command: [rust_root_crate, multi_target_crates],
+ capture: true,
+ build_always_stale: true,
+ )
+ multi_target_crates = structured_sources(multi_target_crates)
+endif
+
multi_target_objects = []
foreach lib: multi_target_libs
multi_target_objects += lib.extract_all_objects(recursive: true)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 11/34] module: Add module_allow_all_arch for allow all modules be loaded
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (9 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 10/34] meson: collect Rust crates for combined system target Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 12/34] target/arm: defer max-v8 initializer selection until CPU creation Yonggang Luo
` (4 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
In multi-target qemu, we want all modules to be loaded without condition.
So add this function for latter usage.
Add this independent function for decouple only
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
include/qemu/module.h | 2 ++
util/module.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/qemu/module.h b/include/qemu/module.h
index fccf017bf9e..6268c3a8d75 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -100,6 +100,8 @@ int module_load(const char *prefix, const char *name, Error **errp);
int module_load_qom(const char *type, Error **errp);
void module_load_qom_all(void);
void module_allow_arch(const char *arch);
+/* Allow every arch-tagged module without selecting an architecture. */
+void module_allow_all_arch(void);
/**
* DOC: module info annotation macros
diff --git a/util/module.c b/util/module.c
index 8f8e6994f11..b7253fbd065 100644
--- a/util/module.c
+++ b/util/module.c
@@ -119,6 +119,7 @@ static const QemuModinfo module_info_stub[] = { {
} };
static const QemuModinfo *module_info = module_info_stub;
static const char *module_arch;
+static bool module_all_archs;
void module_init_info(const QemuModinfo *info)
{
@@ -128,11 +129,17 @@ void module_init_info(const QemuModinfo *info)
void module_allow_arch(const char *arch)
{
module_arch = arch;
+ module_all_archs = false;
+}
+
+void module_allow_all_arch(void)
+{
+ module_all_archs = true;
}
static bool module_check_arch(const QemuModinfo *modinfo)
{
- if (modinfo->arch) {
+ if (modinfo->arch && !module_all_archs) {
if (!module_arch) {
/* no arch set -> ignore all */
return false;
@@ -400,6 +407,7 @@ const QemuModinfo qemu_modinfo[] = {};
void module_init_info(const QemuModinfo *info) {}
void module_allow_arch(const char *arch) {}
+void module_allow_all_arch(void) {}
void qemu_load_module_for_opts(const char *group) {}
int module_load(const char *prefix, const char *name, Error **errp) { return 2; }
int module_load_qom(const char *type, Error **errp) { return 2; }
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 12/34] target/arm: defer max-v8 initializer selection until CPU creation
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (10 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 11/34] module: Add module_allow_all_arch for allow all modules be loaded Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 13/34] hw/microblaze: defer PetaLogix endianness default until init Yonggang Luo
` (3 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This is for avoid "max-v8" qom name conflict in multi-target qemu
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
target/arm/tcg/cpu-max-v8.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/target/arm/tcg/cpu-max-v8.c b/target/arm/tcg/cpu-max-v8.c
index 65f851f2006..d7323ab431c 100644
--- a/target/arm/tcg/cpu-max-v8.c
+++ b/target/arm/tcg/cpu-max-v8.c
@@ -119,12 +119,21 @@ void aarch32_max_v8_tcg_initfn(Object *obj)
#endif
}
+static void max_v8_tcg_initfn(Object *obj)
+{
+ if (target_aarch64()) {
+ aarch64_max_v8_tcg_initfn(obj);
+ } else {
+ aarch32_max_v8_tcg_initfn(obj);
+ }
+}
+
static void cpu_max_v8_register_type(void)
{
- static const ARMCPUInfo max_v8[2] = {
- { .name = "max-v8", .initfn = aarch32_max_v8_tcg_initfn },
- { .name = "max-v8", .initfn = aarch64_max_v8_tcg_initfn },
+ static const ARMCPUInfo max_v8 = {
+ .name = "max-v8",
+ .initfn = max_v8_tcg_initfn,
};
- arm_cpu_register(&max_v8[target_aarch64()]);
+ arm_cpu_register(&max_v8);
}
type_init(cpu_max_v8_register_type)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 13/34] hw/microblaze: defer PetaLogix endianness default until init
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (11 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 12/34] target/arm: defer max-v8 initializer selection until CPU creation Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 14/34] hw/pci: Avoid guard loadparm with target_s390x() for s390x in class_init Yonggang Luo
` (2 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This is for avoid call target_info() in class_init
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
hw/microblaze/petalogix_s3adsp1800_mmu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
index c5f64319009..43140ad7bda 100644
--- a/hw/microblaze/petalogix_s3adsp1800_mmu.c
+++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c
@@ -83,7 +83,13 @@ petalogix_s3adsp1800_init(MachineState *machine)
MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
qemu_irq irq[32];
MemoryRegion *sysmem = get_system_memory();
- EndianMode endianness = psms->endianness;
+ EndianMode endianness;
+
+ if (psms->endianness == ENDIAN_MODE_UNSPECIFIED) {
+ psms->endianness = target_big_endian() ? ENDIAN_MODE_BIG :
+ ENDIAN_MODE_LITTLE;
+ }
+ endianness = psms->endianness;
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort);
@@ -178,8 +184,7 @@ static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc,
&EndianMode_lookup,
machine_get_endianness,
machine_set_endianness);
- object_property_set_default_str(prop, target_big_endian() ? "big"
- : "little");
+ object_property_set_default_str(prop, "unspecified");
object_class_property_set_description(oc, "endianness",
"Defines whether the machine runs in big or little endian mode");
}
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 14/34] hw/pci: Avoid guard loadparm with target_s390x() for s390x in class_init
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (12 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 13/34] hw/microblaze: defer PetaLogix endianness default until init Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 15/34] hw/scsi: " Yonggang Luo
2026-10-14 17:35 ` [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Pierrick Bouvier
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This is for avoid call target_info() in class_init.
Now we directly guard in pci_qdev_property_set_loadparm instead.
Don't know if its an API break, but the smallest change.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
hw/pci/pci.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 0efb4eb4bb0..9d3dcd52942 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2878,6 +2878,11 @@ static void pci_qdev_property_set_loadparm(Object *obj, const char *value,
{
void *lp_str;
+ if (!target_s390x()) {
+ error_setg(errp, "'loadparm' is only supported on s390x");
+ return;
+ }
+
if (object_property_get_int(obj, "bootindex", NULL) < 0) {
error_setg(errp, "'loadparm' is only valid for boot devices");
return;
@@ -2895,14 +2900,11 @@ void pci_qdev_property_add_specifics(DeviceClass *dc)
{
ObjectClass *oc = OBJECT_CLASS(dc);
- /* The loadparm property is only supported on s390x */
- if (target_s390x()) {
- object_class_property_add_str(oc, "loadparm",
- pci_qdev_property_get_loadparm,
- pci_qdev_property_set_loadparm);
- object_class_property_set_description(oc, "loadparm",
- "load parameter (s390x only)");
- }
+ object_class_property_add_str(oc, "loadparm",
+ pci_qdev_property_get_loadparm,
+ pci_qdev_property_set_loadparm);
+ object_class_property_set_description(oc, "loadparm",
+ "load parameter (s390x only)");
}
MemoryRegion *pci_address_space(PCIDevice *dev)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 15/34] hw/scsi: Avoid guard loadparm with target_s390x() for s390x in class_init
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (13 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 14/34] hw/pci: Avoid guard loadparm with target_s390x() for s390x in class_init Yonggang Luo
@ 2026-10-14 9:31 ` Yonggang Luo
2026-10-14 17:35 ` [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Pierrick Bouvier
15 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 9:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Philippe Mathieu-Daudé,
Daniel Henrique Barboza, Palmer Dabbelt, qemu-arm, Chao Liu,
Philippe Mathieu-Daude, Jiaxun Yang, Max Filippov,
Stefano Garzarella
This is for avoid call target_info() in class_init.
Now we directly guard in scsi_property_set_loadparm instead.
Don't know if its an API break, but the smallest change.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
hw/scsi/scsi-disk.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index deb33ac1dda..276941ae537 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -3179,6 +3179,11 @@ static void scsi_property_set_loadparm(Object *obj, const char *value,
{
void *lp_str;
+ if (!target_s390x()) {
+ error_setg(errp, "'loadparm' is only supported on s390x");
+ return;
+ }
+
if (object_property_get_int(obj, "bootindex", NULL) < 0) {
error_setg(errp, "'loadparm' is only valid for boot devices");
return;
@@ -3196,14 +3201,11 @@ static void scsi_property_add_specifics(DeviceClass *dc)
{
ObjectClass *oc = OBJECT_CLASS(dc);
- /* The loadparm property is only supported on s390x */
- if (target_s390x()) {
- object_class_property_add_str(oc, "loadparm",
- scsi_property_get_loadparm,
- scsi_property_set_loadparm);
- object_class_property_set_description(oc, "loadparm",
- "load parameter (s390x only)");
- }
+ object_class_property_add_str(oc, "loadparm",
+ scsi_property_get_loadparm,
+ scsi_property_set_loadparm);
+ object_class_property_set_description(oc, "loadparm",
+ "load parameter (s390x only)");
}
static void scsi_disk_base_class_initfn(ObjectClass *klass, const void *data)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 9:31 ` [PATCH 05/34] qapi: add missing Linux user-mode targets " Yonggang Luo
@ 2026-10-14 10:24 ` Philippe Mathieu-Daudé
2026-10-14 10:30 ` Daniel P. Berrangé
2026-10-14 10:46 ` Yonggang Luo
2026-10-14 17:26 ` Pierrick Bouvier
1 sibling, 2 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-10-14 10:24 UTC (permalink / raw)
To: Yonggang Luo, qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Daniel Henrique Barboza, Palmer Dabbelt,
qemu-arm, Chao Liu, Philippe Mathieu-Daude, Jiaxun Yang,
Max Filippov, Stefano Garzarella
On 14/10/26 11:31, Yonggang Luo wrote:
> This usermode targets:
> aarch64_be
> armeb
> microblazeel
> mipsn32
> mipsn32el
> ppc64le
> sparc32plus
> are not in machine.json
>
> This is a prepare for directly using TARGET_ARCH_VARIANT latter.
>
> Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
> So that we can define TARGET_ARCH_VARIANT to target_name directly
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> include/qemu/base-arch-defs.h | 13 +++++++++++++
> qapi/machine.json | 25 +++++++++++++------------
> target-info.c | 26 +++++++++-----------------
> 3 files changed, 35 insertions(+), 29 deletions(-)
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 07fac4f0764..a3d6e08a847 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -15,11 +15,10 @@
>
> ##
> # @EmuTarget:
> -# The comprehensive enumeration of QEMU system emulation
> -# ("softmmu") targets. Run "./configure --help" in the project
> -# root directory, and look for the \*-softmmu targets near the
> -# "--target-list" option. The individual target constants are not
> -# documented here, for the time being.
> +# The comprehensive enumeration of QEMU system and user-mode
> +# emulation targets. Run "./configure --help" in the project root
> +# directory, and look for the targets near the "--target-list"
> +# option. Individual target constants are not documented here.
> #
> # @rx: since 5.0
> #
> @@ -30,17 +29,19 @@
> # @hexagon: since 11.0
> #
> # .. note:: The resulting QMP strings can be appended to the
> -# "qemu-system-" prefix to produce the corresponding QEMU
> -# executable name. This is true even for "qemu-system-x86_64".
> +# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
> +# for user-mode emulation, to produce the corresponding executable
> +# name, where that target supports the respective emulation mode.
> #
> # Since: 3.0
> ##
> { 'enum' : 'EmuTarget',
> - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> - 'mips64el', 'mipsel', 'or1k', 'ppc',
> - 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
> - 'sh4eb', 'sparc', 'sparc64', 'tricore',
> + 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
> + 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
> + 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
> + 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
> + 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
> + 'sparc32plus', 'sparc64', 'tricore',
> 'x86_64', 'xtensa', 'xtensaeb' ] }
'machine.json' is for system binaries.
If we want to expose these QAPI types to the user binaries
(I'm not sure we want...) then this declaration block should
be moved in another {qapi}.json file. QAPI types are versioned,
so we'd need some " @aarch64_be # Since v13.0" comments.
Anyway I doubt we want to alter EmuTarget, I'd rather let it
die as a legacy field, and expose {arch, wordsize, endianness}
to management layer if this is important to consume.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 10:24 ` Philippe Mathieu-Daudé
@ 2026-10-14 10:30 ` Daniel P. Berrangé
2026-10-14 10:45 ` Philippe Mathieu-Daudé
2026-10-14 10:46 ` Yonggang Luo
1 sibling, 1 reply; 25+ messages in thread
From: Daniel P. Berrangé @ 2026-10-14 10:30 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Yonggang Luo, qemu-devel, Eric Blake, qemu-riscv,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Daniel Henrique Barboza, Palmer Dabbelt,
qemu-arm, Chao Liu, Philippe Mathieu-Daude, Jiaxun Yang,
Max Filippov, Stefano Garzarella
On Wed, Oct 14, 2026 at 12:24:57PM +0200, Philippe Mathieu-Daudé wrote:
> On 14/10/26 11:31, Yonggang Luo wrote:
> > This usermode targets:
> > aarch64_be
> > armeb
> > microblazeel
> > mipsn32
> > mipsn32el
> > ppc64le
> > sparc32plus
> > are not in machine.json
> >
> > This is a prepare for directly using TARGET_ARCH_VARIANT latter.
> >
> > Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
> > So that we can define TARGET_ARCH_VARIANT to target_name directly
> >
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > ---
> > include/qemu/base-arch-defs.h | 13 +++++++++++++
> > qapi/machine.json | 25 +++++++++++++------------
> > target-info.c | 26 +++++++++-----------------
> > 3 files changed, 35 insertions(+), 29 deletions(-)
>
>
> > diff --git a/qapi/machine.json b/qapi/machine.json
> > index 07fac4f0764..a3d6e08a847 100644
> > --- a/qapi/machine.json
> > +++ b/qapi/machine.json
> > @@ -15,11 +15,10 @@
> > ##
> > # @EmuTarget:
> > -# The comprehensive enumeration of QEMU system emulation
> > -# ("softmmu") targets. Run "./configure --help" in the project
> > -# root directory, and look for the \*-softmmu targets near the
> > -# "--target-list" option. The individual target constants are not
> > -# documented here, for the time being.
> > +# The comprehensive enumeration of QEMU system and user-mode
> > +# emulation targets. Run "./configure --help" in the project root
> > +# directory, and look for the targets near the "--target-list"
> > +# option. Individual target constants are not documented here.
> > #
> > # @rx: since 5.0
> > #
> > @@ -30,17 +29,19 @@
> > # @hexagon: since 11.0
> > #
> > # .. note:: The resulting QMP strings can be appended to the
> > -# "qemu-system-" prefix to produce the corresponding QEMU
> > -# executable name. This is true even for "qemu-system-x86_64".
> > +# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
> > +# for user-mode emulation, to produce the corresponding executable
> > +# name, where that target supports the respective emulation mode.
> > #
> > # Since: 3.0
> > ##
> > { 'enum' : 'EmuTarget',
> > - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> > - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> > - 'mips64el', 'mipsel', 'or1k', 'ppc',
> > - 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
> > - 'sh4eb', 'sparc', 'sparc64', 'tricore',
> > + 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
> > + 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
> > + 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
> > + 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
> > + 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
> > + 'sparc32plus', 'sparc64', 'tricore',
> > 'x86_64', 'xtensa', 'xtensaeb' ] }
>
> 'machine.json' is for system binaries.
>
> If we want to expose these QAPI types to the user binaries
> (I'm not sure we want...) then this declaration block should
> be moved in another {qapi}.json file. QAPI types are versioned,
> so we'd need some " @aarch64_be # Since v13.0" comments.
>
> Anyway I doubt we want to alter EmuTarget, I'd rather let it
> die as a legacy field, and expose {arch, wordsize, endianness}
> to management layer if this is important to consume.
Libvirt uses query-target so we don't want that data to go away.
If we want to expose other data alongside the target name that's
fine.
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 10:30 ` Daniel P. Berrangé
@ 2026-10-14 10:45 ` Philippe Mathieu-Daudé
2026-10-14 10:48 ` Yonggang Luo
0 siblings, 1 reply; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-10-14 10:45 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: Yonggang Luo, qemu-devel, Eric Blake, qemu-riscv,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Daniel Henrique Barboza, Palmer Dabbelt,
qemu-arm, Chao Liu, Philippe Mathieu-Daude, Jiaxun Yang,
Max Filippov, Stefano Garzarella
On 14/10/26 12:30, Daniel P. Berrangé wrote:
> On Wed, Oct 14, 2026 at 12:24:57PM +0200, Philippe Mathieu-Daudé wrote:
>> On 14/10/26 11:31, Yonggang Luo wrote:
>>> This usermode targets:
>>> aarch64_be
>>> armeb
>>> microblazeel
>>> mipsn32
>>> mipsn32el
>>> ppc64le
>>> sparc32plus
>>> are not in machine.json
>>>
>>> This is a prepare for directly using TARGET_ARCH_VARIANT latter.
>>>
>>> Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
>>> So that we can define TARGET_ARCH_VARIANT to target_name directly
>>>
>>> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
>>> ---
>>> include/qemu/base-arch-defs.h | 13 +++++++++++++
>>> qapi/machine.json | 25 +++++++++++++------------
>>> target-info.c | 26 +++++++++-----------------
>>> 3 files changed, 35 insertions(+), 29 deletions(-)
>>
>>
>>> diff --git a/qapi/machine.json b/qapi/machine.json
>>> index 07fac4f0764..a3d6e08a847 100644
>>> --- a/qapi/machine.json
>>> +++ b/qapi/machine.json
>>> @@ -15,11 +15,10 @@
>>> ##
>>> # @EmuTarget:
>>> -# The comprehensive enumeration of QEMU system emulation
>>> -# ("softmmu") targets. Run "./configure --help" in the project
>>> -# root directory, and look for the \*-softmmu targets near the
>>> -# "--target-list" option. The individual target constants are not
>>> -# documented here, for the time being.
>>> +# The comprehensive enumeration of QEMU system and user-mode
>>> +# emulation targets. Run "./configure --help" in the project root
>>> +# directory, and look for the targets near the "--target-list"
>>> +# option. Individual target constants are not documented here.
>>> #
>>> # @rx: since 5.0
>>> #
>>> @@ -30,17 +29,19 @@
>>> # @hexagon: since 11.0
>>> #
>>> # .. note:: The resulting QMP strings can be appended to the
>>> -# "qemu-system-" prefix to produce the corresponding QEMU
>>> -# executable name. This is true even for "qemu-system-x86_64".
>>> +# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
>>> +# for user-mode emulation, to produce the corresponding executable
>>> +# name, where that target supports the respective emulation mode.
>>> #
>>> # Since: 3.0
>>> ##
>>> { 'enum' : 'EmuTarget',
>>> - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
>>> - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
>>> - 'mips64el', 'mipsel', 'or1k', 'ppc',
>>> - 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
>>> - 'sh4eb', 'sparc', 'sparc64', 'tricore',
>>> + 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
>>> + 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
>>> + 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
>>> + 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
>>> + 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
>>> + 'sparc32plus', 'sparc64', 'tricore',
>>> 'x86_64', 'xtensa', 'xtensaeb' ] }
>>
>> 'machine.json' is for system binaries.
>>
>> If we want to expose these QAPI types to the user binaries
>> (I'm not sure we want...) then this declaration block should
>> be moved in another {qapi}.json file. QAPI types are versioned,
>> so we'd need some " @aarch64_be # Since v13.0" comments.
>>
>> Anyway I doubt we want to alter EmuTarget, I'd rather let it
>> die as a legacy field, and expose {arch, wordsize, endianness}
>> to management layer if this is important to consume.
>
> Libvirt uses query-target so we don't want that data to go away.
> If we want to expose other data alongside the target name that's
> fine.
I'm not suggesting to change 'query-target' format; the opposite...
If we are going to add 'query-targets' (the plural form) then we
should report something more useful like {arch, wordsize, endianness}
but not that EmuTarget type which I consider legacy.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 10:24 ` Philippe Mathieu-Daudé
2026-10-14 10:30 ` Daniel P. Berrangé
@ 2026-10-14 10:46 ` Yonggang Luo
1 sibling, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 10:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Daniel Henrique Barboza, Palmer Dabbelt,
qemu-arm, Chao Liu, Philippe Mathieu-Daude, Jiaxun Yang,
Max Filippov, Stefano Garzarella
On Wed, Oct 14, 2026 at 6:25 PM Philippe Mathieu-Daudé
<philmd@oss.qualcomm.com> wrote:
>
> On 14/10/26 11:31, Yonggang Luo wrote:
> > This usermode targets:
> > aarch64_be
> > armeb
> > microblazeel
> > mipsn32
> > mipsn32el
> > ppc64le
> > sparc32plus
> > are not in machine.json
> >
> > This is a prepare for directly using TARGET_ARCH_VARIANT latter.
> >
> > Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
> > So that we can define TARGET_ARCH_VARIANT to target_name directly
> >
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > ---
> > include/qemu/base-arch-defs.h | 13 +++++++++++++
> > qapi/machine.json | 25 +++++++++++++------------
> > target-info.c | 26 +++++++++-----------------
> > 3 files changed, 35 insertions(+), 29 deletions(-)
>
>
> > diff --git a/qapi/machine.json b/qapi/machine.json
> > index 07fac4f0764..a3d6e08a847 100644
> > --- a/qapi/machine.json
> > +++ b/qapi/machine.json
> > @@ -15,11 +15,10 @@
> >
> > ##
> > # @EmuTarget:
> > -# The comprehensive enumeration of QEMU system emulation
> > -# ("softmmu") targets. Run "./configure --help" in the project
> > -# root directory, and look for the \*-softmmu targets near the
> > -# "--target-list" option. The individual target constants are not
> > -# documented here, for the time being.
> > +# The comprehensive enumeration of QEMU system and user-mode
> > +# emulation targets. Run "./configure --help" in the project root
> > +# directory, and look for the targets near the "--target-list"
> > +# option. Individual target constants are not documented here.
> > #
> > # @rx: since 5.0
> > #
> > @@ -30,17 +29,19 @@
> > # @hexagon: since 11.0
> > #
> > # .. note:: The resulting QMP strings can be appended to the
> > -# "qemu-system-" prefix to produce the corresponding QEMU
> > -# executable name. This is true even for "qemu-system-x86_64".
> > +# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
> > +# for user-mode emulation, to produce the corresponding executable
> > +# name, where that target supports the respective emulation mode.
> > #
> > # Since: 3.0
> > ##
> > { 'enum' : 'EmuTarget',
> > - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> > - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> > - 'mips64el', 'mipsel', 'or1k', 'ppc',
> > - 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
> > - 'sh4eb', 'sparc', 'sparc64', 'tricore',
> > + 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
> > + 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
> > + 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
> > + 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
> > + 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
> > + 'sparc32plus', 'sparc64', 'tricore',
> > 'x86_64', 'xtensa', 'xtensaeb' ] }
>
> 'machine.json' is for system binaries.
>
> If we want to expose these QAPI types to the user binaries
> (I'm not sure we want...) then this declaration block should
> be moved in another {qapi}.json file. QAPI types are versioned,
OK,
> so we'd need some " @aarch64_be # Since v13.0" comments.
>
> Anyway I doubt we want to alter EmuTarget, I'd rather let it
> die as a legacy field, and expose {arch, wordsize, endianness}
Are you talking about base_arch? that won't work(we need mapping to
the EmuTarget to select the $target directly)
What the advantage of EmuTarget is that we can have a one-to-one
mapping from EmuTarget to TargetInfo
That each EmuTarget only mapping to a single TargetInfo, so we can
reliably choose TargetInfo from EmuTarget
that is one item of data
Hi Philippe
rationale:
https://lore.kernel.org/qemu-devel/87e7c5ae-c78c-4a47-b9ba-9851ce5757d9@oss.qualcomm.com/
This was tried before and rejected.
> to management layer if this is important to consume.
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 10:45 ` Philippe Mathieu-Daudé
@ 2026-10-14 10:48 ` Yonggang Luo
0 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 10:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Daniel P. Berrangé, qemu-devel, Eric Blake, qemu-riscv,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Pierrick Bouvier, Fam Zheng,
Edgar E. Iglesias, Daniel Henrique Barboza, Palmer Dabbelt,
qemu-arm, Chao Liu, Philippe Mathieu-Daude, Jiaxun Yang,
Max Filippov, Stefano Garzarella
On Wed, Oct 14, 2026 at 6:45 PM Philippe Mathieu-Daudé
<philmd@oss.qualcomm.com> wrote:
>
> On 14/10/26 12:30, Daniel P. Berrangé wrote:
> > On Wed, Oct 14, 2026 at 12:24:57PM +0200, Philippe Mathieu-Daudé wrote:
> >> On 14/10/26 11:31, Yonggang Luo wrote:
> >>> This usermode targets:
> >>> aarch64_be
> >>> armeb
> >>> microblazeel
> >>> mipsn32
> >>> mipsn32el
> >>> ppc64le
> >>> sparc32plus
> >>> are not in machine.json
> >>>
> >>> This is a prepare for directly using TARGET_ARCH_VARIANT latter.
> >>>
> >>> Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
> >>> So that we can define TARGET_ARCH_VARIANT to target_name directly
> >>>
> >>> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> >>> ---
> >>> include/qemu/base-arch-defs.h | 13 +++++++++++++
> >>> qapi/machine.json | 25 +++++++++++++------------
> >>> target-info.c | 26 +++++++++-----------------
> >>> 3 files changed, 35 insertions(+), 29 deletions(-)
> >>
> >>
> >>> diff --git a/qapi/machine.json b/qapi/machine.json
> >>> index 07fac4f0764..a3d6e08a847 100644
> >>> --- a/qapi/machine.json
> >>> +++ b/qapi/machine.json
> >>> @@ -15,11 +15,10 @@
> >>> ##
> >>> # @EmuTarget:
> >>> -# The comprehensive enumeration of QEMU system emulation
> >>> -# ("softmmu") targets. Run "./configure --help" in the project
> >>> -# root directory, and look for the \*-softmmu targets near the
> >>> -# "--target-list" option. The individual target constants are not
> >>> -# documented here, for the time being.
> >>> +# The comprehensive enumeration of QEMU system and user-mode
> >>> +# emulation targets. Run "./configure --help" in the project root
> >>> +# directory, and look for the targets near the "--target-list"
> >>> +# option. Individual target constants are not documented here.
> >>> #
> >>> # @rx: since 5.0
> >>> #
> >>> @@ -30,17 +29,19 @@
> >>> # @hexagon: since 11.0
> >>> #
> >>> # .. note:: The resulting QMP strings can be appended to the
> >>> -# "qemu-system-" prefix to produce the corresponding QEMU
> >>> -# executable name. This is true even for "qemu-system-x86_64".
> >>> +# "qemu-system-" prefix for system emulation, or the "qemu-" prefix
> >>> +# for user-mode emulation, to produce the corresponding executable
> >>> +# name, where that target supports the respective emulation mode.
> >>> #
> >>> # Since: 3.0
> >>> ##
> >>> { 'enum' : 'EmuTarget',
> >>> - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> >>> - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> >>> - 'mips64el', 'mipsel', 'or1k', 'ppc',
> >>> - 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
> >>> - 'sh4eb', 'sparc', 'sparc64', 'tricore',
> >>> + 'data' : [ 'aarch64', 'aarch64_be', 'alpha', 'arm', 'armeb', 'avr',
> >>> + 'hexagon', 'hppa', 'i386', 'loongarch64', 'm68k', 'microblaze',
> >>> + 'microblazeel', 'mips', 'mips64', 'mips64el', 'mipsel',
> >>> + 'mipsn32', 'mipsn32el', 'or1k', 'ppc', 'ppc64', 'ppc64le',
> >>> + 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', 'sh4eb', 'sparc',
> >>> + 'sparc32plus', 'sparc64', 'tricore',
> >>> 'x86_64', 'xtensa', 'xtensaeb' ] }
> >>
> >> 'machine.json' is for system binaries.
> >>
> >> If we want to expose these QAPI types to the user binaries
> >> (I'm not sure we want...) then this declaration block should
> >> be moved in another {qapi}.json file. QAPI types are versioned,
> >> so we'd need some " @aarch64_be # Since v13.0" comments.
> >>
> >> Anyway I doubt we want to alter EmuTarget, I'd rather let it
> >> die as a legacy field, and expose {arch, wordsize, endianness}
> >> to management layer if this is important to consume.
> >
> > Libvirt uses query-target so we don't want that data to go away.
> > If we want to expose other data alongside the target name that's
> > fine.
>
> I'm not suggesting to change 'query-target' format; the opposite...
> If we are going to add 'query-targets' (the plural form) then we
> should report something more useful like {arch, wordsize, endianness}
> but not that EmuTarget type which I consider legacy.
I think it should be moved to qapi.json. As I needed it, do you have a better
way to have an enum for mapping target-name to that enum?
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget
2026-10-14 9:31 ` [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget Yonggang Luo
@ 2026-10-14 11:24 ` Markus Armbruster
2026-10-14 12:18 ` Yonggang Luo
0 siblings, 1 reply; 25+ messages in thread
From: Markus Armbruster @ 2026-10-14 11:24 UTC (permalink / raw)
To: Yonggang Luo
Cc: qemu-devel, Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, David Hildenbrand,
Laurent Vivier, Pierrick Bouvier, Fam Zheng, Edgar E. Iglesias,
Philippe Mathieu-Daudé, Daniel Henrique Barboza,
Palmer Dabbelt, qemu-arm, Chao Liu, Philippe Mathieu-Daude,
Jiaxun Yang, Max Filippov, Stefano Garzarella
Yonggang Luo <luoyonggang@gmail.com> writes:
> As now it's also expressing user-mode targets.
>
> This changes the type name exposed by query-qmp-schema; enum values and
> serialized target values remain unchanged.
Are you sure? query-qmp-schema masks the type names.
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
[...]
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 9b145c635ba..07fac4f0764 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -14,7 +14,7 @@
> { 'include': 'machine-common.json' }
>
> ##
> -# @SysEmuTarget:
> +# @EmuTarget:
> # The comprehensive enumeration of QEMU system emulation
> # ("softmmu") targets. Run "./configure --help" in the project
> # root directory, and look for the \*-softmmu targets near the
# "--target-list" option. The individual target constants are not
# documented here, for the time being.
Is this still correct?
> @@ -35,7 +35,7 @@
> #
> # Since: 3.0
> ##
> -{ 'enum' : 'SysEmuTarget',
> +{ 'enum' : 'EmuTarget',
> 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> 'mips64el', 'mipsel', 'or1k', 'ppc',
> @@ -95,7 +95,7 @@
> 'qom-path' : 'str',
> 'thread-id' : 'int',
> '*props' : 'CpuInstanceProperties',
> - 'target' : 'SysEmuTarget' },
> + 'target' : 'EmuTarget' },
> 'discriminator' : 'target',
> 'data' : { 's390x' : 'CpuInfoS390' } }
>
> @@ -281,7 +281,7 @@
> # Since: 1.2
> ##
> { 'struct': 'QemuTargetInfo',
> - 'data': { 'arch': 'SysEmuTarget' } }
> + 'data': { 'arch': 'EmuTarget' } }
>
> ##
> # @query-target:
> diff --git a/qapi/pragma.json b/qapi/pragma.json
> index 342cedc42e7..93a710ee937 100644
> --- a/qapi/pragma.json
> +++ b/qapi/pragma.json
> @@ -72,7 +72,7 @@
> 'SsidSizeMode',
> 'String',
> 'StringWrapper',
> - 'SysEmuTarget',
> + 'EmuTarget',
> 'ThrottleGroupProperties',
> 'VncPrimaryAuth',
> 'VncVencryptSubAuth',
> @@ -109,7 +109,7 @@
> 'QKeyCode', # send-key, input-sent-event
> 'QapiErrorClass', # QMP error replies
> 'SshHostKeyCheckMode', # blockdev-add, -blockdev
> - 'SysEmuTarget', # query-cpu-fast, query-target
> + 'EmuTarget', # query-cpu-fast, query-target
> 'UuidInfo', # query-uuid
> 'VncClientInfo', # query-vnc, query-vnc-servers, ...
> 'X86CPURegister32' # qom-get of x86 CPU properties
[...]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget
2026-10-14 11:24 ` Markus Armbruster
@ 2026-10-14 12:18 ` Yonggang Luo
0 siblings, 0 replies; 25+ messages in thread
From: Yonggang Luo @ 2026-10-14 12:18 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, David Hildenbrand,
Laurent Vivier, Pierrick Bouvier, Fam Zheng, Edgar E. Iglesias,
Philippe Mathieu-Daudé, Daniel Henrique Barboza,
Palmer Dabbelt, qemu-arm, Chao Liu, Philippe Mathieu-Daude,
Jiaxun Yang, Max Filippov, Stefano Garzarella
On Wed, Oct 14, 2026 at 7:24 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Yonggang Luo <luoyonggang@gmail.com> writes:
>
> > As now it's also expressing user-mode targets.
> >
> > This changes the type name exposed by query-qmp-schema; enum values and
> > serialized target values remain unchanged.
>
> Are you sure? query-qmp-schema masks the type names.
Thanks, I'll remove this.
>
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
>
> [...]
>
> > diff --git a/qapi/machine.json b/qapi/machine.json
> > index 9b145c635ba..07fac4f0764 100644
> > --- a/qapi/machine.json
> > +++ b/qapi/machine.json
> > @@ -14,7 +14,7 @@
> > { 'include': 'machine-common.json' }
> >
> > ##
> > -# @SysEmuTarget:
> > +# @EmuTarget:
> > # The comprehensive enumeration of QEMU system emulation
> > # ("softmmu") targets. Run "./configure --help" in the project
> > # root directory, and look for the \*-softmmu targets near the
> # "--target-list" option. The individual target constants are not
> # documented here, for the time being.
>
> Is this still correct?
This is a grep rename. I'll update it later, thanks.
>
> > @@ -35,7 +35,7 @@
> > #
> > # Since: 3.0
> > ##
> > -{ 'enum' : 'SysEmuTarget',
> > +{ 'enum' : 'EmuTarget',
> > 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386',
> > 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64',
> > 'mips64el', 'mipsel', 'or1k', 'ppc',
> > @@ -95,7 +95,7 @@
> > 'qom-path' : 'str',
> > 'thread-id' : 'int',
> > '*props' : 'CpuInstanceProperties',
> > - 'target' : 'SysEmuTarget' },
> > + 'target' : 'EmuTarget' },
> > 'discriminator' : 'target',
> > 'data' : { 's390x' : 'CpuInfoS390' } }
> >
> > @@ -281,7 +281,7 @@
> > # Since: 1.2
> > ##
> > { 'struct': 'QemuTargetInfo',
> > - 'data': { 'arch': 'SysEmuTarget' } }
> > + 'data': { 'arch': 'EmuTarget' } }
> >
> > ##
> > # @query-target:
> > diff --git a/qapi/pragma.json b/qapi/pragma.json
> > index 342cedc42e7..93a710ee937 100644
> > --- a/qapi/pragma.json
> > +++ b/qapi/pragma.json
> > @@ -72,7 +72,7 @@
> > 'SsidSizeMode',
> > 'String',
> > 'StringWrapper',
> > - 'SysEmuTarget',
> > + 'EmuTarget',
> > 'ThrottleGroupProperties',
> > 'VncPrimaryAuth',
> > 'VncVencryptSubAuth',
> > @@ -109,7 +109,7 @@
> > 'QKeyCode', # send-key, input-sent-event
> > 'QapiErrorClass', # QMP error replies
> > 'SshHostKeyCheckMode', # blockdev-add, -blockdev
> > - 'SysEmuTarget', # query-cpu-fast, query-target
> > + 'EmuTarget', # query-cpu-fast, query-target
> > 'UuidInfo', # query-uuid
> > 'VncClientInfo', # query-vnc, query-vnc-servers, ...
> > 'X86CPURegister32' # qom-get of x86 CPU properties
>
> [...]
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/34] qapi: add missing Linux user-mode targets to EmuTarget
2026-10-14 9:31 ` [PATCH 05/34] qapi: add missing Linux user-mode targets " Yonggang Luo
2026-10-14 10:24 ` Philippe Mathieu-Daudé
@ 2026-10-14 17:26 ` Pierrick Bouvier
1 sibling, 0 replies; 25+ messages in thread
From: Pierrick Bouvier @ 2026-10-14 17:26 UTC (permalink / raw)
To: Yonggang Luo, qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Fam Zheng, Edgar E. Iglesias,
Philippe Mathieu-Daudé, Daniel Henrique Barboza,
Palmer Dabbelt, qemu-arm, Chao Liu, Philippe Mathieu-Daude,
Jiaxun Yang, Max Filippov, Stefano Garzarella
On 10/14/2026 2:31 AM, Yonggang Luo wrote:
> This usermode targets:
> aarch64_be
> armeb
> microblazeel
> mipsn32
> mipsn32el
> ppc64le
> sparc32plus
> are not in machine.json
>
> This is a prepare for directly using TARGET_ARCH_VARIANT latter.
>
> Also get target-info.c to be compatible with future TARGET_ARCH_VARIANT only usage.
> So that we can define TARGET_ARCH_VARIANT to target_name directly
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> include/qemu/base-arch-defs.h | 13 +++++++++++++
> qapi/machine.json | 25 +++++++++++++------------
> target-info.c | 26 +++++++++-----------------
> 3 files changed, 35 insertions(+), 29 deletions(-)
>
This patch indeed allows to have a unique definition of
TARGET_ARCH_VARIANT in next patch. However, it's absolutely not needed
for anything else in this series, out of cleaning up one if in meson.build.
Is there is any concrete reason we need to expose linux-user missing
variants?
Regards,
Pierrick
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/34] single-binary: Select the softmmu target through -machine <type>
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
` (14 preceding siblings ...)
2026-10-14 9:31 ` [PATCH 15/34] hw/scsi: " Yonggang Luo
@ 2026-10-14 17:35 ` Pierrick Bouvier
15 siblings, 0 replies; 25+ messages in thread
From: Pierrick Bouvier @ 2026-10-14 17:35 UTC (permalink / raw)
To: Yonggang Luo, qemu-devel
Cc: Eric Blake, qemu-riscv, Daniel P. Berrangé,
Alexander Bulekov, Laurent Vivier, Paolo Bonzini, Gerd Hoffmann,
qemu-s390x, Song Gao, Matthew Rosato, Alistair Francis,
Michael S. Tsirkin, Fabiano Rosas, Eric Farman, Brian Cain,
Stefan Hajnoczi, Darren Kenny, Ani Sinha, Peter Maydell,
Marc-André Lureau, Richard Henderson, Stafford Horne,
Cornelia Huck, Zhao Liu, Weiwei Li, Markus Armbruster,
David Hildenbrand, Laurent Vivier, Fam Zheng, Edgar E. Iglesias,
Philippe Mathieu-Daudé, Daniel Henrique Barboza,
Palmer Dabbelt, qemu-arm, Chao Liu, Philippe Mathieu-Daude,
Jiaxun Yang, Max Filippov, Stefano Garzarella
On 10/14/2026 2:31 AM, Yonggang Luo wrote:
> MachineClass::targets declares each machine's supported targets as a
> uint64_t QEMU_ARCH_* mask.
>
> In the combined executable, a machine can be selected from
> <target>-<machine-name> when <machine-name> is ambitious.
> Otherwise we can use <machine-name> to directly select a target.
>
> Renaming SysEmuTarget to EmuTarget prepares the enum for both system and
> user-mode targets before introducing more usage of it.
> Rationale:
> https://lore.kernel.org/qemu-devel/d6217459-1e55-4da0-a49f-bde8215d8c0e@oss.qualcomm.com/
>
> The "virt" machines need distinct QOM names to coexist in a combined binary
> or test. Their existing CLI names and aliases are preserved.
>
> Other indirect call of target_info() in class_init/type_init is removed by
> serveral commits, this is a prepare for select <target> by -machine $type.
> As target_info() will be NULL till the target is selected under machine_select.
>
> The commits through "hw: add MachineClass::targets with a usage and test"
> add a minimal demo/test for introduce MachineClass::targets
>
> The next group, through
> "meson: build combined qemu-system for multi-target configurations",
> enabled the test guard to prevent introduce future calling
> target_info() in type_init or class_init
>
> These two boundaries provide possible merge points.
>
> "targets" be exported along with MachineInfo in commit
> "qmp: Expose supported targets in query-machines", so that the qmp know
> how to set proper $<target>-<machine-name>.
>
> The rest commits is the introduce of support of <target> select from
> `-machine $type`.
>
> Yonggang Luo (34):
> qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
> qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
> qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits
> qapi: rename SysEmuTarget to EmuTarget
> qapi: add missing Linux user-mode targets to EmuTarget
> meson: define TARGET_ARCH_VARIANT to target_name only
> target-info: prepare the QOM target list before
> module_call_init(MODULE_INIT_QOM)
> hw: add MachineClass::targets with a usage and test
> accel: register CPU parent for each target
> meson: collect Rust crates for combined system target
> module: Add module_allow_all_arch for allow all modules be loaded
> target/arm: defer max-v8 initializer selection until CPU creation
> hw/microblaze: defer PetaLogix endianness default until init
> hw/pci: Avoid guard loadparm with target_s390x() for s390x in
> class_init
> hw/scsi: Avoid guard loadparm with target_s390x() for s390x in
> class_init
> hw/virtio/virtio-mem: Avoid call to target_info() in class_init
> target-info: add a combined-binary query stub
> machine: allow -M name to differ from QOM type
> hw/riscv/virt: use unique QOM name
> hw/arm/virt: use unique QOM name
> hw/or1k/virt: use unique QOM name
> hw/hexagon/virt: use unique QOM name
> hw/loongarch/virt: use unique QOM name
> hw/m68k/virt: use unique QOM name
> hw/xtensa/virt: use unique QOM name
> qapi: return MachineInfo typename from query-machines
> machine: match the versioned virt example to arm virt
> hw: Add MachineClass.targets for all "virt" machines for all possible
> targets
> system/arch_init: update qemu_arch_available to handle non-target
> select condition
> meson: build combined qemu-system for multi-target configurations
> qmp: Expose supported targets in query-machines
> system/vl: select target from machine name in combined binaries
> system/vl: handle cpu/device help properly for multi-target qemu
> qdev: Handle device alias ambiguous under multi-target qemu
>
> MAINTAINERS | 2 +
> accel/accel-common.c | 6 +-
> accel/accel-internal.h | 1 +
> accel/accel-system.c | 24 +++
> accel/accel-user.c | 7 +
> backends/igvm.c | 4 +-
> hw/alpha/dp264.c | 2 +
> hw/arm/virt.c | 56 +++----
> hw/core/machine-qmp-cmds.c | 19 ++-
> hw/core/machine.c | 9 ++
> hw/hexagon/virt.c | 25 +++-
> hw/loongarch/virt.c | 47 +++---
> hw/m68k/virt.c | 39 +++--
> hw/microblaze/petalogix_s3adsp1800_mmu.c | 11 +-
> hw/misc/vmlaunchupdate.c | 6 +-
> hw/or1k/virt.c | 22 +--
> hw/pci/pci.c | 18 ++-
> hw/riscv/virt.c | 28 ++--
> hw/scsi/scsi-disk.c | 18 ++-
> hw/uefi/ovmf-log.c | 4 +-
> hw/virtio/virtio-mem.c | 26 ++--
> hw/xtensa/virt.c | 24 ++-
> include/hw/arm/virt.h | 5 +-
> include/hw/core/boards.h | 45 ++++--
> include/hw/hexagon/virt.h | 5 +-
> include/hw/loongarch/virt.h | 5 +-
> include/hw/riscv/virt.h | 5 +-
> include/monitor/qdev.h | 7 +
> include/qemu/base-arch-defs.h | 80 ++++++----
> include/qemu/module.h | 2 +
> include/qemu/target-info-def.h | 2 +-
> include/qemu/target-info-qapi.h | 4 +-
> include/qemu/target-info-qom.h | 4 +
> include/qemu/target-info.h | 7 +
> meson.build | 82 +++++++++-
> monitor/monitor-hmp-internal.h | 2 +-
> qapi/machine.json | 44 +++---
> qapi/pragma.json | 4 +-
> qom/object.c | 4 +-
> stubs/meson.build | 1 +
> stubs/target-info.c | 10 ++
> system/arch_init.c | 12 +-
> system/qdev-monitor.c | 54 ++++++-
> system/target-info.c | 10 ++
> system/vl.c | 181 ++++++++++++++++++++---
> target-info-def.c | 2 +-
> target-info-qom.c | 26 +++-
> target-info.c | 38 ++---
> target/arm/tcg/cpu-max-v8.c | 17 ++-
> tests/qtest/fuzz/fuzz.c | 2 +-
> tests/qtest/qom-test.c | 65 +++++++-
> tests/unit/meson.build | 4 +-
> tests/unit/test-multi-target.c | 67 ++++++++-
> util/module.c | 10 +-
> 54 files changed, 915 insertions(+), 289 deletions(-)
> create mode 100644 stubs/target-info.c
> create mode 100644 system/target-info.c
>
Hi Yonggang,
in a previous thread, we had a long discussion about which direction we
want to go, and what needs to be implemented. I politely suggested to
focus first on simply removing dependency in class_init to target_info,
and rely on is_available only. The idea was to convince you that small
iteration steps are better than throw-all-in series. I thought we were
on the same page.
Now, yet another mega series mixing cleanup, code and even going as far
as introducing the qemu-system binary.
I feel like spending time to give advice didn't lead to a concrete
change in behavior. As a result, I'm stopping to review all those
series, and will let others drive this.
Regards,
Pierrick
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2026-10-14 17:36 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 9:31 [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Yonggang Luo
2026-10-14 9:31 ` [PATCH 01/34] qemu/base-arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums Yonggang Luo
2026-10-14 9:31 ` [PATCH 02/34] qemu: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL Yonggang Luo
2026-10-14 9:31 ` [PATCH 03/34] qemu: increase width of QEMU_ARCH_* masks enums to be 64 bits Yonggang Luo
2026-10-14 9:31 ` [PATCH 04/34] qapi: rename SysEmuTarget to EmuTarget Yonggang Luo
2026-10-14 11:24 ` Markus Armbruster
2026-10-14 12:18 ` Yonggang Luo
2026-10-14 9:31 ` [PATCH 05/34] qapi: add missing Linux user-mode targets " Yonggang Luo
2026-10-14 10:24 ` Philippe Mathieu-Daudé
2026-10-14 10:30 ` Daniel P. Berrangé
2026-10-14 10:45 ` Philippe Mathieu-Daudé
2026-10-14 10:48 ` Yonggang Luo
2026-10-14 10:46 ` Yonggang Luo
2026-10-14 17:26 ` Pierrick Bouvier
2026-10-14 9:31 ` [PATCH 06/34] meson: define TARGET_ARCH_VARIANT to target_name only Yonggang Luo
2026-10-14 9:31 ` [PATCH 07/34] target-info: prepare the QOM target list before module_call_init(MODULE_INIT_QOM) Yonggang Luo
2026-10-14 9:31 ` [PATCH 08/34] hw: add MachineClass::targets with a usage and test Yonggang Luo
2026-10-14 9:31 ` [PATCH 09/34] accel: register CPU parent for each target Yonggang Luo
2026-10-14 9:31 ` [PATCH 10/34] meson: collect Rust crates for combined system target Yonggang Luo
2026-10-14 9:31 ` [PATCH 11/34] module: Add module_allow_all_arch for allow all modules be loaded Yonggang Luo
2026-10-14 9:31 ` [PATCH 12/34] target/arm: defer max-v8 initializer selection until CPU creation Yonggang Luo
2026-10-14 9:31 ` [PATCH 13/34] hw/microblaze: defer PetaLogix endianness default until init Yonggang Luo
2026-10-14 9:31 ` [PATCH 14/34] hw/pci: Avoid guard loadparm with target_s390x() for s390x in class_init Yonggang Luo
2026-10-14 9:31 ` [PATCH 15/34] hw/scsi: " Yonggang Luo
2026-10-14 17:35 ` [PATCH 00/34] single-binary: Select the softmmu target through -machine <type> Pierrick Bouvier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.