All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic
@ 2024-03-15 13:08 Philippe Mathieu-Daudé
  2024-03-15 13:08 ` [PATCH-for-9.1 01/21] target/i386: Declare CPU QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
                   ` (22 more replies)
  0 siblings, 23 replies; 41+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-15 13:08 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster
  Cc: qemu-riscv, Anton Johansson, qemu-s390x, qemu-ppc,
	Daniel P . Berrangé,
	Paolo Bonzini, Eduardo Habkost, Claudio Fontana,
	Richard Henderson, Peter Maydell, Alex Bennée,
	Manos Pitsidianakis, Zhao Liu, qemu-arm, Thomas Huth,
	Philippe Mathieu-Daudé

Hi Alex, Markus,

Markus mentioned QAPI problems with the heterogeneous emulation
binary. My understanding is, while QAPI can use host-specific
conditional (OS, library available, configure option), it
shouldn't use target-specific ones.

This series is an example on how to remove target specific
bits from the @query-cpu-definitions command. Target specific
code is registered as CPUClass handlers, then a generic method
is used, iterating over all targets built in.

The first set of patches were already posted / reviewed last
year.

The PPC and S390X targets still need work (help welcomed),
however the code is useful enough to be tested and see if this
is a good approach.

The only drawback is a change in QAPI introspection, because
targets not implementing @query-cpu-definitions were returning
"CommandNotFound". My view is this was an incomplete
implementation, rather than a feature.

Regards,

Phil.

Philippe Mathieu-Daudé (21):
  target/i386: Declare CPU QOM types using DEFINE_TYPES() macro
  target/mips: Declare CPU QOM types using DEFINE_TYPES() macro
  target/ppc: Declare CPU QOM types using DEFINE_TYPES() macro
  target/sparc: Declare CPU QOM types using DEFINE_TYPES() macro
  cpus: Open code OBJECT_DECLARE_TYPE() in OBJECT_DECLARE_CPU_TYPE()
  target/i386: Make X86_CPU common to new I386_CPU / X86_64_CPU types
  target/mips: Make MIPS_CPU common to new MIPS32_CPU / MIPS64_CPU types
  target/sparc: Make SPARC_CPU common to new SPARC32_CPU/SPARC64_CPU
    types
  qapi: Merge machine-common.json with qapi/machine.json
  qapi: Make CpuModel* definitions target agnostic
  qapi: Make CpuDefinitionInfo target agnostic
  system: Introduce QemuArchBit enum
  system: Introduce cpu_typename_by_arch_bit()
  system: Introduce QMP generic_query_cpu_definitions()
  target/arm: Use QMP generic_query_cpu_definitions()
  target/loongarch: Use QMP generic_query_cpu_definitions()
  target/riscv: Use QMP generic_query_cpu_definitions()
  target/i386: Use QMP generic_query_cpu_definitions()
  target/ppc: Factor ppc_add_alias_definitions() out
  target/ppc: Use QMP generic_query_cpu_definitions()
  qapi: Make @query-cpu-definitions target-agnostic

 MAINTAINERS                           |   3 +-
 qapi/machine-common.json              |  21 ----
 qapi/machine-target.json              | 167 +-------------------------
 qapi/machine.json                     | 166 ++++++++++++++++++++++++-
 qapi/qapi-schema.json                 |   1 -
 include/hw/core/cpu.h                 |   7 +-
 include/hw/core/sysemu-cpu-ops.h      |  14 +++
 include/sysemu/arch_init.h            |  71 +++++++----
 target/i386/cpu-qom.h                 |  16 ++-
 target/mips/cpu-qom.h                 |  13 +-
 target/ppc/cpu-models.h               |   4 +
 target/riscv/cpu.h                    |   2 +
 target/s390x/cpu.h                    |   2 +-
 target/sparc/cpu-qom.h                |   9 +-
 system/cpu-qmp-cmds.c                 |  71 +++++++++++
 system/cpu-qom-helpers.c              |  58 +++++++++
 target/arm/arm-qmp-cmds.c             |  27 -----
 target/i386/cpu.c                     |  77 ++++++------
 target/loongarch/loongarch-qmp-cmds.c |  25 ----
 target/mips/cpu.c                     |  34 ++++--
 target/mips/sysemu/mips-qmp-cmds.c    |  31 -----
 target/ppc/cpu_init.c                 |  53 ++++----
 target/ppc/ppc-qmp-cmds.c             |  31 +----
 target/riscv/cpu.c                    |   1 +
 target/riscv/riscv-qmp-cmds.c         |  13 +-
 target/sparc/cpu.c                    |  35 ++++--
 tests/qtest/cpu-plug-test.c           |   2 +-
 qapi/meson.build                      |   1 -
 system/meson.build                    |   2 +
 29 files changed, 515 insertions(+), 442 deletions(-)
 delete mode 100644 qapi/machine-common.json
 create mode 100644 system/cpu-qmp-cmds.c
 create mode 100644 system/cpu-qom-helpers.c

