All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.