RFC qapi: Make @query-cpu-definitions command target-agnostic
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest21 patches 20 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/21 | target/i386: Declare CPU QOM types using DEFINE_TYPES() macrotarget/ | +23 | 0 replies | |
| 2/21 | target/mips: Declare CPU QOM types using DEFINE_TYPES() macrotarget/ | +13 | 1 reply | |
| 3/21 | target/ppc: Declare CPU QOM types using DEFINE_TYPES() macrotarget/ | +23 | 1 reply | |
| 4/21 | target/sparc: Declare CPU QOM types using DEFINE_TYPES() macrotarget/ | +13 | 1 reply | |
| 5/21 | cpus: Open code OBJECT_DECLARE_TYPE() in OBJECT_DECLARE_CPU_TYPE()include/ | +6 | 1 reply | |
| 6/21 | target/i386: Make X86_CPU common to new I386_CPU / X86_64_CPU typestarget/ target/ tests/ | +29 | 3 replies | |
| 7/21 | target/mips: Make MIPS_CPU common to new MIPS32_CPU / MIPS64_CPU typestarget/ target/ target/ | +19 | 1 reply | |
| 8/21 | target/sparc: Make SPARC_CPU common to new SPARC32_CPU/SPARC64_CPU typestarget/ target/ | +16 | 0 replies | |
| 9/21 | qapi: Merge machine-common.json with qapi/machine.jsonMAINTAINERS qapi/ qapi/ +4 more | +14 | 1 reply | |
| 10/21 | qapi: Make CpuModel* definitions target agnosticqapi/ qapi/ | +79 | 2 replies | |
| 11/21 | qapi: Make CpuDefinitionInfo target agnosticqapi/ qapi/ | +63 | 0 replies | |
| 12/21 | system: Introduce QemuArchBit enuminclude/ | +47 | 0 replies | |
| 13/21 | system: Introduce cpu_typename_by_arch_bit()MAINTAINERS include/ system/ +1 more | +62 | 0 replies | |
| 14/21 | system: Introduce QMP generic_query_cpu_definitions()MAINTAINERS include/ include/ +2 more | +102 | 4 replies | |
| 15/21 | target/arm: Use QMP generic_query_cpu_definitions()target/ | +2 | 0 replies | |
| 16/21 | target/loongarch: Use QMP generic_query_cpu_definitions()target/ | +2 | 0 replies | |
| 17/21 | target/riscv: Use QMP generic_query_cpu_definitions()target/ target/ target/ | +6 | 0 replies | |
| 18/21 | target/i386: Use QMP generic_query_cpu_definitions()target/ | +4 | 0 replies | |
| 19/21 | target/ppc: Factor ppc_add_alias_definitions() outtarget/ target/ | +19 | 1 reply | |
| 20/21 | target/ppc: Use QMP generic_query_cpu_definitions()target/ target/ | +3 | 0 replies | |
| 21/21 | qapi: Make @query-cpu-definitions target-agnosticMAINTAINERS include/ qapi/ +8 more | +13 | 1 reply |
Reviews trailers per patch
8 of 21 patches have a Reviewed-by or Acked-by.
| Patch | Richard Henderson | Zhao Liu | Mark Cave-Ayland | Nicholas Piggin |
|---|---|---|---|---|
| 1/21 | R-b | R-b | ||
| 2/21 | R-b | R-b | ||
| 3/21 | R-b | R-b | ||
| 4/21 | R-b | R-b | R-b | |
| 5/21 | A-b | |||
| 6/21 | A-b | |||
| 7/21 | ||||
| 8/21 | R-b | |||
| 9/21 | ||||
| 10/21 | ||||
| 11/21 | ||||
| 12/21 | ||||
| 13/21 | ||||
| 14/21 | ||||
| 15/21 | ||||
| 16/21 | ||||
| 17/21 | ||||
| 18/21 | ||||
| 19/21 | R-b | |||
| 20/21 | ||||
| 21/21 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [RFC PATCH-for-9.1 00/21] qapi: Make @query-cpu-definitions command target-agnostic
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
Signature · 1 line
2.41.0