-- 
2.41.0



^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2024-04-02  9:38 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15 13:08 [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 01/21] target/i386: Declare CPU QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 02/21] target/mips: " Philippe Mathieu-Daudé
2024-03-18  8:13   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 03/21] target/ppc: " Philippe Mathieu-Daudé
2024-03-18  8:15   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 04/21] target/sparc: " Philippe Mathieu-Daudé
2024-03-18  8:16   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 05/21] cpus: Open code OBJECT_DECLARE_TYPE() in OBJECT_DECLARE_CPU_TYPE() Philippe Mathieu-Daudé
2024-03-18  8:31   ` Zhao Liu
2024-03-15 13:08 ` [PATCH-for-9.1 06/21] target/i386: Make X86_CPU common to new I386_CPU / X86_64_CPU types Philippe Mathieu-Daudé
2024-03-18  8:47   ` Zhao Liu
2024-03-26 10:57   ` Markus Armbruster
2024-03-26 12:17     ` Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 07/21] target/mips: Make MIPS_CPU common to new MIPS32_CPU / MIPS64_CPU types Philippe Mathieu-Daudé
2024-03-19 18:12   ` Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 08/21] target/sparc: Make SPARC_CPU common to new SPARC32_CPU/SPARC64_CPU types Philippe Mathieu-Daudé
2024-03-15 13:08 ` [PATCH-for-9.1 09/21] qapi: Merge machine-common.json with qapi/machine.json Philippe Mathieu-Daudé
2024-03-26 12:12   ` Markus Armbruster
2024-03-15 13:08 ` [PATCH-for-9.1 10/21] qapi: Make CpuModel* definitions target agnostic Philippe Mathieu-Daudé
2024-03-20  8:49   ` Philippe Mathieu-Daudé
2024-03-26 12:16   ` Markus Armbruster
2024-03-15 13:08 ` [PATCH-for-9.1 11/21] qapi: Make CpuDefinitionInfo " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [PATCH-for-9.1 12/21] system: Introduce QemuArchBit enum Philippe Mathieu-Daudé
2024-03-15 13:09 ` [PATCH-for-9.1 13/21] system: Introduce cpu_typename_by_arch_bit() Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 14/21] system: Introduce QMP generic_query_cpu_definitions() Philippe Mathieu-Daudé
2024-03-26 12:54   ` Markus Armbruster
2024-03-26 13:28   ` Markus Armbruster
2024-03-29 13:03     ` Philippe Mathieu-Daudé
2024-04-02  9:37       ` Markus Armbruster
2024-03-15 13:09 ` [RFC PATCH-for-9.1 15/21] target/arm: Use " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 16/21] target/loongarch: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 17/21] target/riscv: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 18/21] target/i386: " Philippe Mathieu-Daudé
2024-03-15 13:09 ` [PATCH-for-9.1 19/21] target/ppc: Factor ppc_add_alias_definitions() out Philippe Mathieu-Daudé
2024-03-20  5:07   ` Nicholas Piggin
2024-03-15 13:09 ` [RFC PATCH-for-9.1 20/21] target/ppc: Use QMP generic_query_cpu_definitions() Philippe Mathieu-Daudé
2024-03-15 13:09 ` [RFC PATCH-for-9.1 21/21] qapi: Make @query-cpu-definitions target-agnostic Philippe Mathieu-Daudé
2024-03-26 13:32   ` Markus Armbruster
2024-03-26 10:18 ` [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic Markus Armbruster
2024-03-26 13:37 ` Markus Armbruster

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.