target-info: remove machine_typename
Subsystems (10)
cover target-info: remove machine_typename
This series cleans up the existing filtering interface we implemented previously. It's cumbersome and incomplete, and we can have a much simpler callback added in TypeInfo, to achieve the same result.
Also, it allows to remove a bunch of code, and remove duplication of target info definitions per target, which is the biggest benefit.
Pierrick Bouvier (14):
qom/object: add is_available callback to TypeInfo hw/arm: filter minimal set of machines
system: query machines using TYPE_MACHINE
target-info: remove machine_typename
configs/targets: remove target info definitions
target-info: rename target-info-stub.c in target-info-def.c hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE hw/arm: remove {arm,arm_aarch64,aarch64}_machine_interfaces hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM}
hw/arm: remove machines-qom.h
hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE hw/riscv: remove {riscv32,riscv32_64,riscv64}_machine_interfaces hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64} hw/riscv: remove machines-qom.h
configs/targets/aarch64-softmmu.c | 27 ------------- configs/targets/arm-softmmu.c | 27 ------------- configs/targets/meson.build | 6 --- configs/targets/riscv32-softmmu.c | 26 ------------- configs/targets/riscv64-softmmu.c | 26 ------------- hw/arm/aspeed.c | 1 - hw/arm/aspeed_ast1040_evb.c | 2 - hw/arm/aspeed_ast10x0_evb.c | 3 -- hw/arm/aspeed_ast2400_palmetto.c | 2 - hw/arm/aspeed_ast2400_quanta-q71l.c | 2 - hw/arm/aspeed_ast2400_supermicrox11.c | 2 - hw/arm/aspeed_ast2500_evb.c | 2 - hw/arm/aspeed_ast2500_g220a.c | 2 - hw/arm/aspeed_ast2500_romulus.c | 2 - hw/arm/aspeed_ast2500_supermicro-x11spi.c | 2 - hw/arm/aspeed_ast2500_tiogapass.c | 2 - hw/arm/aspeed_ast2500_witherspoon.c | 2 - hw/arm/aspeed_ast2500_yosemitev2.c | 2 - hw/arm/aspeed_ast2600_anacapa.c | 2 - hw/arm/aspeed_ast2600_bletchley.c | 2 - hw/arm/aspeed_ast2600_catalina.c | 2 - hw/arm/aspeed_ast2600_evb.c | 2 - hw/arm/aspeed_ast2600_fby35.c | 2 - hw/arm/aspeed_ast2600_fuji.c | 2 - hw/arm/aspeed_ast2600_gb200nvl.c | 2 - hw/arm/aspeed_ast2600_rainier.c | 2 - hw/arm/aspeed_ast27x0-fc.c | 3 +- hw/arm/aspeed_ast27x0_evb.c | 5 +-- hw/arm/ax3000-boards.c | 2 - hw/arm/b-l475e-iot01a.c | 2 - hw/arm/bananapi_m2u.c | 3 +- hw/arm/collie.c | 2 - hw/arm/cubieboard.c | 3 +- hw/arm/digic_boards.c | 3 +- hw/arm/exynos4_boards.c | 3 -- hw/arm/imx25_pdk.c | 3 +- hw/arm/imx8mm-evk.c | 3 +- hw/arm/imx8mp-evk.c | 2 - hw/arm/integratorcp.c | 3 +- hw/arm/kzm.c | 3 +- hw/arm/max78000fthr.c | 3 +- hw/arm/mcimx6ul-evk.c | 3 +- hw/arm/mcimx7d-sabre.c | 3 +- hw/arm/microbit.c | 2 - hw/arm/mps2-tz.c | 5 --- hw/arm/mps2.c | 5 --- hw/arm/mps3r.c | 2 - hw/arm/msf2-som.c | 3 +- hw/arm/musca.c | 3 -- hw/arm/musicpal.c | 3 +- hw/arm/netduino2.c | 3 +- hw/arm/netduinoplus2.c | 3 +- hw/arm/npcm7xx_boards.c | 6 --- hw/arm/npcm8xx_boards.c | 2 - hw/arm/olimex-stm32-h405.c | 3 +- hw/arm/omap_sx1.c | 3 -- hw/arm/orangepi.c | 3 +- hw/arm/raspi.c | 8 +--- hw/arm/raspi4b.c | 3 +- hw/arm/realview.c | 5 --- hw/arm/sabrelite.c | 2 - hw/arm/sbsa-ref.c | 2 - hw/arm/stellaris.c | 3 -- hw/arm/stm32vldiscovery.c | 3 +- hw/arm/versatilepb.c | 3 -- hw/arm/vexpress.c | 3 -- hw/arm/virt.c | 2 - hw/arm/xen-pvh.c | 2 - hw/arm/xilinx_zynq.c | 2 - hw/arm/xlnx-versal-virt.c | 3 -- hw/arm/xlnx-zcu102.c | 2 - hw/core/machine-qmp-cmds.c | 2 +- hw/core/null-machine.c | 9 +---- hw/nitro/machine.c | 6 --- hw/remote/machine.c | 3 -- hw/riscv/boston-aia.c | 3 +- hw/riscv/k230.c | 2 - hw/riscv/microblaze-v-generic.c | 3 +- hw/riscv/microchip_pfsoc.c | 2 - hw/riscv/opentitan.c | 2 - hw/riscv/shakti_c.c | 2 - hw/riscv/sifive_e.c | 2 - hw/riscv/sifive_u.c | 2 - hw/riscv/spike.c | 2 - hw/riscv/tt_atlantis.c | 2 - hw/riscv/virt.c | 3 -- hw/riscv/xiangshan_kmh.c | 2 - include/hw/arm/machines-qom.h | 46 ----------------------- include/hw/riscv/machines-qom.h | 46 ----------------------- include/qemu/target-info-impl.h | 2 - include/qemu/target-info.h | 8 ---- include/qom/object.h | 3 ++ meson.build | 7 +--- monitor/qemu-config-qmp.c | 2 +- qom/object.c | 4 ++ rust/qom/src/qom.rs | 1 + system/vl.c | 5 +-- target-info-stub.c => target-info-def.c | 1 - target-info-qom.c | 23 ------------ target-info.c | 5 --- target/arm/machine.c | 18 --------- target/riscv/machine.c | 17 --------- 102 files changed, 39 insertions(+), 488 deletions(-) delete mode 100644 configs/targets/aarch64-softmmu.c delete mode 100644 configs/targets/arm-softmmu.c delete mode 100644 configs/targets/meson.build delete mode 100644 configs/targets/riscv32-softmmu.c delete mode 100644 configs/targets/riscv64-softmmu.c delete mode 100644 include/hw/arm/machines-qom.h delete mode 100644 include/hw/riscv/machines-qom.h rename target-info-stub.c => target-info-def.c (96%)
Signature · 1 line
2.43.0
PATCH 1/14 qom/object: add is_available callback to TypeInfo
When removing target specific sections (#ifdef TARGET_X), we started exposing types for different targets in the same file.
Previously, we implemented a filter based on interfaces, but it proved to be too cumbersome, requiring duplication across architectures. To simplify it, we add a new callback, is_available, to TypeInfo, that will replace the existing filtering mechanism.
--- include/qom/object.h | 3 +++ qom/object.c | 4 ++++ rust/qom/src/qom.rs | 1 + 3 files changed, 8 insertions(+)
include/qom/object.h +3 -0
@@ -469,6 +469,8 @@ struct Object* @class_data: Data to pass to the @class_init, * @class_base_init. This can be useful when building dynamic * classes. +* @is_available: callback invoked at registration time, to dynamically check if +* this type should be available or not. * @interfaces: The list of interfaces associated with this type. This * should point to a static array that's terminated with a zero filled * element.
@@ -491,6 +493,7 @@ struct TypeInfovoid (*class_base_init)(ObjectClass *klass,const void *data);const void *class_data; +bool (*is_available)(void );const InterfaceInfo *interfaces; };
qom/object.c +4 -0
@@ -163,6 +163,10 @@ static TypeImpl *type_register_internal(const TypeInfo *info)abort (); } +if (info->is_available && !info->is_available ()) { +return NULL ; + } + ti =type_new (info);type_table_add (ti);
rust/qom/src/qom.rs +1 -0
@@ -691,6 +691,7 @@ pub trait ObjectImpl: ObjectType + IsA<Object> { class_init: Some(rust_class_init::<Self>), class_base_init: Self::CLASS_BASE_INIT, class_data: core::ptr::null(), + is_available: None, interfaces: core::ptr::null(), };
Signature · 1 line
2.43.0
Re: [PATCH 01/14] qom/object: add is_available callback to TypeInfo
Quoted 8 lines · Pierrick Bouvier
When removing target specific sections (#ifdef
TARGET_X), we started exposing types for different targets in the same file.Previously, we implemented a filter based on interfaces, but it proved to be too cumbersome, requiring duplication across architectures. To simplify it, we add a new callback,
is_available, to TypeInfo, that will replace the existing filtering mechanism.
Quoted 6 lines
Signed-off-by Pierrick Bouvier <[email protected]>--- include/qom/object.h | 3 +++ qom/object.c | 4 ++++ rust/qom/src/qom.rs | 1 + 3 files changed, 8 insertions(+)
Philippe Mathieu-Daudé
Reviewed-by Richard HendersonRe: [PATCH 01/14] qom/object: add is_available callback to TypeInfo
Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Pierrick Bouvier
When removing target specific sections (#ifdef
TARGET_X), we started exposing types for different targets in the same file.Previously, we implemented a filter based on interfaces, but it proved to be too cumbersome, requiring duplication across architectures. To simplify it, we add a new callback,
is_available, to TypeInfo, that will replace the existing filtering mechanism.Quoted 6 lines
Signed-off-by Pierrick Bouvier <[email protected]>---
include/qom/object.h| 3 +++
qom/object.c | 4 ++++
rust/qom/src/qom.rs | 1 +3 files changed, 8 insertions(+)
Quoted 3 lines
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
and per https://lore.kernel.org/qemu-devel/[email protected]/:
PATCH 2/14 hw/arm: filter minimal set of machines
In reply to Pierrick BouvierWe are about to change the filtering logic for machines. These boards are impacted and already are conditionally available. To not break existing binaries, we need to filter them accordingly with new mechanic.
From there, we are free to remove the previous filtering mechanic without changing any existing behaviour.
--- hw/arm/aspeed_ast27x0-fc.c | 1 + hw/arm/aspeed_ast27x0_evb.c | 2 ++ hw/arm/raspi.c | 2 ++ hw/arm/raspi4b.c | 1 + 4 files changed, 6 insertions(+)
hw/arm/aspeed_ast27x0-fc.c +1 -0
@@ -235,6 +235,7 @@ static const TypeInfo ast2700fc_types[] = { .parent = TYPE_MACHINE, .class_init = ast2700fc_class_init, .instance_size = sizeof(Ast2700FCState), + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, }, };
hw/arm/aspeed_ast27x0_evb.c +2 -0
@@ -76,12 +76,14 @@ static const TypeInfo aspeed_ast27x0_evb_types[] = { .name = MACHINE_TYPE_NAME("ast2700a1-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2700a1_evb_class_init, + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("ast2700a2-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2700a2_evb_class_init, + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, } };
hw/arm/raspi.c +2 -0
@@ -407,11 +407,13 @@ static const TypeInfo raspi_machine_types[] = { .name = MACHINE_TYPE_NAME("raspi3ap"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3ap_machine_class_init, + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("raspi3b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3b_machine_class_init, + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, }, { .name = TYPE_RASPI_MACHINE,
hw/arm/raspi4b.c +1 -0
@@ -126,6 +126,7 @@ static const TypeInfo raspi4b_machine_type = { .parent = TYPE_RASPI_BASE_MACHINE, .instance_size = sizeof(Raspi4bMachineState), .class_init = raspi4b_machine_class_init, + .is_available = target_aarch64, .interfaces = aarch64_machine_interfaces, };
Signature · 1 line
2.43.0
Re: [PATCH 02/14] hw/arm: filter minimal set of machines
Quoted 7 lines · Pierrick Bouvier
We are about to change the filtering logic for machines. These boards are impacted and already are conditionally available. To not break existing binaries, we need to filter them accordingly with new mechanic.
From there, we are free to remove the previous filtering mechanic
without changing any existing behaviour.
Quoted 7 lines
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/arm/aspeed_ast27x0-fc.c | 1 + hw/arm/aspeed_ast27x0_evb.c | 2 ++ hw/arm/raspi.c | 2 ++ hw/arm/raspi4b.c | 1 + 4 files changed, 6 insertions(+)
PATCH 3/14 system: query machines using TYPE_MACHINE
In reply to Pierrick BouvierWe drop the target_machine_typename() we introduced previously, and revert to using TYPE_MACHINE. From there, we'll make sure only the right types are registered at startup time.
--- hw/core/machine-qmp-cmds.c | 2 +- monitor/qemu-config-qmp.c | 2 +- system/vl.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-)
hw/core/machine-qmp-cmds.c +1 -1
@@ -99,7 +99,7 @@ MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_props,GSList *el, *machines;MachineInfoList *mach_list =NULL ; - machines =object_class_get_list (target_machine_typename (), false); + machines =object_class_get_list (TYPE_MACHINE , false);for (el = machines; el; el = el->next) {MachineClass *mc = el->data;const char *default_cpu_type =machine_class_default_cpu_type (mc);
monitor/qemu-config-qmp.c +1 -1
@@ -129,7 +129,7 @@ static CommandLineParameterInfoList *query_all_machine_properties(void)ObjectProperty *prop;bool is_new; - machines =object_class_get_list (target_machine_typename (), false); + machines =object_class_get_list (TYPE_MACHINE , false);assert (machines);/* Loop over all machine classes */
system/vl.c +2 -3
@@ -1570,7 +1570,7 @@ static void machine_help_func(const QDict *qdict)GSList *el;const char *type =qdict_get_try_str (qdict,"type" ); - machines =object_class_get_list (target_machine_typename (), false); + machines =object_class_get_list (TYPE_MACHINE , false);if (type) {ObjectClass *machine_class =OBJECT_CLASS (find_machine (type, machines));if (machine_class) {
@@ -1682,8 +1682,7 @@ static MachineClass *select_machine(QDict *qdict, Error **errp) {ERRP_GUARD ();const char *machine_type =qdict_get_try_str (qdict,"type" ); -g_autoptr (GSList) machines =object_class_get_list (target_machine_typename (), - false); +g_autoptr (GSList) machines =object_class_get_list (TYPE_MACHINE , false);MachineClass *machine_class =NULL ;if (machine_type) {
Signature · 1 line
2.43.0
Re: [PATCH 03/14] system: query machines using TYPE_MACHINE
Quoted 10 lines · Pierrick Bouvier
We drop the
target_machine_typename()we introduced previously, and revert to usingTYPE_MACHINE. From there, we'll make sure only the right types are registered at startup time.Signed-off-by Pierrick Bouvier <[email protected]>--- hw/core/machine-qmp-cmds.c | 2 +- monitor/qemu-config-qmp.c | 2 +- system/vl.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-)
PATCH 8/14 hw/arm: remove {arm, arm_aarch64, aarch64}_machine_interfaces
In reply to Pierrick BouvierWe can now remove those arrays.
--- hw/arm/aspeed_ast1040_evb.c | 1 - hw/arm/aspeed_ast10x0_evb.c | 2 -- hw/arm/aspeed_ast2400_palmetto.c | 1 - hw/arm/aspeed_ast2400_quanta-q71l.c | 1 - hw/arm/aspeed_ast2400_supermicrox11.c | 1 - hw/arm/aspeed_ast2500_evb.c | 1 - hw/arm/aspeed_ast2500_g220a.c | 1 - hw/arm/aspeed_ast2500_romulus.c | 1 - hw/arm/aspeed_ast2500_supermicro-x11spi.c | 1 - hw/arm/aspeed_ast2500_tiogapass.c | 1 - hw/arm/aspeed_ast2500_witherspoon.c | 1 - hw/arm/aspeed_ast2500_yosemitev2.c | 1 - hw/arm/aspeed_ast2600_anacapa.c | 1 - hw/arm/aspeed_ast2600_bletchley.c | 1 - hw/arm/aspeed_ast2600_catalina.c | 1 - hw/arm/aspeed_ast2600_evb.c | 1 - hw/arm/aspeed_ast2600_fby35.c | 1 - hw/arm/aspeed_ast2600_fuji.c | 1 - hw/arm/aspeed_ast2600_gb200nvl.c | 1 - hw/arm/aspeed_ast2600_rainier.c | 1 - hw/arm/aspeed_ast27x0-fc.c | 1 - hw/arm/aspeed_ast27x0_evb.c | 2 -- hw/arm/ax3000-boards.c | 1 - hw/arm/b-l475e-iot01a.c | 1 - hw/arm/bananapi_m2u.c | 2 +- hw/arm/collie.c | 1 - hw/arm/cubieboard.c | 2 +- hw/arm/exynos4_boards.c | 2 -- hw/arm/imx8mm-evk.c | 2 +- hw/arm/imx8mp-evk.c | 1 - hw/arm/integratorcp.c | 2 +- hw/arm/mcimx7d-sabre.c | 2 +- hw/arm/microbit.c | 1 - hw/arm/mps2-tz.c | 4 ---- hw/arm/mps2.c | 4 ---- hw/arm/mps3r.c | 1 - hw/arm/musca.c | 2 -- hw/arm/musicpal.c | 2 +- hw/arm/npcm7xx_boards.c | 5 ----- hw/arm/npcm8xx_boards.c | 1 - hw/arm/omap_sx1.c | 2 -- hw/arm/orangepi.c | 2 +- hw/arm/raspi.c | 5 ----- hw/arm/raspi4b.c | 1 - hw/arm/realview.c | 4 ---- hw/arm/sabrelite.c | 1 - hw/arm/sbsa-ref.c | 1 - hw/arm/stellaris.c | 2 -- hw/arm/versatilepb.c | 2 -- hw/arm/vexpress.c | 2 -- hw/arm/virt.c | 1 - hw/arm/xen-pvh.c | 1 - hw/arm/xilinx_zynq.c | 1 - hw/arm/xlnx-versal-virt.c | 2 -- hw/arm/xlnx-zcu102.c | 1 - include/hw/arm/machines-qom.h | 16 ++-------------- target/arm/machine.c | 12 ------------ 57 files changed, 9 insertions(+), 107 deletions(-)
hw/arm/aspeed_ast1040_evb.c +0 -1
@@ -81,7 +81,6 @@ static const TypeInfo aspeed_ast1040_evb_types[] = { .name = MACHINE_TYPE_NAME("ast1040-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast1040_evb_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast10x0_evb.c +0 -2
@@ -119,12 +119,10 @@ static const TypeInfo aspeed_ast10x0_evb_types[] = { .name = MACHINE_TYPE_NAME("ast1030-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_minibmc_machine_ast1030_evb_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("ast1060-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_minibmc_machine_ast1060_evb_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2400_palmetto.c +0 -1
@@ -73,7 +73,6 @@ static const TypeInfo aspeed_ast2400_palmetto_types[] = { .name = MACHINE_TYPE_NAME("palmetto-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_palmetto_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2400_quanta-q71l.c +0 -1
@@ -79,7 +79,6 @@ static const TypeInfo aspeed_ast2400_quanta_q71l_types[] = { .name = MACHINE_TYPE_NAME("quanta-q71l-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_quanta_q71l_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2400_supermicrox11.c +0 -1
@@ -74,7 +74,6 @@ static const TypeInfo aspeed_ast2400_supermicrox11_types[] = { .name = MACHINE_TYPE_NAME("supermicrox11-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_supermicrox11_bmc_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_evb.c +0 -1
@@ -60,7 +60,6 @@ static const TypeInfo aspeed_ast2500_evb_types[] = { .name = MACHINE_TYPE_NAME("ast2500-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2500_evb_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_g220a.c +0 -1
@@ -85,7 +85,6 @@ static const TypeInfo aspeed_ast2500_g220a_types[] = { .name = MACHINE_TYPE_NAME("g220a-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_g220a_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_romulus.c +0 -1
@@ -55,7 +55,6 @@ static const TypeInfo aspeed_ast2500_romulus_types[] = { .name = MACHINE_TYPE_NAME("romulus-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_romulus_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_supermicro-x11spi.c +0 -1
@@ -70,7 +70,6 @@ static const TypeInfo aspeed_ast2500_supermicro_x11spi_types[] = { .name = MACHINE_TYPE_NAME("supermicro-x11spi-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_supermicro_x11spi_bmc_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_tiogapass.c +0 -1
@@ -83,7 +83,6 @@ static const TypeInfo aspeed_ast2500_tiogapass_types[] = { .name = MACHINE_TYPE_NAME("tiogapass-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_tiogapass_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_witherspoon.c +0 -1
@@ -105,7 +105,6 @@ static const TypeInfo aspeed_ast2500_witherspoon_types[] = { .name = MACHINE_TYPE_NAME("witherspoon-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_witherspoon_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2500_yosemitev2.c +0 -1
@@ -84,7 +84,6 @@ static const TypeInfo aspeed_ast2500_yosemitev2_types[] = { .name = MACHINE_TYPE_NAME("yosemitev2-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_yosemitev2_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_anacapa.c +0 -1
@@ -368,7 +368,6 @@ static const TypeInfo aspeed_ast2600_anacapa_types[] = { .name = MACHINE_TYPE_NAME("anacapa-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_anacapa_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_bletchley.c +0 -1
@@ -90,7 +90,6 @@ static const TypeInfo aspeed_ast2600_bletchley_types[] = { .name = MACHINE_TYPE_NAME("bletchley-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_bletchley_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_catalina.c +0 -1
@@ -675,7 +675,6 @@ static const TypeInfo aspeed_ast2600_catalina_types[] = { .name = MACHINE_TYPE_NAME("catalina-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_catalina_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_evb.c +0 -1
@@ -58,7 +58,6 @@ static const TypeInfo aspeed_ast2600_evb_types[] = { .name = MACHINE_TYPE_NAME("ast2600-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2600_evb_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_fby35.c +0 -1
@@ -171,7 +171,6 @@ static const TypeInfo aspeed_ast2600_fby35_types[] = { .name = MACHINE_TYPE_NAME("fby35-bmc"), .parent = MACHINE_TYPE_NAME("ast2600-evb"), .class_init = aspeed_machine_fby35_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_fuji.c +0 -1
@@ -133,7 +133,6 @@ static const TypeInfo aspeed_ast2600_fuji_types[] = { .name = MACHINE_TYPE_NAME("fuji-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_fuji_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_gb200nvl.c +0 -1
@@ -104,7 +104,6 @@ static const TypeInfo aspeed_ast2600_gb200nvl_types[] = { .name = MACHINE_TYPE_NAME("gb200nvl-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_gb200nvl_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast2600_rainier.c +0 -1
@@ -191,7 +191,6 @@ static const TypeInfo aspeed_ast2600_rainier_types[] = { .name = MACHINE_TYPE_NAME("rainier-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_rainier_class_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/aspeed_ast27x0-fc.c +0 -1
@@ -236,7 +236,6 @@ static const TypeInfo ast2700fc_types[] = { .class_init = ast2700fc_class_init, .instance_size = sizeof(Ast2700FCState), .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, }, };
hw/arm/aspeed_ast27x0_evb.c +0 -2
@@ -77,14 +77,12 @@ static const TypeInfo aspeed_ast27x0_evb_types[] = { .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2700a1_evb_class_init, .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("ast2700a2-evb"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_ast2700a2_evb_class_init, .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, } };
hw/arm/ax3000-boards.c +0 -1
@@ -48,7 +48,6 @@ static const TypeInfo ax3000_machine_types[] = { .instance_size = sizeof(Ax3000MachineState), .class_size = sizeof(Ax3000MachineClass), .class_init = ax3000_machine_class_init, - .interfaces = aarch64_machine_interfaces, .abstract = true, } };
hw/arm/b-l475e-iot01a.c +0 -1
@@ -132,7 +132,6 @@ static const TypeInfo bl475e_machine_type[] = { .parent = TYPE_MACHINE, .instance_size = sizeof(Bl475eMachineState), .class_init = bl475e_machine_init, - .interfaces = arm_machine_interfaces, } };
hw/arm/bananapi_m2u.c +1 -1
@@ -154,4 +154,4 @@ static void bpim2u_machine_init(MachineClass *mc) }DEFINE_MACHINE_EXTENDED ("bpim2u" ,MACHINE , Bpim2uMachineState, - bpim2u_machine_init, false, arm_machine_interfaces) + bpim2u_machine_init, false,NULL )
hw/arm/collie.c +0 -1
@@ -85,7 +85,6 @@ static const TypeInfo collie_machine_typeinfo = { .parent = TYPE_MACHINE, .class_init = collie_machine_class_init, .instance_size = sizeof(CollieMachineState), - .interfaces = arm_machine_interfaces, };static void collie_machine_register_types (void )
hw/arm/cubieboard.c +1 -1
@@ -135,4 +135,4 @@ static void cubieboard_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("cubieboard" ,MACHINE , CubieboardMachineState, cubieboard_machine_init, false, - arm_machine_interfaces) +NULL )
hw/arm/exynos4_boards.c +0 -2
@@ -169,7 +169,6 @@ static const TypeInfo nuri_type = { .name = MACHINE_TYPE_NAME("nuri"), .parent = TYPE_MACHINE, .class_init = nuri_class_init, - .interfaces = arm_machine_interfaces, };static void smdkc210_class_init (ObjectClass *oc,const void *data)
@@ -190,7 +189,6 @@ static const TypeInfo smdkc210_type = { .name = MACHINE_TYPE_NAME("smdkc210"), .parent = TYPE_MACHINE, .class_init = smdkc210_class_init, - .interfaces = arm_machine_interfaces, };static void exynos4_machines_init (void )
hw/arm/imx8mm-evk.c +1 -1
@@ -136,4 +136,4 @@ static void imx8mm_evk_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("imx8mm-evk" ,MACHINE , Imx8mmEvkMachineState, imx8mm_evk_machine_init, false, - aarch64_machine_interfaces) +NULL )
hw/arm/imx8mp-evk.c +0 -1
@@ -162,7 +162,6 @@ static const TypeInfo imx8mp_evk_machine_types[] = { .class_init = imx8mp_evk_machine_class_init, .instance_init = imx8mp_evk_machine_init, .instance_size = sizeof(FslImx8mpEvkState), - .interfaces = aarch64_machine_interfaces, }, };
hw/arm/integratorcp.c +1 -1
@@ -706,7 +706,7 @@ static void integratorcp_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("integratorcp" ,MACHINE , IntegratorcpMachineState, integratorcp_machine_init, false, - arm_machine_interfaces) + NULL)static const Property core_properties[] = {DEFINE_PROP_UINT32 ("memsz" , IntegratorCMState, memsz,0 ),
hw/arm/mcimx7d-sabre.c +1 -1
@@ -88,4 +88,4 @@ static void mcimx7d_sabre_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("mcimx7d-sabre" ,MACHINE , Mcimx7dSabreMachineState, mcimx7d_sabre_machine_init, false, - arm_machine_interfaces) +NULL )
hw/arm/microbit.c +0 -1
@@ -75,7 +75,6 @@ static const TypeInfo microbit_info = { .parent = TYPE_MACHINE, .instance_size = sizeof(MicrobitMachineState), .class_init = microbit_machine_class_init, - .interfaces = arm_machine_interfaces, };static void microbit_machine_init (void )
hw/arm/mps2-tz.c +0 -4
@@ -1485,28 +1485,24 @@ static const TypeInfo mps2tz_an505_info = { .name = TYPE_MPS2TZ_AN505_MACHINE, .parent = TYPE_MPS2TZ_MACHINE, .class_init = mps2tz_an505_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps2tz_an521_info = { .name =TYPE_MPS2TZ_AN521_MACHINE , .parent =TYPE_MPS2TZ_MACHINE , .class_init = mps2tz_an521_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps3tz_an524_info = { .name =TYPE_MPS3TZ_AN524_MACHINE , .parent =TYPE_MPS2TZ_MACHINE , .class_init = mps3tz_an524_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps3tz_an547_info = { .name =TYPE_MPS3TZ_AN547_MACHINE , .parent =TYPE_MPS2TZ_MACHINE , .class_init = mps3tz_an547_class_init, - .interfaces = arm_machine_interfaces, };static void mps2tz_machine_init (void )
hw/arm/mps2.c +0 -4
@@ -568,28 +568,24 @@ static const TypeInfo mps2_an385_info = { .name = TYPE_MPS2_AN385_MACHINE, .parent = TYPE_MPS2_MACHINE, .class_init = mps2_an385_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps2_an386_info = { .name =TYPE_MPS2_AN386_MACHINE , .parent =TYPE_MPS2_MACHINE , .class_init = mps2_an386_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps2_an500_info = { .name =TYPE_MPS2_AN500_MACHINE , .parent =TYPE_MPS2_MACHINE , .class_init = mps2_an500_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo mps2_an511_info = { .name =TYPE_MPS2_AN511_MACHINE , .parent =TYPE_MPS2_MACHINE , .class_init = mps2_an511_class_init, - .interfaces = arm_machine_interfaces, };static void mps2_machine_init (void )
hw/arm/mps3r.c +0 -1
@@ -635,7 +635,6 @@ static const TypeInfo mps3r_machine_types[] = { .name = TYPE_MPS3R_AN536_MACHINE, .parent = TYPE_MPS3R_MACHINE, .class_init = mps3r_an536_class_init, - .interfaces = arm_machine_interfaces, }, };
hw/arm/musca.c +0 -2
@@ -658,14 +658,12 @@ static const TypeInfo musca_a_info = { .name = TYPE_MUSCA_A_MACHINE, .parent = TYPE_MUSCA_MACHINE, .class_init = musca_a_class_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo musca_b1_info = { .name =TYPE_MUSCA_B1_MACHINE , .parent =TYPE_MUSCA_MACHINE , .class_init = musca_b1_class_init, - .interfaces = arm_machine_interfaces, };static void musca_machine_init (void )
hw/arm/musicpal.c +1 -1
@@ -1366,7 +1366,7 @@ static void musicpal_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("musicpal" ,MACHINE , MusicPalMachineState, musicpal_machine_init, false, - arm_machine_interfaces) + NULL)static void mv88w8618_wlan_class_init (ObjectClass *klass,const void *data) {
hw/arm/npcm7xx_boards.c +0 -5
@@ -550,27 +550,22 @@ static const TypeInfo npcm7xx_machine_types[] = { .name = MACHINE_TYPE_NAME("npcm750-evb"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = npcm750_evb_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("quanta-gsj"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = gsj_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("quanta-gbs-bmc"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = gbs_bmc_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("kudo-bmc"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = kudo_bmc_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("mori-bmc"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = mori_bmc_machine_class_init, - .interfaces = arm_machine_interfaces, }, };
hw/arm/npcm8xx_boards.c +0 -1
@@ -249,7 +249,6 @@ static const TypeInfo npcm8xx_machine_types[] = { .name = MACHINE_TYPE_NAME("npcm845-evb"), .parent = TYPE_NPCM8XX_MACHINE, .class_init = npcm845_evb_machine_class_init, - .interfaces = aarch64_machine_interfaces, }, };
hw/arm/omap_sx1.c +0 -2
@@ -226,7 +226,6 @@ static const TypeInfo sx1_machine_v2_type = { .parent = TYPE_MACHINE, .class_init = sx1_machine_v2_class_init, .instance_size = sizeof(Sx1MachineState), - .interfaces = arm_machine_interfaces, };static void sx1_machine_v1_class_init (ObjectClass *oc,const void *data)
@@ -247,7 +246,6 @@ static const TypeInfo sx1_machine_v1_type = { .parent = TYPE_MACHINE, .class_init = sx1_machine_v1_class_init, .instance_size = sizeof(Sx1MachineState), - .interfaces = arm_machine_interfaces, };static void sx1_machine_init (void )
hw/arm/orangepi.c +1 -1
@@ -135,4 +135,4 @@ static void orangepi_machine_init(MachineClass *mc)DEFINE_MACHINE_EXTENDED ("orangepi-pc" ,MACHINE , OrangePiMachineState, orangepi_machine_init, false, - arm_machine_interfaces) +NULL )
hw/arm/raspi.c +0 -5
@@ -392,29 +392,24 @@ static const TypeInfo raspi_machine_types[] = { .name = MACHINE_TYPE_NAME("raspi0"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi0_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("raspi1ap"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi1ap_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("raspi2b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi2b_machine_class_init, - .interfaces = arm_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("raspi3ap"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3ap_machine_class_init, .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, }, { .name = MACHINE_TYPE_NAME("raspi3b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3b_machine_class_init, .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, }, { .name = TYPE_RASPI_MACHINE, .parent = TYPE_RASPI_BASE_MACHINE,
hw/arm/raspi4b.c +0 -1
@@ -127,7 +127,6 @@ static const TypeInfo raspi4b_machine_type = { .instance_size = sizeof(Raspi4bMachineState), .class_init = raspi4b_machine_class_init, .is_available = target_aarch64, - .interfaces = aarch64_machine_interfaces, };static void raspi4b_machine_register_type (void )
hw/arm/realview.c +0 -4
@@ -437,7 +437,6 @@ static const TypeInfo realview_eb_type = { .parent = TYPE_MACHINE, .class_init = realview_eb_class_init, .instance_size = sizeof(RealViewMachineState), - .interfaces = arm_machine_interfaces, };static void realview_eb_mpcore_class_init (ObjectClass *oc,const void *data)
@@ -460,7 +459,6 @@ static const TypeInfo realview_eb_mpcore_type = { .parent = TYPE_MACHINE, .class_init = realview_eb_mpcore_class_init, .instance_size = sizeof(RealViewMachineState), - .interfaces = arm_machine_interfaces, };static void realview_pb_a8_class_init (ObjectClass *oc,const void *data)
@@ -481,7 +479,6 @@ static const TypeInfo realview_pb_a8_type = { .parent = TYPE_MACHINE, .class_init = realview_pb_a8_class_init, .instance_size = sizeof(RealViewMachineState), - .interfaces = arm_machine_interfaces, };static void realview_pbx_a9_class_init (ObjectClass *oc,const void *data)
@@ -503,7 +500,6 @@ static const TypeInfo realview_pbx_a9_type = { .parent = TYPE_MACHINE, .class_init = realview_pbx_a9_class_init, .instance_size = sizeof(RealViewMachineState), - .interfaces = arm_machine_interfaces, };static void realview_machine_init (void )
hw/arm/sabrelite.c +0 -1
@@ -152,7 +152,6 @@ static const TypeInfo sabrelite_machine_init_typeinfo = { .instance_init = sabrelite_machine_instance_init, .instance_size = sizeof(SabreliteMachineState), .abstract = false, - .interfaces = arm_machine_interfaces, };static void sabrelite_machine_init_register_types (void )
hw/arm/sbsa-ref.c +0 -1
@@ -944,7 +944,6 @@ static const TypeInfo sbsa_ref_info = { .instance_finalize = sbsa_ref_instance_finalize, .class_init = sbsa_ref_class_init, .instance_size = sizeof(SBSAMachineState), - .interfaces = aarch64_machine_interfaces, };static void sbsa_ref_machine_init (void )
hw/arm/stellaris.c +0 -2
@@ -1428,7 +1428,6 @@ static const TypeInfo lm3s811evb_type = { .name = MACHINE_TYPE_NAME("lm3s811evb"), .parent = TYPE_MACHINE, .class_init = lm3s811evb_class_init, - .interfaces = arm_machine_interfaces, };/*
@@ -1450,7 +1449,6 @@ static const TypeInfo lm3s6965evb_type = { .name = MACHINE_TYPE_NAME("lm3s6965evb"), .parent = TYPE_MACHINE, .class_init = lm3s6965evb_class_init, - .interfaces = arm_machine_interfaces, };static void stellaris_machine_init (void )
hw/arm/versatilepb.c +0 -2
@@ -438,7 +438,6 @@ static const TypeInfo versatilepb_type = { .parent = TYPE_MACHINE, .class_init = versatilepb_class_init, .instance_size = sizeof(VersatileMachineState), - .interfaces = arm_machine_interfaces, };static void versatileab_class_init (ObjectClass *oc,const void *data)
@@ -461,7 +460,6 @@ static const TypeInfo versatileab_type = { .parent = TYPE_MACHINE, .class_init = versatileab_class_init, .instance_size = sizeof(VersatileMachineState), - .interfaces = arm_machine_interfaces, };static void versatile_machine_init (void )
hw/arm/vexpress.c +0 -2
@@ -850,7 +850,6 @@ static const TypeInfo vexpress_a9_info = { .parent = TYPE_VEXPRESS_MACHINE, .class_init = vexpress_a9_class_init, .instance_init = vexpress_a9_instance_init, - .interfaces = arm_machine_interfaces, };static const TypeInfo vexpress_a15_info = {
@@ -858,7 +857,6 @@ static const TypeInfo vexpress_a15_info = { .parent = TYPE_VEXPRESS_MACHINE, .class_init = vexpress_a15_class_init, .instance_init = vexpress_a15_instance_init, - .interfaces = arm_machine_interfaces, };static void vexpress_machine_init (void )
hw/arm/virt.c +0 -1
@@ -133,7 +133,6 @@ static void arm_virt_compat_default_set(MachineClass *mc) .name = MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ .parent = TYPE_VIRT_MACHINE, \ .class_init = MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ - .interfaces = arm_aarch64_machine_interfaces, \ }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \
hw/arm/xen-pvh.c +0 -1
@@ -96,7 +96,6 @@ static const TypeInfo xen_arm_machine_type = { .class_init = xen_arm_machine_class_init, .instance_size = sizeof(XenPVHMachineState), .instance_init = xen_arm_instance_init, - .interfaces = arm_aarch64_machine_interfaces, };static void xen_arm_machine_register_types (void )
hw/arm/xilinx_zynq.c +0 -1
@@ -479,7 +479,6 @@ static const TypeInfo zynq_machine_type = { .parent = TYPE_MACHINE, .class_init = zynq_machine_class_init, .instance_size = sizeof(ZynqMachineState), - .interfaces = arm_machine_interfaces, };static void zynq_machine_register_types (void )
hw/arm/xlnx-versal-virt.c +0 -2
@@ -402,14 +402,12 @@ static const TypeInfo versal_virt_machine_init_typeinfo = { .name = TYPE_XLNX_VERSAL_VIRT_MACHINE, .parent = TYPE_XLNX_VERSAL_VIRT_BASE_MACHINE, .class_init = versal_virt_machine_class_init, - .interfaces = aarch64_machine_interfaces, };static const TypeInfo versal2_virt_machine_init_typeinfo = { .name =TYPE_XLNX_VERSAL2_VIRT_MACHINE , .parent =TYPE_XLNX_VERSAL_VIRT_BASE_MACHINE , .class_init = versal2_virt_machine_class_init, - .interfaces = aarch64_machine_interfaces, };static void versal_virt_machine_init_register_types (void )
hw/arm/xlnx-zcu102.c +0 -1
@@ -303,7 +303,6 @@ static const TypeInfo xlnx_zcu102_machine_init_typeinfo = { .class_init = xlnx_zcu102_machine_class_init, .instance_init = xlnx_zcu102_machine_instance_init, .instance_size = sizeof(XlnxZCU102), - .interfaces = aarch64_machine_interfaces, };static void xlnx_zcu102_machine_init_register_types (void )
include/hw/arm/machines-qom.h +2 -14
@@ -11,18 +11,6 @@#include "hw/core/boards.h" -/* -* A machine filtered with arm_machine_interfaces[] or -* arm_aarch64_machine_interfaces[] will be available -* in both qemu-system-arm and qemu-system-aarch64 binaries. -* -* One filtered with aarch64_machine_interfaces[] will only -* be available in the qemu-system-aarch64 binary. -*/ -extern const InterfaceInfo arm_machine_interfaces[]; -extern const InterfaceInfo arm_aarch64_machine_interfaces[]; -extern const InterfaceInfo aarch64_machine_interfaces[]; -/* * A machine defined with the DEFINE_MACHINE_ARM() macro will be * available in both qemu-system-arm and qemu-system-aarch64 binaries.
@@ -32,9 +20,9 @@ extern const InterfaceInfo aarch64_machine_interfaces[];*/ #define DEFINE_MACHINE_ARM (namestr, machine_initfn) \ DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - arm_machine_interfaces) + NULL)#define DEFINE_MACHINE_AARCH64 (namestr, machine_initfn) \ DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - aarch64_machine_interfaces) + NULL)#endif
target/arm/machine.c +0 -12
@@ -1346,15 +1346,3 @@ const VMStateDescription vmstate_arm_cpu = { NULL } }; - -const InterfaceInfo arm_machine_interfaces[] = { - { } -}; - -const InterfaceInfo arm_aarch64_machine_interfaces[] = { - { } -}; - -const InterfaceInfo aarch64_machine_interfaces[] = { - { } -};
Signature · 1 line
2.43.0
Re: [PATCH 08/14] hw/arm: remove {arm, arm_aarch64, aarch64}_machine_interfaces
Quoted 54 lines · Pierrick Bouvier via qemu development
We can now remove those arrays.
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/arm/aspeed_ast1040_evb.c | 1 - hw/arm/aspeed_ast10x0_evb.c | 2 -- hw/arm/aspeed_ast2400_palmetto.c | 1 - hw/arm/aspeed_ast2400_quanta-q71l.c | 1 - hw/arm/aspeed_ast2400_supermicrox11.c | 1 - hw/arm/aspeed_ast2500_evb.c | 1 - hw/arm/aspeed_ast2500_g220a.c | 1 - hw/arm/aspeed_ast2500_romulus.c | 1 - hw/arm/aspeed_ast2500_supermicro-x11spi.c | 1 - hw/arm/aspeed_ast2500_tiogapass.c | 1 - hw/arm/aspeed_ast2500_witherspoon.c | 1 - hw/arm/aspeed_ast2500_yosemitev2.c | 1 - hw/arm/aspeed_ast2600_anacapa.c | 1 - hw/arm/aspeed_ast2600_bletchley.c | 1 - hw/arm/aspeed_ast2600_catalina.c | 1 - hw/arm/aspeed_ast2600_evb.c | 1 - hw/arm/aspeed_ast2600_fby35.c | 1 - hw/arm/aspeed_ast2600_fuji.c | 1 - hw/arm/aspeed_ast2600_gb200nvl.c | 1 - hw/arm/aspeed_ast2600_rainier.c | 1 - hw/arm/aspeed_ast27x0-fc.c | 1 - hw/arm/aspeed_ast27x0_evb.c | 2 -- hw/arm/ax3000-boards.c | 1 - hw/arm/b-l475e-iot01a.c | 1 - hw/arm/bananapi_m2u.c | 2 +- hw/arm/collie.c | 1 - hw/arm/cubieboard.c | 2 +- hw/arm/exynos4_boards.c | 2 -- hw/arm/imx8mm-evk.c | 2 +- hw/arm/imx8mp-evk.c | 1 - hw/arm/integratorcp.c | 2 +- hw/arm/mcimx7d-sabre.c | 2 +- hw/arm/microbit.c | 1 - hw/arm/mps2-tz.c | 4 ---- hw/arm/mps2.c | 4 ---- hw/arm/mps3r.c | 1 - hw/arm/musca.c | 2 -- hw/arm/musicpal.c | 2 +- hw/arm/npcm7xx_boards.c | 5 ----- hw/arm/npcm8xx_boards.c | 1 - hw/arm/omap_sx1.c | 2 -- hw/arm/orangepi.c | 2 +- hw/arm/raspi.c | 5 ----- hw/arm/raspi4b.c | 1 - hw/arm/realview.c | 4 ---- hw/arm/sabrelite.c | 1 - hw/arm/sbsa-ref.c | 1 - hw/arm/stellaris.c | 2 -- hw/arm/versatilepb.c | 2 -- hw/arm/vexpress.c | 2 --
Quoted 8 lines
hw/arm/virt.c | 1 - hw/arm/xen-pvh.c | 1 - hw/arm/xilinx_zynq.c | 1 - hw/arm/xlnx-versal-virt.c | 2 -- hw/arm/xlnx-zcu102.c | 1 - include/hw/arm/machines-qom.h | 16 ++-------------- target/arm/machine.c | 12 ------------ 57 files changed, 9 insertions(+), 107 deletions(-)
Re: [PATCH 08/14] hw/arm: remove {arm, arm_aarch64, aarch64}_machine_interfaces
Quoted 5 lines
Quoted 2 lines
target/arm/machine.c | 12 ------------ 57 files changed, 9 insertions(+), 107 deletions(-)Reviewed-by Philippe Mathieu-Daudé <[email protected]>
When do queue, should add the following change after rebase to tip
hw/arm/mps2-tz.c | 1 - 1 file changed, 1 deletion(-)
hw/arm/mps2-tz.c +0 -1
@@ -1654,7 +1654,6 @@ static const TypeInfo mps3tz_an555_info = { .name = TYPE_MPS3TZ_AN555_MACHINE, .parent = TYPE_MPS2TZ_MACHINE, .class_init = mps3tz_an555_class_init, - .interfaces = arm_machine_interfaces, };static void mps2tz_machine_init (void )
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
PATCH 4/14 target-info: remove machine_typename
In reply to Pierrick BouvierThis field is now unused, so we can remove it.
--- configs/targets/aarch64-softmmu.c | 1 - configs/targets/arm-softmmu.c | 1 - configs/targets/riscv32-softmmu.c | 1 - configs/targets/riscv64-softmmu.c | 1 - include/qemu/target-info-impl.h | 2 -- include/qemu/target-info.h | 8 -------- target-info-stub.c | 1 - target-info.c | 5 ----- 8 files changed, 20 deletions(-)
configs/targets/aarch64-softmmu.c +0 -1
@@ -18,7 +18,6 @@ static const TargetInfo target_info_aarch64_system = { .target_arch = SYS_EMU_TARGET_AARCH64, .long_bits = 64, .cpu_type = TYPE_ARM_CPU, - .machine_typename = TYPE_TARGET_AARCH64_MACHINE, .endianness = ENDIAN_MODE_LITTLE, .page_bits_vary = true, .page_bits_init = TARGET_PAGE_BITS_LEGACY,
configs/targets/arm-softmmu.c +0 -1
@@ -18,7 +18,6 @@ static const TargetInfo target_info_arm_system = { .target_arch = SYS_EMU_TARGET_ARM, .long_bits = 32, .cpu_type = TYPE_ARM_CPU, - .machine_typename = TYPE_TARGET_ARM_MACHINE, .endianness = ENDIAN_MODE_LITTLE, .page_bits_vary = true, .page_bits_init = TARGET_PAGE_BITS_LEGACY,
configs/targets/riscv32-softmmu.c +0 -1
@@ -18,7 +18,6 @@ static const TargetInfo target_info_riscv32_system = { .target_arch = SYS_EMU_TARGET_RISCV32, .long_bits = 32, .cpu_type = TYPE_RISCV_CPU, - .machine_typename = TYPE_TARGET_RISCV32_MACHINE, .endianness = ENDIAN_MODE_LITTLE, .page_bits_init = TARGET_PAGE_BITS, };
configs/targets/riscv64-softmmu.c +0 -1
@@ -18,7 +18,6 @@ static const TargetInfo target_info_riscv64_system = { .target_arch = SYS_EMU_TARGET_RISCV64, .long_bits = 64, .cpu_type = TYPE_RISCV_CPU, - .machine_typename = TYPE_TARGET_RISCV64_MACHINE, .endianness = ENDIAN_MODE_LITTLE, .page_bits_init = TARGET_PAGE_BITS, };
include/qemu/target-info-impl.h +0 -2
@@ -21,8 +21,6 @@ typedef struct TargetInfo {unsigned long_bits;/* runtime equivalent of CPU_RESOLVING_TYPE definition */ const char *cpu_type; -/* QOM typename machines for this binary must implement */ -const char *machine_typename;/* related to TARGET_BIG_ENDIAN definition */ EndianMode endianness;/*
include/qemu/target-info.h +0 -8
@@ -23,14 +23,6 @@ const char *target_name(void);*/ unsigned target_long_bits (void ); -/** -* target_machine_typename: -* -* Returns: Name of the QOM interface implemented by machines -* usable on this target binary. -*/ -const char *target_machine_typename (void ); -/** * target_cpu_type: *
target-info-stub.c +0 -1
@@ -29,7 +29,6 @@ static const TargetInfo target_info_stub = { .target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH), .long_bits = TARGET_LONG_BITS, .cpu_type = CPU_RESOLVING_TYPE, - .machine_typename = TYPE_MACHINE, .endianness =TARGET_BIG_ENDIAN ?ENDIAN_MODE_BIG :ENDIAN_MODE_LITTLE , #ifdef TARGET_PAGE_BITS_VARY .page_bits_vary = true,
target-info.c +0 -5
@@ -32,11 +32,6 @@ const char *target_cpu_type(void)return target_info ()->cpu_type; } -const char *target_machine_typename (void ) -{ -return target_info ()->machine_typename; -} -EndianMode target_endian_mode (void ) {return target_info ()->endianness;
Signature · 1 line
2.43.0
Quoted 13 lines · Pierrick Bouvier
This field is now unused, so we can remove it.
Signed-off-by Pierrick Bouvier <[email protected]>--- configs/targets/aarch64-softmmu.c | 1 - configs/targets/arm-softmmu.c | 1 - configs/targets/riscv32-softmmu.c | 1 - configs/targets/riscv64-softmmu.c | 1 - include/qemu/target-info-impl.h | 2 -- include/qemu/target-info.h | 8 -------- target-info-stub.c | 1 - target-info.c | 5 ----- 8 files changed, 20 deletions(-)
PATCH 5/14 configs/targets: remove target info definitions
In reply to Pierrick BouvierNow that we remove machine_typename, we don't need to keep duplicated file per target anymore. So we can just rely on target-info-stub.c.
--- configs/targets/aarch64-softmmu.c | 26 -------------------------- configs/targets/arm-softmmu.c | 26 -------------------------- configs/targets/meson.build | 6 ------ configs/targets/riscv32-softmmu.c | 25 ------------------------- configs/targets/riscv64-softmmu.c | 25 ------------------------- meson.build | 7 +------ 6 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 configs/targets/aarch64-softmmu.c delete mode 100644 configs/targets/arm-softmmu.c delete mode 100644 configs/targets/meson.build delete mode 100644 configs/targets/riscv32-softmmu.c delete mode 100644 configs/targets/riscv64-softmmu.c
configs/targets/aarch64-softmmu.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* QEMU binary/target API (qemu-system-aarch64) -* -* Copyright (c) Linaro -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "qemu/osdep.h" -#include "qemu/target-info-impl.h" -#include "qemu/target-info-init.h" -#include "hw/arm/machines-qom.h" -#include "target/arm/cpu-qom.h" -#include "target/arm/cpu-param.h" - -static const TargetInfo target_info_aarch64_system = { - .target_name ="aarch64" , - .target_arch =SYS_EMU_TARGET_AARCH64 , - .long_bits =64 , - .cpu_type =TYPE_ARM_CPU , - .endianness =ENDIAN_MODE_LITTLE , - .page_bits_vary = true, - .page_bits_init =TARGET_PAGE_BITS_LEGACY , -}; - -target_info_init (target_info_aarch64_system)
configs/targets/arm-softmmu.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* QEMU binary/target API (qemu-system-arm) -* -* Copyright (c) Linaro -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "qemu/osdep.h" -#include "qemu/target-info-impl.h" -#include "qemu/target-info-init.h" -#include "hw/arm/machines-qom.h" -#include "target/arm/cpu-qom.h" -#include "target/arm/cpu-param.h" - -static const TargetInfo target_info_arm_system = { - .target_name ="arm" , - .target_arch =SYS_EMU_TARGET_ARM , - .long_bits =32 , - .cpu_type =TYPE_ARM_CPU , - .endianness =ENDIAN_MODE_LITTLE , - .page_bits_vary = true, - .page_bits_init =TARGET_PAGE_BITS_LEGACY , -}; - -target_info_init (target_info_arm_system)
configs/targets/meson.build deleted +0 -6
@@ -1,6 +0,0 @@ -foreach target : [ - 'arm-softmmu', 'aarch64-softmmu', - 'riscv32-softmmu', 'riscv64-softmmu' - ] - config_target_info += {target : files(target + '.c')} -endforeach
configs/targets/riscv32-softmmu.c deleted +0 -25
@@ -1,25 +0,0 @@ -/* -* QEMU binary/target API (qemu-system-riscv32) -* -* Copyright (c) rev.ng Labs Srl. -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "qemu/osdep.h" -#include "qemu/target-info-impl.h" -#include "qemu/target-info-init.h" -#include "hw/riscv/machines-qom.h" -#include "target/riscv/cpu-qom.h" -#include "target/riscv/cpu-param.h" - -static const TargetInfo target_info_riscv32_system = { - .target_name ="riscv32" , - .target_arch =SYS_EMU_TARGET_RISCV32 , - .long_bits =32 , - .cpu_type =TYPE_RISCV_CPU , - .endianness =ENDIAN_MODE_LITTLE , - .page_bits_init =TARGET_PAGE_BITS , -}; - -target_info_init (target_info_riscv32_system)
configs/targets/riscv64-softmmu.c deleted +0 -25
@@ -1,25 +0,0 @@ -/* -* QEMU binary/target API (qemu-system-riscv64) -* -* Copyright (c) rev.ng Labs Srl. -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "qemu/osdep.h" -#include "qemu/target-info-impl.h" -#include "qemu/target-info-init.h" -#include "hw/riscv/machines-qom.h" -#include "target/riscv/cpu-qom.h" -#include "target/riscv/cpu-param.h" - -static const TargetInfo target_info_riscv64_system = { - .target_name ="riscv64" , - .target_arch =SYS_EMU_TARGET_RISCV64 , - .long_bits =64 , - .cpu_type =TYPE_RISCV_CPU , - .endianness =ENDIAN_MODE_LITTLE , - .page_bits_init =TARGET_PAGE_BITS , -}; - -target_info_init (target_info_riscv64_system)
meson.build +1 -6
@@ -3746,7 +3746,6 @@ subdir('dump') subdir('accel') subdir('backends') -subdir('configs/targets') subdir('disas') subdir('migration') subdir('monitor')
@@ -4323,11 +4322,7 @@ foreach target : target_dirs endif endif - if target in config_target_info - arch_srcs += config_target_info[target] - else - arch_srcs += files('target-info-stub.c') - endif + arch_srcs += files('target-info-stub.c') if target_base_arch in target_arch t = target_arch[target_base_arch].apply(config_target, strict: false)
Signature · 1 line
2.43.0
Re: [PATCH 05/14] configs/targets: remove target info definitions
Quoted 12 lines · Pierrick Bouvier
Now that we remove
machine_typename, we don't need to keep duplicated file per target anymore. So we can just rely ontarget-info-stub.c.Signed-off-by Pierrick Bouvier <[email protected]>--- configs/targets/aarch64-softmmu.c | 26 -------------------------- configs/targets/arm-softmmu.c | 26 -------------------------- configs/targets/meson.build | 6 ------ configs/targets/riscv32-softmmu.c | 25 ------------------------- configs/targets/riscv64-softmmu.c | 25 ------------------------- meson.build | 7 +------ 6 files changed, 1 insertion(+), 114 deletions(-)
Quoted 5 lines
delete mode 100644
configs/targets/aarch64-softmmu.cdelete mode 100644configs/targets/arm-softmmu.cdelete mode 100644 configs/targets/meson.build delete mode 100644configs/targets/riscv32-softmmu.cdelete mode 100644configs/targets/riscv64-softmmu.c
We also need to update MAINTAINERS. Anyway I rather keep that for now (including the following patch). I'am squashing removal of "*machines-qom.h" include lines where appropriate.
Re: [PATCH 05/14] configs/targets: remove target info definitions
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Pierrick Bouvier
Now that we remove
machine_typename, we don't need to keep duplicated file per target anymore. So we can just rely ontarget-info-stub.c.Signed-off-by Pierrick Bouvier <[email protected]>---
configs/targets/aarch64-softmmu.c| 26 -------------------------- configs/targets/arm-softmmu.c | 26 -------------------------- configs/targets/meson.build | 6 ------configs/targets/riscv32-softmmu.c| 25 -------------------------configs/targets/riscv64-softmmu.c| 25 ------------------------- meson.build | 7 +------Quoted 6 lines
6 files changed, 1 insertion(+), 114 deletions(-)delete mode 100644
configs/targets/aarch64-softmmu.cdelete mode 100644configs/targets/arm-softmmu.cdelete mode 100644 configs/targets/meson.build delete mode 100644configs/targets/riscv32-softmmu.cdelete mode 100644configs/targets/riscv64-softmmu.c
Quoted 3 lines
We also need to update
MAINTAINERS. Anyway I rather keep that for now (including the following patch). I'am squashing removal of "*machines-qom.h" include lines where appropriate.
I don't mind this too much.
Out of curiosity, what's the reason to keep it?
The only reason it was duplicated was to specify different typenames. It could be argued that writing them without defines helps to see definitions for each target, but not sure it's worth the copy paste IMHO.
Regards,
Pierrick
Re: [PATCH 05/14] configs/targets: remove target info definitions
Quoted 24 lines · Pierrick Bouvier
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Pierrick Bouvier
Now that we remove
machine_typename, we don't need to keep duplicated file per target anymore. So we can just rely ontarget-info-stub.c.Signed-off-by Pierrick Bouvier <[email protected]>---
configs/targets/aarch64-softmmu.c| 26 -------------------------- configs/targets/arm-softmmu.c | 26 -------------------------- configs/targets/meson.build | 6 ------configs/targets/riscv32-softmmu.c| 25 -------------------------configs/targets/riscv64-softmmu.c| 25 ------------------------- meson.build | 7 +------Quoted 6 lines
6 files changed, 1 insertion(+), 114 deletions(-)delete mode 100644
configs/targets/aarch64-softmmu.cdelete mode 100644configs/targets/arm-softmmu.cdelete mode 100644 configs/targets/meson.build delete mode 100644configs/targets/riscv32-softmmu.cdelete mode 100644configs/targets/riscv64-softmmu.cQuoted 3 lines
We also need to update
MAINTAINERS. Anyway I rather keep that for now (including the following patch). I'am squashing removal of "*machines-qom.h" include lines where appropriate.
Quoted 8 lines
I don't mind this too much.
Out of curiosity, what's the reason to keep it?
The only reason it was duplicated was to specify different typenames. It could be argued that writing them without defines helps to see definitions for each target, but not sure it's worth the copy paste IMHO.
Answer from Philippe:
idea is to keep them is to remove more cpu defines, and eradicate cpu-param.h headers. Sounds good to me.
Quoted 2 lines
Regards,
Pierrick
PATCH 6/14 target-info: rename target-info-stub.c in target-info-def.c
In reply to Pierrick BouvierNow it's the only file left to define target info, we call it def to make the intent more clear.
--- meson.build | 2 +- target-info-stub.c => target-info-def.c | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename target-info-stub.c => target-info-def.c (100%)
meson.build +1 -1
@@ -4322,7 +4322,7 @@ foreach target : target_dirs endif endif - arch_srcs += files('target-info-stub.c') + arch_srcs += files('target-info-def.c') if target_base_arch in target_arch t = target_arch[target_base_arch].apply(config_target, strict: false)
target-info-def.c renamed from target-info-stub.c +0 -0
Signature · 1 line
2.43.0
PATCH 7/14 hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE
In reply to Pierrick BouvierWe don't need those types anymore.
--- hw/core/null-machine.c | 2 -- hw/nitro/machine.c | 5 ----- hw/remote/machine.c | 2 -- include/hw/arm/machines-qom.h | 6 ------ target-info-qom.c | 8 -------- target/arm/machine.c | 5 ----- 6 files changed, 28 deletions(-)
hw/core/null-machine.c +0 -2
@@ -58,8 +58,6 @@ static void machine_none_machine_init(MachineClass *mc) }DEFINE_MACHINE_WITH_INTERFACES ("none" , machine_none_machine_init, - { TYPE_TARGET_AARCH64_MACHINE }, - { TYPE_TARGET_ARM_MACHINE }, { TYPE_TARGET_RISCV32_MACHINE }, { TYPE_TARGET_RISCV64_MACHINE }, { })
hw/nitro/machine.c +0 -5
@@ -262,11 +262,6 @@ static const TypeInfo nitro_machine_info = { .parent = TYPE_MACHINE, .instance_size = sizeof(NitroMachineState), .class_init = nitro_machine_class_init, - .interfaces = (const InterfaceInfo []) { -/* x86_64 and aarch64 only */ - {TYPE_TARGET_AARCH64_MACHINE }, - { } - }, };static void nitro_machine_register (void )
hw/remote/machine.c +0 -2
@@ -149,8 +149,6 @@ static const TypeInfo remote_machine = { .class_init = remote_machine_class_init, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, - {TYPE_TARGET_AARCH64_MACHINE }, - {TYPE_TARGET_ARM_MACHINE }, { } } };
include/hw/arm/machines-qom.h +0 -6
@@ -11,12 +11,6 @@#include "hw/core/boards.h" -#define TYPE_TARGET_ARM_MACHINE \ - "target-info-arm-machine" - -#define TYPE_TARGET_AARCH64_MACHINE \ - "target-info-aarch64-machine" -/* * A machine filtered with arm_machine_interfaces[] or * arm_aarch64_machine_interfaces[] will be available
target-info-qom.c +0 -8
@@ -16,14 +16,6 @@#include "hw/riscv/machines-qom.h" static const TypeInfo target_info_types[] = { - { - .name =TYPE_TARGET_ARM_MACHINE , - .parent =TYPE_INTERFACE , - }, - { - .name =TYPE_TARGET_AARCH64_MACHINE , - .parent =TYPE_INTERFACE , - }, { .name =TYPE_TARGET_RISCV32_MACHINE , .parent =TYPE_INTERFACE ,
target/arm/machine.c +0 -5
@@ -1348,18 +1348,13 @@ const VMStateDescription vmstate_arm_cpu = { };const InterfaceInfo arm_machine_interfaces[] = { - {TYPE_TARGET_ARM_MACHINE }, - {TYPE_TARGET_AARCH64_MACHINE }, { } };const InterfaceInfo arm_aarch64_machine_interfaces[] = { - {TYPE_TARGET_ARM_MACHINE }, - {TYPE_TARGET_AARCH64_MACHINE }, { } };const InterfaceInfo aarch64_machine_interfaces[] = { - {TYPE_TARGET_AARCH64_MACHINE }, { } };
Signature · 1 line
2.43.0
Re: [PATCH 07/14] hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE
Quoted 11 lines · Pierrick Bouvier
We don't need those types anymore.
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/core/null-machine.c | 2 -- hw/nitro/machine.c | 5 ----- hw/remote/machine.c | 2 -- include/hw/arm/machines-qom.h | 6 ------ target-info-qom.c | 8 -------- target/arm/machine.c | 5 ----- 6 files changed, 28 deletions(-)
PATCH 12/14 hw/riscv: remove {riscv32, riscv32_64, riscv64}_machine_interfaces
In reply to Pierrick Bouvier--- hw/riscv/k230.c | 1 - hw/riscv/microchip_pfsoc.c | 1 - hw/riscv/opentitan.c | 1 - hw/riscv/shakti_c.c | 1 - hw/riscv/sifive_e.c | 1 - hw/riscv/sifive_u.c | 1 - hw/riscv/spike.c | 1 - hw/riscv/tt_atlantis.c | 1 - hw/riscv/xiangshan_kmh.c | 1 - include/hw/riscv/machines-qom.h | 15 +++------------ target/riscv/machine.c | 12 ------------ 11 files changed, 3 insertions(+), 33 deletions(-)
hw/riscv/k230.c +0 -1
@@ -556,7 +556,6 @@ static const TypeInfo k230_machine_typeinfo = { .class_init = k230_machine_class_init, .instance_init = k230_machine_instance_init, .instance_size = sizeof(K230MachineState), - .interfaces = riscv64_machine_interfaces, };static void k230_machine_init_register_types (void )
hw/riscv/microchip_pfsoc.c +0 -1
@@ -756,7 +756,6 @@ static const TypeInfo microchip_icicle_kit_machine_typeinfo = { .class_init = microchip_icicle_kit_machine_class_init, .instance_init = microchip_icicle_kit_machine_instance_init, .instance_size = sizeof(MicrochipIcicleKitState), - .interfaces = riscv64_machine_interfaces, };static void microchip_icicle_kit_machine_init_register_types (void )
hw/riscv/opentitan.c +0 -1
@@ -338,7 +338,6 @@ static const TypeInfo open_titan_types[] = { .parent = TYPE_MACHINE, .instance_size = sizeof(OpenTitanState), .class_init = opentitan_machine_class_init, - .interfaces = riscv32_machine_interfaces, } };
hw/riscv/shakti_c.c +0 -1
@@ -98,7 +98,6 @@ static const TypeInfo shakti_c_machine_type_info = { .class_init = shakti_c_machine_class_init, .instance_init = shakti_c_machine_instance_init, .instance_size = sizeof(ShaktiCMachineState), - .interfaces = riscv64_machine_interfaces, };static void shakti_c_machine_type_info_register (void )
hw/riscv/sifive_e.c +0 -1
@@ -168,7 +168,6 @@ static const TypeInfo sifive_e_machine_typeinfo = { .class_init = sifive_e_machine_class_init, .instance_init = sifive_e_machine_instance_init, .instance_size = sizeof(SiFiveEState), - .interfaces = riscv32_64_machine_interfaces, };static void sifive_e_machine_init_register_types (void )
hw/riscv/sifive_u.c +0 -1
@@ -680,7 +680,6 @@ static const TypeInfo sifive_u_machine_typeinfo = { .class_init = sifive_u_machine_class_init, .instance_init = sifive_u_machine_instance_init, .instance_size = sizeof(SiFiveUState), - .interfaces = riscv32_64_machine_interfaces, };static void sifive_u_machine_init_register_types (void )
hw/riscv/spike.c +0 -1
@@ -292,7 +292,6 @@ static const TypeInfo spike_machine_typeinfo = { .class_init = spike_machine_class_init, .instance_init = spike_machine_instance_init, .instance_size = sizeof(SpikeState), - .interfaces = riscv32_64_machine_interfaces, };static void spike_machine_init_register_types (void )
hw/riscv/tt_atlantis.c +0 -1
@@ -609,7 +609,6 @@ static const TypeInfo tt_atlantis_types[] = { .parent = TYPE_MACHINE, .class_init = tt_atlantis_machine_class_init, .instance_size = sizeof(TTAtlantisState), - .interfaces = riscv64_machine_interfaces, }, };
hw/riscv/xiangshan_kmh.c +0 -1
@@ -216,7 +216,6 @@ static const TypeInfo xiangshan_kmh_machine_info = { .parent = TYPE_MACHINE, .instance_size = sizeof(XiangshanKmhState), .class_init = xiangshan_kmh_machine_class_init, - .interfaces = riscv64_machine_interfaces, };static void xiangshan_kmh_machine_register_types (void )
include/hw/riscv/machines-qom.h +3 -12
@@ -11,15 +11,6 @@#include "hw/core/boards.h" -/* -* Interfaces specifying whether a given QOM object is available in -* qemu-system-riscv32, qemu-system-riscv64, or both. -*/ - -extern const InterfaceInfo riscv32_machine_interfaces[]; -extern const InterfaceInfo riscv64_machine_interfaces[]; -extern const InterfaceInfo riscv32_64_machine_interfaces[]; -/* * Helper macros for defining machines available in qemu-system-riscv32, * qemu-system-riscv64, or both.
@@ -27,14 +18,14 @@ extern const InterfaceInfo riscv32_64_machine_interfaces[];#define DEFINE_MACHINE_RISCV32 (namestr, machine_initfn) \ DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - riscv32_machine_interfaces) + NULL)#define DEFINE_MACHINE_RISCV64 (namestr, machine_initfn) \ DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - riscv64_machine_interfaces) + NULL)#define DEFINE_MACHINE_RISCV32_64 (namestr, machine_initfn) \ DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - riscv32_64_machine_interfaces) + NULL)#endif
target/riscv/machine.c +0 -12
@@ -580,15 +580,3 @@ const VMStateDescription vmstate_riscv_cpu = { NULL } }; - -const InterfaceInfo riscv32_machine_interfaces[] = { - { } -}; - -const InterfaceInfo riscv64_machine_interfaces[] = { - { } -}; - -const InterfaceInfo riscv32_64_machine_interfaces[] = { - { } -};
Signature · 1 line
2.43.0
Re: [PATCH 12/14] hw/riscv: remove {riscv32, riscv32_64, riscv64}_machine_interfaces
Quoted 14 lines · Pierrick Bouvier via qemu development
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/riscv/k230.c | 1 - hw/riscv/microchip_pfsoc.c | 1 - hw/riscv/opentitan.c | 1 - hw/riscv/shakti_c.c | 1 - hw/riscv/sifive_e.c | 1 - hw/riscv/sifive_u.c | 1 - hw/riscv/spike.c | 1 - hw/riscv/tt_atlantis.c | 1 - hw/riscv/xiangshan_kmh.c | 1 - include/hw/riscv/machines-qom.h | 15 +++------------ target/riscv/machine.c | 12 ------------ 11 files changed, 3 insertions(+), 33 deletions(-)
PATCH 9/14 hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM}
In reply to Pierrick Bouvier--- hw/arm/digic_boards.c | 2 +- hw/arm/imx25_pdk.c | 2 +- hw/arm/kzm.c | 2 +- hw/arm/max78000fthr.c | 2 +- hw/arm/mcimx6ul-evk.c | 2 +- hw/arm/msf2-som.c | 2 +- hw/arm/netduino2.c | 2 +- hw/arm/netduinoplus2.c | 2 +- hw/arm/olimex-stm32-h405.c | 2 +- hw/arm/stm32vldiscovery.c | 2 +- include/hw/arm/machines-qom.h | 14 -------------- 11 files changed, 10 insertions(+), 24 deletions(-)
hw/arm/digic_boards.c +1 -1
@@ -146,4 +146,4 @@ static void canon_a1100_machine_init(MachineClass *mc) mc->default_ram_id ="ram" ; } -DEFINE_MACHINE_ARM ("canon-a1100" , canon_a1100_machine_init) +DEFINE_MACHINE ("canon-a1100" , canon_a1100_machine_init)
hw/arm/imx25_pdk.c +1 -1
@@ -150,4 +150,4 @@ static void imx25_pdk_machine_init(MachineClass *mc) mc->auto_create_sdcard = true; } -DEFINE_MACHINE_ARM ("imx25-pdk" , imx25_pdk_machine_init) +DEFINE_MACHINE ("imx25-pdk" , imx25_pdk_machine_init)
hw/arm/kzm.c +1 -1
@@ -138,4 +138,4 @@ static void kzm_machine_init(MachineClass *mc) mc->default_ram_id ="kzm.ram" ; } -DEFINE_MACHINE_ARM ("kzm" , kzm_machine_init) +DEFINE_MACHINE ("kzm" , kzm_machine_init)
hw/arm/max78000fthr.c +1 -1
@@ -48,4 +48,4 @@ static void max78000_machine_init(MachineClass *mc) mc->valid_cpu_types = valid_cpu_types; } -DEFINE_MACHINE_ARM ("max78000fthr" , max78000_machine_init) +DEFINE_MACHINE ("max78000fthr" , max78000_machine_init)
hw/arm/mcimx6ul-evk.c +1 -1
@@ -78,4 +78,4 @@ static void mcimx6ul_evk_machine_init(MachineClass *mc) mc->auto_create_sdcard = true; } -DEFINE_MACHINE_ARM ("mcimx6ul-evk" , mcimx6ul_evk_machine_init) +DEFINE_MACHINE ("mcimx6ul-evk" , mcimx6ul_evk_machine_init)
hw/arm/msf2-som.c +1 -1
@@ -109,4 +109,4 @@ static void emcraft_sf2_machine_init(MachineClass *mc) mc->valid_cpu_types = valid_cpu_types; } -DEFINE_MACHINE_ARM ("emcraft-sf2" , emcraft_sf2_machine_init) +DEFINE_MACHINE ("emcraft-sf2" , emcraft_sf2_machine_init)
hw/arm/netduino2.c +1 -1
@@ -66,4 +66,4 @@ static void netduino2_machine_init(MachineClass *mc) mc->ignore_memory_transaction_failures = true; } -DEFINE_MACHINE_ARM ("netduino2" , netduino2_machine_init) +DEFINE_MACHINE ("netduino2" , netduino2_machine_init)
hw/arm/netduinoplus2.c +1 -1
@@ -66,4 +66,4 @@ static void netduinoplus2_machine_init(MachineClass *mc) mc->valid_cpu_types = valid_cpu_types; } -DEFINE_MACHINE_ARM ("netduinoplus2" , netduinoplus2_machine_init) +DEFINE_MACHINE ("netduinoplus2" , netduinoplus2_machine_init)
hw/arm/olimex-stm32-h405.c +1 -1
@@ -72,4 +72,4 @@ static void olimex_stm32_h405_machine_init(MachineClass *mc) mc->default_ram_size =0 ; } -DEFINE_MACHINE_ARM ("olimex-stm32-h405" , olimex_stm32_h405_machine_init) +DEFINE_MACHINE ("olimex-stm32-h405" , olimex_stm32_h405_machine_init)
hw/arm/stm32vldiscovery.c +1 -1
@@ -69,4 +69,4 @@ static void stm32vldiscovery_machine_init(MachineClass *mc) mc->valid_cpu_types = valid_cpu_types; } -DEFINE_MACHINE_ARM ("stm32vldiscovery" , stm32vldiscovery_machine_init) +DEFINE_MACHINE ("stm32vldiscovery" , stm32vldiscovery_machine_init)
include/hw/arm/machines-qom.h +0 -14
@@ -11,18 +11,4 @@#include "hw/core/boards.h" -/* -* A machine defined with the DEFINE_MACHINE_ARM() macro will be -* available in both qemu-system-arm and qemu-system-aarch64 binaries. -* -* One defined with DEFINE_MACHINE_AARCH64() will only be available in -* the qemu-system-aarch64 binary. -*/ -#define DEFINE_MACHINE_ARM (namestr, machine_initfn) \ - DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - NULL) -#define DEFINE_MACHINE_AARCH64 (namestr, machine_initfn) \ - DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - NULL) -#endif
Signature · 1 line
2.43.0
Re: [PATCH 09/14] hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM}
Quoted 14 lines · Pierrick Bouvier
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/arm/digic_boards.c | 2 +- hw/arm/imx25_pdk.c | 2 +- hw/arm/kzm.c | 2 +- hw/arm/max78000fthr.c | 2 +- hw/arm/mcimx6ul-evk.c | 2 +- hw/arm/msf2-som.c | 2 +- hw/arm/netduino2.c | 2 +- hw/arm/netduinoplus2.c | 2 +- hw/arm/olimex-stm32-h405.c | 2 +- hw/arm/stm32vldiscovery.c | 2 +- include/hw/arm/machines-qom.h | 14 -------------- 11 files changed, 10 insertions(+), 24 deletions(-)
PATCH 10/14 hw/arm: remove machines-qom.h
In reply to Pierrick BouvierHeader is now empty so we can remove it.
--- hw/arm/aspeed.c | 1 - hw/arm/aspeed_ast1040_evb.c | 1 - hw/arm/aspeed_ast10x0_evb.c | 1 - hw/arm/aspeed_ast2400_palmetto.c | 1 - hw/arm/aspeed_ast2400_quanta-q71l.c | 1 - hw/arm/aspeed_ast2400_supermicrox11.c | 1 - hw/arm/aspeed_ast2500_evb.c | 1 - hw/arm/aspeed_ast2500_g220a.c | 1 - hw/arm/aspeed_ast2500_romulus.c | 1 - hw/arm/aspeed_ast2500_supermicro-x11spi.c | 1 - hw/arm/aspeed_ast2500_tiogapass.c | 1 - hw/arm/aspeed_ast2500_witherspoon.c | 1 - hw/arm/aspeed_ast2500_yosemitev2.c | 1 - hw/arm/aspeed_ast2600_anacapa.c | 1 - hw/arm/aspeed_ast2600_bletchley.c | 1 - hw/arm/aspeed_ast2600_catalina.c | 1 - hw/arm/aspeed_ast2600_evb.c | 1 - hw/arm/aspeed_ast2600_fby35.c | 1 - hw/arm/aspeed_ast2600_fuji.c | 1 - hw/arm/aspeed_ast2600_gb200nvl.c | 1 - hw/arm/aspeed_ast2600_rainier.c | 1 - hw/arm/aspeed_ast27x0-fc.c | 1 - hw/arm/aspeed_ast27x0_evb.c | 1 - hw/arm/ax3000-boards.c | 1 - hw/arm/b-l475e-iot01a.c | 1 - hw/arm/bananapi_m2u.c | 1 - hw/arm/collie.c | 1 - hw/arm/cubieboard.c | 1 - hw/arm/digic_boards.c | 1 - hw/arm/exynos4_boards.c | 1 - hw/arm/imx25_pdk.c | 1 - hw/arm/imx8mm-evk.c | 1 - hw/arm/imx8mp-evk.c | 1 - hw/arm/integratorcp.c | 1 - hw/arm/kzm.c | 1 - hw/arm/max78000fthr.c | 1 - hw/arm/mcimx6ul-evk.c | 1 - hw/arm/mcimx7d-sabre.c | 1 - hw/arm/microbit.c | 1 - hw/arm/mps2-tz.c | 1 - hw/arm/mps2.c | 1 - hw/arm/mps3r.c | 1 - hw/arm/msf2-som.c | 1 - hw/arm/musca.c | 1 - hw/arm/musicpal.c | 1 - hw/arm/netduino2.c | 1 - hw/arm/netduinoplus2.c | 1 - hw/arm/npcm7xx_boards.c | 1 - hw/arm/npcm8xx_boards.c | 1 - hw/arm/olimex-stm32-h405.c | 1 - hw/arm/omap_sx1.c | 1 - hw/arm/orangepi.c | 1 - hw/arm/raspi.c | 1 - hw/arm/raspi4b.c | 1 - hw/arm/realview.c | 1 - hw/arm/sabrelite.c | 1 - hw/arm/sbsa-ref.c | 1 - hw/arm/stellaris.c | 1 - hw/arm/stm32vldiscovery.c | 1 - hw/arm/versatilepb.c | 1 - hw/arm/vexpress.c | 1 - hw/arm/virt.c | 1 - hw/arm/xen-pvh.c | 1 - hw/arm/xilinx_zynq.c | 1 - hw/arm/xlnx-versal-virt.c | 1 - hw/arm/xlnx-zcu102.c | 1 - hw/core/null-machine.c | 1 - hw/nitro/machine.c | 1 - hw/remote/machine.c | 1 - include/hw/arm/machines-qom.h | 14 -------------- target-info-qom.c | 1 - target/arm/machine.c | 1 - 72 files changed, 85 deletions(-) delete mode 100644 include/hw/arm/machines-qom.h
hw/arm/aspeed.c +0 -1
@@ -14,7 +14,6 @@#include "hw/arm/boot.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "hw/gpio/pca9552.h" #include "hw/gpio/pca9554.h"
hw/arm/aspeed_ast1040_evb.c +0 -1
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/core/qdev-clock.h"
hw/arm/aspeed_ast10x0_evb.c +0 -1
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/core/qdev-clock.h"
hw/arm/aspeed_ast2400_palmetto.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2400_quanta-q71l.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h"
hw/arm/aspeed_ast2400_supermicrox11.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2500_evb.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2500_g220a.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2500_romulus.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h"
hw/arm/aspeed_ast2500_supermicro-x11spi.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2500_tiogapass.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/nvram/eeprom_at24c.h"
hw/arm/aspeed_ast2500_witherspoon.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/misc/led.h"
hw/arm/aspeed_ast2500_yosemitev2.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/nvram/eeprom_at24c.h"
hw/arm/aspeed_ast2600_anacapa.c +0 -1
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/sensor/adc128d818.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/i2c_mux_pca954x.h"
hw/arm/aspeed_ast2600_bletchley.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/gpio/pca9552.h"
hw/arm/aspeed_ast2600_catalina.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/i2c_mux_pca954x.h"
hw/arm/aspeed_ast2600_evb.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/aspeed_ast2600_fby35.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/nvram/eeprom_at24c.h"
hw/arm/aspeed_ast2600_fuji.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/i2c/i2c_mux_pca954x.h"
hw/arm/aspeed_ast2600_gb200nvl.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/nvram/eeprom_at24c.h"
hw/arm/aspeed_ast2600_rainier.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/nvram/eeprom_at24c.h"
hw/arm/aspeed_ast27x0-fc.c +0 -1
@@ -22,7 +22,6 @@#include "hw/arm/boot.h" #include "hw/block/flash.h" #include "hw/arm/aspeed_coprocessor.h" -#include "hw/arm/machines-qom.h" #define TYPE_AST2700FC MACHINE_TYPE_NAME("ast2700fc")OBJECT_DECLARE_SIMPLE_TYPE (Ast2700FCState,AST2700FC );
hw/arm/aspeed_ast27x0_evb.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/sensor/tmp105.h"
hw/arm/ax3000-boards.c +0 -1
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "hw/arm/ax3000-boards.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "qemu/error-report.h" #include "qom/object.h"
hw/arm/b-l475e-iot01a.c +0 -1
@@ -29,7 +29,6 @@#include "qemu/error-report.h" #include "hw/arm/boot.h" #include "hw/core/split-irq.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/stm32l4x5_soc.h" #include "hw/gpio/stm32l4x5_gpio.h" #include "hw/display/dm163.h"
hw/arm/bananapi_m2u.c +0 -1
@@ -27,7 +27,6 @@#include "hw/core/qdev-properties.h" #include "hw/arm/allwinner-r40.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #define TYPE_BPIM2U_MACHINE MACHINE_TYPE_NAME("bpim2u")OBJECT_DECLARE_SIMPLE_TYPE (Bpim2uMachineState,BPIM2U_MACHINE )
hw/arm/collie.c +0 -1
@@ -15,7 +15,6 @@#include "hw/core/boards.h" #include "strongarm.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "system/address-spaces.h" #include "qom/object.h"
hw/arm/cubieboard.c +0 -1
@@ -22,7 +22,6 @@#include "hw/core/qdev-properties.h" #include "hw/arm/allwinner-a10.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/i2c/i2c.h" #define TYPE_CUBIEBOARD_MACHINE MACHINE_TYPE_NAME("cubieboard")
hw/arm/digic_boards.c +0 -1
@@ -29,7 +29,6 @@#include "hw/core/boards.h" #include "qemu/error-report.h" #include "hw/arm/digic.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "hw/core/loader.h" #include "system/qtest.h"
hw/arm/exynos4_boards.c +0 -1
@@ -28,7 +28,6 @@#include "hw/core/sysbus.h" #include "net/net.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "system/address-spaces.h" #include "hw/arm/exynos4210.h" #include "hw/net/lan9118.h"
hw/arm/imx25_pdk.c +0 -1
@@ -28,7 +28,6 @@#include "hw/core/qdev-properties.h" #include "hw/arm/fsl-imx25.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "qemu/error-report.h" #include "system/qtest.h"
hw/arm/imx8mm-evk.c +0 -1
@@ -11,7 +11,6 @@#include "system/address-spaces.h" #include "hw/arm/boot.h" #include "hw/arm/fsl-imx8mm.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "system/kvm.h"
hw/arm/imx8mp-evk.c +0 -1
@@ -10,7 +10,6 @@#include "system/address-spaces.h" #include "hw/arm/boot.h" #include "hw/arm/fsl-imx8mp.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "system/kvm.h"
hw/arm/integratorcp.c +0 -1
@@ -13,7 +13,6 @@#include "migration/vmstate.h" #include "hw/core/boards.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/misc/arm_integrator_debug.h" #include "hw/net/smc91c111.h" #include "net/net.h"
hw/arm/kzm.c +0 -1
@@ -17,7 +17,6 @@#include "qapi/error.h" #include "hw/arm/fsl-imx31.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "qemu/error-report.h" #include "system/address-spaces.h"
hw/arm/max78000fthr.c +0 -1
@@ -12,7 +12,6 @@#include "hw/core/qdev-properties.h" #include "hw/core/qdev-clock.h" #include "qemu/error-report.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/max78000_soc.h" #include "hw/arm/boot.h"
hw/arm/mcimx6ul-evk.c +0 -1
@@ -14,7 +14,6 @@#include "qapi/error.h" #include "hw/arm/fsl-imx6ul.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "qemu/error-report.h"
hw/arm/mcimx7d-sabre.c +0 -1
@@ -16,7 +16,6 @@#include "qapi/error.h" #include "hw/arm/fsl-imx7.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "qemu/error-report.h"
hw/arm/microbit.c +0 -1
@@ -12,7 +12,6 @@#include "qapi/error.h" #include "hw/core/boards.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "system/system.h" #include "system/address-spaces.h"
hw/arm/mps2-tz.c +0 -1
@@ -52,7 +52,6 @@#include "qemu/error-report.h" #include "hw/arm/boot.h" #include "hw/arm/armv7m.h" -#include "hw/arm/machines-qom.h" #include "hw/core/or-irq.h" #include "hw/core/boards.h" #include "system/address-spaces.h"
hw/arm/mps2.c +0 -1
@@ -31,7 +31,6 @@#include "qemu/error-report.h" #include "hw/arm/boot.h" #include "hw/arm/armv7m.h" -#include "hw/arm/machines-qom.h" #include "hw/core/or-irq.h" #include "hw/core/boards.h" #include "system/address-spaces.h"
hw/arm/mps3r.c +0 -1
@@ -37,7 +37,6 @@#include "hw/core/qdev-properties.h" #include "hw/arm/boot.h" #include "hw/arm/bsa.h" -#include "hw/arm/machines-qom.h" #include "hw/char/cmsdk-apb-uart.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/intc/arm_gicv3.h"
hw/arm/msf2-som.c +0 -1
@@ -32,7 +32,6 @@#include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/qdev-clock.h" #include "system/address-spaces.h" #include "hw/arm/msf2-soc.h"
hw/arm/musca.c +0 -1
@@ -26,7 +26,6 @@#include "system/system.h" #include "hw/arm/boot.h" #include "hw/arm/armsse.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/char/pl011.h" #include "hw/core/split-irq.h"
hw/arm/musicpal.c +0 -1
@@ -15,7 +15,6 @@#include "hw/core/sysbus.h" #include "migration/vmstate.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "net/net.h" #include "system/system.h" #include "hw/core/boards.h"
hw/arm/netduino2.c +0 -1
@@ -30,7 +30,6 @@#include "qemu/error-report.h" #include "hw/arm/stm32f205_soc.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" /* Main SYSCLK frequency in Hz (120MHz) */ #define SYSCLK_FRQ 120000000ULL
hw/arm/netduinoplus2.c +0 -1
@@ -30,7 +30,6 @@#include "qemu/error-report.h" #include "hw/arm/stm32f405_soc.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" /* Main SYSCLK frequency in Hz (168MHz) */ #define SYSCLK_FRQ 168000000ULL
hw/arm/npcm7xx_boards.c +0 -1
@@ -17,7 +17,6 @@#include "qemu/osdep.h" #include "hw/arm/npcm7xx.h" -#include "hw/arm/machines-qom.h" #include "hw/core/cpu.h" #include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_eeprom.h"
hw/arm/npcm8xx_boards.c +0 -1
@@ -19,7 +19,6 @@#include "chardev/char.h" #include "hw/core/boards.h" #include "hw/arm/npcm8xx.h" -#include "hw/arm/machines-qom.h" #include "hw/core/cpu.h" #include "hw/core/loader.h" #include "hw/core/qdev.h"
hw/arm/olimex-stm32-h405.c +0 -1
@@ -31,7 +31,6 @@#include "qemu/error-report.h" #include "hw/arm/stm32f405_soc.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" /* olimex-stm32-h405 implementation is derived from netduinoplus2 */
hw/arm/omap_sx1.c +0 -1
@@ -32,7 +32,6 @@#include "hw/arm/omap.h" #include "hw/core/boards.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "system/qtest.h" #include "system/address-spaces.h"
hw/arm/orangepi.c +0 -1
@@ -26,7 +26,6 @@#include "hw/core/qdev-properties.h" #include "hw/arm/allwinner-h3.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #define TYPE_ORANGEPI_MACHINE MACHINE_TYPE_NAME("orangepi-pc")OBJECT_DECLARE_SIMPLE_TYPE (OrangePiMachineState,ORANGEPI_MACHINE )
hw/arm/raspi.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/error-report.h" #include "hw/core/boards.h" #include "hw/core/loader.h" -#include "hw/arm/machines-qom.h" #include "qom/object.h" #define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common")
hw/arm/raspi4b.c +0 -1
@@ -11,7 +11,6 @@#include "qemu/cutils.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "hw/arm/machines-qom.h" #include "hw/arm/raspi_platform.h" #include "hw/display/bcm2835_fb.h" #include "hw/core/registerfields.h"
hw/arm/realview.c +0 -1
@@ -12,7 +12,6 @@#include "target/arm/cpu.h" #include "hw/core/sysbus.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/split-irq.h" #include "hw/misc/arm_sysctl.h" #include "hw/net/lan9118.h"
hw/arm/sabrelite.c +0 -1
@@ -14,7 +14,6 @@#include "qapi/error.h" #include "hw/arm/fsl-imx6.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "hw/core/qdev-properties.h" #include "qemu/error-report.h"
hw/arm/sbsa-ref.c +0 -1
@@ -35,7 +35,6 @@#include "hw/arm/bsa.h" #include "hw/arm/fdt.h" #include "hw/arm/smmuv3.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "hw/core/boards.h" #include "hw/ide/ide-bus.h"
hw/arm/stellaris.c +0 -1
@@ -15,7 +15,6 @@#include "hw/sd/sd.h" #include "hw/ssi/ssi.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "qemu/timer.h" #include "hw/i2c/i2c.h" #include "net/net.h"
hw/arm/stm32vldiscovery.c +0 -1
@@ -31,7 +31,6 @@#include "qemu/error-report.h" #include "hw/arm/stm32f100_soc.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" /* stm32vldiscovery implementation is derived from netduinoplus2 */
hw/arm/versatilepb.c +0 -1
@@ -12,7 +12,6 @@#include "hw/core/sysbus.h" #include "migration/vmstate.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/net/smc91c111.h" #include "net/net.h" #include "system/system.h"
hw/arm/vexpress.c +0 -1
@@ -26,7 +26,6 @@#include "qemu/datadir.h" #include "hw/core/sysbus.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/misc/arm_sysctl.h" #include "hw/net/lan9118.h" #include "hw/i2c/i2c.h"
hw/arm/virt.c +0 -1
@@ -37,7 +37,6 @@#include "hw/core/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/virt.h" -#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "hw/display/ramfb.h" #include "net/net.h"
hw/arm/xen-pvh.c +0 -1
@@ -10,7 +10,6 @@#include "hw/core/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/arm/machines-qom.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")
hw/arm/xilinx_zynq.c +0 -1
@@ -20,7 +20,6 @@#include "qapi/error.h" #include "hw/core/sysbus.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "net/net.h" #include "system/system.h" #include "hw/core/boards.h"
hw/arm/xlnx-versal-virt.c +0 -1
@@ -21,7 +21,6 @@#include "hw/arm/fdt.h" #include "hw/arm/xlnx-versal.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "qom/object.h" #include "target/arm/cpu.h"
hw/arm/xlnx-zcu102.c +0 -1
@@ -19,7 +19,6 @@#include "qapi/error.h" #include "hw/arm/xlnx-zynqmp.h" #include "hw/arm/boot.h" -#include "hw/arm/machines-qom.h" #include "hw/core/boards.h" #include "qemu/error-report.h" #include "qemu/log.h"
hw/core/null-machine.c +0 -1
@@ -16,7 +16,6 @@#include "hw/core/boards.h" #include "system/address-spaces.h" #include "hw/core/cpu.h" -#include "hw/arm/machines-qom.h" #include "hw/riscv/machines-qom.h" static void machine_none_init (MachineState *mch)
hw/nitro/machine.c +0 -1
@@ -31,7 +31,6 @@#include "system/system.h" #include "system/nitro-accel.h" #include "qemu/accel.h" -#include "hw/arm/machines-qom.h" #include "hw/core/eif.h" #include <zlib.h> /* for crc32 */
hw/remote/machine.c +0 -1
@@ -24,7 +24,6 @@#include "hw/core/qdev.h" #include "hw/remote/vfio-user-obj.h" #include "hw/pci/msi.h" -#include "hw/arm/machines-qom.h" static void remote_machine_init (MachineState *machine) {
include/hw/arm/machines-qom.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* -* QOM type definitions for ARM / Aarch64 machines -* -* Copyright (c) Linaro -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef HW_ARM_MACHINES_QOM_H -#define HW_ARM_MACHINES_QOM_H - -#include "hw/core/boards.h" - -#endif
target-info-qom.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/target-info-impl.h" #include "qemu/target-info-init.h" #include "qemu/target-info-qom.h" -#include "hw/arm/machines-qom.h" #include "hw/riscv/machines-qom.h" static const TypeInfo target_info_types[] = {
target/arm/machine.c +0 -1
@@ -11,7 +11,6 @@#include "migration/qemu-file-types.h" #include "migration/vmstate.h" #include "target/arm/gtimer.h" -#include "hw/arm/machines-qom.h" static bool vfp_needed (void *opaque) {
Signature · 1 line
2.43.0
Re: [PATCH 10/14] hw/arm: remove machines-qom.h
Quoted 77 lines · Pierrick Bouvier
Header is now empty so we can remove it.
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/arm/aspeed.c | 1 - hw/arm/aspeed_ast1040_evb.c | 1 - hw/arm/aspeed_ast10x0_evb.c | 1 - hw/arm/aspeed_ast2400_palmetto.c | 1 - hw/arm/aspeed_ast2400_quanta-q71l.c | 1 - hw/arm/aspeed_ast2400_supermicrox11.c | 1 - hw/arm/aspeed_ast2500_evb.c | 1 - hw/arm/aspeed_ast2500_g220a.c | 1 - hw/arm/aspeed_ast2500_romulus.c | 1 - hw/arm/aspeed_ast2500_supermicro-x11spi.c | 1 - hw/arm/aspeed_ast2500_tiogapass.c | 1 - hw/arm/aspeed_ast2500_witherspoon.c | 1 - hw/arm/aspeed_ast2500_yosemitev2.c | 1 - hw/arm/aspeed_ast2600_anacapa.c | 1 - hw/arm/aspeed_ast2600_bletchley.c | 1 - hw/arm/aspeed_ast2600_catalina.c | 1 - hw/arm/aspeed_ast2600_evb.c | 1 - hw/arm/aspeed_ast2600_fby35.c | 1 - hw/arm/aspeed_ast2600_fuji.c | 1 - hw/arm/aspeed_ast2600_gb200nvl.c | 1 - hw/arm/aspeed_ast2600_rainier.c | 1 - hw/arm/aspeed_ast27x0-fc.c | 1 - hw/arm/aspeed_ast27x0_evb.c | 1 - hw/arm/ax3000-boards.c | 1 - hw/arm/b-l475e-iot01a.c | 1 - hw/arm/bananapi_m2u.c | 1 - hw/arm/collie.c | 1 - hw/arm/cubieboard.c | 1 - hw/arm/digic_boards.c | 1 - hw/arm/exynos4_boards.c | 1 - hw/arm/imx25_pdk.c | 1 - hw/arm/imx8mm-evk.c | 1 - hw/arm/imx8mp-evk.c | 1 - hw/arm/integratorcp.c | 1 - hw/arm/kzm.c | 1 - hw/arm/max78000fthr.c | 1 - hw/arm/mcimx6ul-evk.c | 1 - hw/arm/mcimx7d-sabre.c | 1 - hw/arm/microbit.c | 1 - hw/arm/mps2-tz.c | 1 - hw/arm/mps2.c | 1 - hw/arm/mps3r.c | 1 - hw/arm/msf2-som.c | 1 - hw/arm/musca.c | 1 - hw/arm/musicpal.c | 1 - hw/arm/netduino2.c | 1 - hw/arm/netduinoplus2.c | 1 - hw/arm/npcm7xx_boards.c | 1 - hw/arm/npcm8xx_boards.c | 1 - hw/arm/olimex-stm32-h405.c | 1 - hw/arm/omap_sx1.c | 1 - hw/arm/orangepi.c | 1 - hw/arm/raspi.c | 1 - hw/arm/raspi4b.c | 1 - hw/arm/realview.c | 1 - hw/arm/sabrelite.c | 1 - hw/arm/sbsa-ref.c | 1 - hw/arm/stellaris.c | 1 - hw/arm/stm32vldiscovery.c | 1 - hw/arm/versatilepb.c | 1 - hw/arm/vexpress.c | 1 - hw/arm/virt.c | 1 - hw/arm/xen-pvh.c | 1 - hw/arm/xilinx_zynq.c | 1 - hw/arm/xlnx-versal-virt.c | 1 - hw/arm/xlnx-zcu102.c | 1 - hw/core/null-machine.c | 1 - hw/nitro/machine.c | 1 - hw/remote/machine.c | 1 - include/hw/arm/machines-qom.h | 14 -------------- target-info-qom.c | 1 - target/arm/machine.c | 1 - 72 files changed, 85 deletions(-)
Quoted 1 line
delete mode 100644
include/hw/arm/machines-qom.h
PATCH 11/14 hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE
In reply to Pierrick Bouvier--- hw/core/null-machine.c | 5 +---- hw/riscv/virt.c | 2 -- include/hw/riscv/machines-qom.h | 6 ------ target-info-qom.c | 13 ------------- target/riscv/machine.c | 4 ---- 5 files changed, 1 insertion(+), 29 deletions(-)
hw/core/null-machine.c +1 -4
@@ -56,7 +56,4 @@ static void machine_none_machine_init(MachineClass *mc) mc->no_cdrom =1 ; } -DEFINE_MACHINE_WITH_INTERFACES ("none" , machine_none_machine_init, - { TYPE_TARGET_RISCV32_MACHINE }, - { TYPE_TARGET_RISCV64_MACHINE }, - { }) +DEFINE_MACHINE ("none" , machine_none_machine_init)
hw/riscv/virt.c +0 -2
@@ -1811,8 +1811,6 @@ static const TypeInfo virt_machine_typeinfo = { .instance_size = sizeof(RISCVVirtState), .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, - {TYPE_TARGET_RISCV32_MACHINE }, - {TYPE_TARGET_RISCV64_MACHINE }, { } }, };
include/hw/riscv/machines-qom.h +0 -6
@@ -11,12 +11,6 @@#include "hw/core/boards.h" -#define TYPE_TARGET_RISCV32_MACHINE \ - "target-info-riscv32-machine" - -#define TYPE_TARGET_RISCV64_MACHINE \ - "target-info-riscv64-machine" -/* * Interfaces specifying whether a given QOM object is available in * qemu-system-riscv32, qemu-system-riscv64, or both.
target-info-qom.c +0 -13
@@ -14,19 +14,6 @@#include "qemu/target-info-qom.h" #include "hw/riscv/machines-qom.h" -static const TypeInfo target_info_types[] = { - { - .name =TYPE_TARGET_RISCV32_MACHINE , - .parent =TYPE_INTERFACE , - }, - { - .name =TYPE_TARGET_RISCV64_MACHINE , - .parent =TYPE_INTERFACE , - }, -}; - -DEFINE_TYPES (target_info_types) -static void target_info_qom_class_init (ObjectClass *oc,const void * data) {TargetInfoQomClass *klass =TARGET_INFO_CLASS (oc);
target/riscv/machine.c +0 -4
@@ -582,17 +582,13 @@ const VMStateDescription vmstate_riscv_cpu = { };const InterfaceInfo riscv32_machine_interfaces[] = { - {TYPE_TARGET_RISCV32_MACHINE }, { } };const InterfaceInfo riscv64_machine_interfaces[] = { - {TYPE_TARGET_RISCV64_MACHINE }, { } };const InterfaceInfo riscv32_64_machine_interfaces[] = { - {TYPE_TARGET_RISCV32_MACHINE }, - {TYPE_TARGET_RISCV64_MACHINE }, { } };
Signature · 1 line
2.43.0
Re: [PATCH 11/14] hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE
Quoted 8 lines · Pierrick Bouvier
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/core/null-machine.c | 5 +---- hw/riscv/virt.c | 2 -- include/hw/riscv/machines-qom.h | 6 ------ target-info-qom.c | 13 ------------- target/riscv/machine.c | 4 ---- 5 files changed, 1 insertion(+), 29 deletions(-)
PATCH 13/14 hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64}
In reply to Pierrick Bouvier--- hw/riscv/boston-aia.c | 2 +- hw/riscv/microblaze-v-generic.c | 2 +- include/hw/riscv/machines-qom.h | 17 ----------------- 3 files changed, 2 insertions(+), 19 deletions(-)
hw/riscv/boston-aia.c +1 -1
@@ -474,4 +474,4 @@ static void boston_mach_class_init(MachineClass *mc) mc->default_cpu_type =TYPE_RISCV_CPU_MIPS_P8700 ; } -DEFINE_MACHINE_RISCV64 ("boston-aia" , boston_mach_class_init) +DEFINE_MACHINE ("boston-aia" , boston_mach_class_init)
hw/riscv/microblaze-v-generic.c +1 -1
@@ -187,4 +187,4 @@ static void mb_v_generic_machine_init(MachineClass *mc) mc->default_cpus =1 ; } -DEFINE_MACHINE_RISCV32_64 ("amd-microblaze-v-generic" , mb_v_generic_machine_init) +DEFINE_MACHINE ("amd-microblaze-v-generic" , mb_v_generic_machine_init)
include/hw/riscv/machines-qom.h +0 -17
@@ -11,21 +11,4 @@#include "hw/core/boards.h" -/* -* Helper macros for defining machines available in qemu-system-riscv32, -* qemu-system-riscv64, or both. -*/ - -#define DEFINE_MACHINE_RISCV32 (namestr, machine_initfn) \ - DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - NULL) - -#define DEFINE_MACHINE_RISCV64 (namestr, machine_initfn) \ - DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - NULL) - -#define DEFINE_MACHINE_RISCV32_64 (namestr, machine_initfn) \ - DEFINE_MACHINE_WITH_INTERFACE_ARRAY(namestr, machine_initfn, \ - NULL) -#endif
Signature · 1 line
2.43.0
Re: [PATCH 13/14] hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64}
Quoted 6 lines · Pierrick Bouvier
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/riscv/boston-aia.c | 2 +- hw/riscv/microblaze-v-generic.c | 2 +- include/hw/riscv/machines-qom.h | 17 ----------------- 3 files changed, 2 insertions(+), 19 deletions(-)
PATCH 14/14 hw/riscv: remove machines-qom.h
In reply to Pierrick Bouvier--- hw/core/null-machine.c | 1 - hw/riscv/boston-aia.c | 1 - hw/riscv/k230.c | 1 - hw/riscv/microblaze-v-generic.c | 1 - hw/riscv/microchip_pfsoc.c | 1 - hw/riscv/opentitan.c | 1 - hw/riscv/shakti_c.c | 1 - hw/riscv/sifive_e.c | 1 - hw/riscv/sifive_u.c | 1 - hw/riscv/spike.c | 1 - hw/riscv/tt_atlantis.c | 1 - hw/riscv/virt.c | 1 - hw/riscv/xiangshan_kmh.c | 1 - include/hw/riscv/machines-qom.h | 14 -------------- target-info-qom.c | 1 - target/riscv/machine.c | 1 - 16 files changed, 29 deletions(-) delete mode 100644 include/hw/riscv/machines-qom.h
hw/core/null-machine.c +0 -1
@@ -16,7 +16,6 @@#include "hw/core/boards.h" #include "system/address-spaces.h" #include "hw/core/cpu.h" -#include "hw/riscv/machines-qom.h" static void machine_none_init (MachineState *mch) {
hw/riscv/boston-aia.c +0 -1
@@ -18,7 +18,6 @@#include "hw/ide/ahci-pci.h" #include "hw/core/loader.h" #include "hw/riscv/cps.h" -#include "hw/riscv/machines-qom.h" #include "hw/pci-host/xilinx-pcie.h" #include "hw/core/qdev-properties.h" #include "qapi/error.h"
hw/riscv/k230.c +0 -1
@@ -26,7 +26,6 @@#include "hw/core/sysbus.h" #include "hw/riscv/k230.h" #include "hw/riscv/boot.h" -#include "hw/riscv/machines-qom.h" #include "hw/intc/riscv_aclint.h" #include "hw/intc/sifive_plic.h" #include "hw/char/serial-mm.h"
hw/riscv/microblaze-v-generic.c +0 -1
@@ -25,7 +25,6 @@#include "system/address-spaces.h" #include "hw/char/xilinx_uartlite.h" #include "hw/misc/unimp.h" -#include "hw/riscv/machines-qom.h" #define LMB_BRAM_SIZE (128 * KiB)#define MEMORY_BASEADDR 0x80000000
hw/riscv/microchip_pfsoc.c +0 -1
@@ -49,7 +49,6 @@#include "hw/misc/unimp.h" #include "hw/riscv/boot.h" #include "hw/riscv/riscv_hart.h" -#include "hw/riscv/machines-qom.h" #include "hw/riscv/microchip_pfsoc.h" #include "hw/intc/riscv_aclint.h" #include "hw/intc/sifive_plic.h"
hw/riscv/opentitan.c +0 -1
@@ -26,7 +26,6 @@#include "hw/core/boards.h" #include "hw/misc/unimp.h" #include "hw/riscv/boot.h" -#include "hw/riscv/machines-qom.h" #include "qemu/units.h" #include "system/system.h" #include "system/address-spaces.h"
hw/riscv/shakti_c.c +0 -1
@@ -19,7 +19,6 @@#include "qemu/osdep.h" #include "hw/core/boards.h" #include "hw/riscv/shakti_c.h" -#include "hw/riscv/machines-qom.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/intc/sifive_plic.h"
hw/riscv/sifive_e.c +0 -1
@@ -40,7 +40,6 @@#include "hw/riscv/riscv_hart.h" #include "hw/riscv/sifive_e.h" #include "hw/riscv/boot.h" -#include "hw/riscv/machines-qom.h" #include "hw/char/sifive_uart.h" #include "hw/intc/riscv_aclint.h" #include "hw/intc/sifive_plic.h"
hw/riscv/sifive_u.c +0 -1
@@ -51,7 +51,6 @@#include "hw/riscv/riscv_hart.h" #include "hw/riscv/sifive_u.h" #include "hw/riscv/boot.h" -#include "hw/riscv/machines-qom.h" #include "hw/riscv/fdt-common.h" #include "hw/char/sifive_uart.h" #include "hw/intc/riscv_aclint.h"
hw/riscv/spike.c +0 -1
@@ -34,7 +34,6 @@#include "hw/riscv/boot.h" #include "hw/riscv/fdt-common.h" #include "hw/riscv/numa.h" -#include "hw/riscv/machines-qom.h" #include "hw/char/riscv_htif.h" #include "hw/intc/riscv_aclint.h" #include "chardev/char.h"
hw/riscv/tt_atlantis.c +0 -1
@@ -20,7 +20,6 @@#include "hw/riscv/boot.h" #include "hw/riscv/fdt-common.h" -#include "hw/riscv/machines-qom.h" #include "hw/riscv/riscv_hart.h" #include "hw/char/serial-mm.h"
hw/riscv/virt.c +0 -1
@@ -36,7 +36,6 @@#include "hw/riscv/virt.h" #include "hw/riscv/boot.h" #include "hw/riscv/fdt-common.h" -#include "hw/riscv/machines-qom.h" #include "hw/riscv/numa.h" #include "kvm/kvm_riscv.h" #include "hw/firmware/smbios.h"
hw/riscv/xiangshan_kmh.c +0 -1
@@ -41,7 +41,6 @@#include "hw/riscv/boot.h" #include "hw/riscv/xiangshan_kmh.h" #include "hw/riscv/riscv_hart.h" -#include "hw/riscv/machines-qom.h" #include "system/system.h" static const MemMapEntry xiangshan_kmh_memmap[] = {
include/hw/riscv/machines-qom.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* -* QOM type definitions for riscv32 / riscv64 machines -* -* Copyright (c) rev.ng Labs Srl. -* -* SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef HW_RISCV_MACHINES_QOM_H -#define HW_RISCV_MACHINES_QOM_H - -#include "hw/core/boards.h" - -#endif
target-info-qom.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/target-info-impl.h" #include "qemu/target-info-init.h" #include "qemu/target-info-qom.h" -#include "hw/riscv/machines-qom.h" static void target_info_qom_class_init (ObjectClass *oc,const void * data) {
target/riscv/machine.c +0 -1
@@ -24,7 +24,6 @@#include "migration/cpu.h" #include "exec/icount.h" #include "target/riscv/tcg/debug.h" -#include "hw/riscv/machines-qom.h" #ifdef CONFIG_KVM #include "kvm/kvm_riscv.h" #endif
Signature · 1 line
2.43.0
Re: [PATCH 14/14] hw/riscv: remove machines-qom.h
Quoted 19 lines · Pierrick Bouvier
Signed-off-by Pierrick Bouvier <[email protected]>--- hw/core/null-machine.c | 1 - hw/riscv/boston-aia.c | 1 - hw/riscv/k230.c | 1 - hw/riscv/microblaze-v-generic.c | 1 - hw/riscv/microchip_pfsoc.c | 1 - hw/riscv/opentitan.c | 1 - hw/riscv/shakti_c.c | 1 - hw/riscv/sifive_e.c | 1 - hw/riscv/sifive_u.c | 1 - hw/riscv/spike.c | 1 - hw/riscv/tt_atlantis.c | 1 - hw/riscv/virt.c | 1 - hw/riscv/xiangshan_kmh.c | 1 - include/hw/riscv/machines-qom.h | 14 -------------- target-info-qom.c | 1 - target/riscv/machine.c | 1 - 16 files changed, 29 deletions(-)
Quoted 1 line
delete mode 100644
include/hw/riscv/machines-qom.h
Quoted 11 lines · Pierrick Bouvier
This series cleans up the existing filtering interface we implemented previously. It's cumbersome and incomplete, and we can have a much simpler callback added in TypeInfo, to achieve the same result.
Pierrick Bouvier (14):
qom/object: addis_availablecallback to TypeInfo hw/arm: filter minimal set of machines
system: query machines usingTYPE_MACHINE
target-info: removemachine_typename
Quoted 8 lines
hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE hw/arm: remove {arm,arm_aarch64,aarch64}_machine_interfaces hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM}
hw/arm: removemachines-qom.h
hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE hw/riscv: remove {riscv32,riscv32_64,riscv64}_machine_interfaces hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64} hw/riscv: removemachines-qom.h
Series queued except #5 and #6, thanks!
Quoted 4 lines
Quoted 3 lines
Pierrick Bouvier (14):
qom/object: addis_availablecallback to TypeInfo
Patches for is_available callback to TypeInfo, it's can be merged latter
The reason is for the following command to execute:
we need add target_info_select and pass TargetInfo to is_available
- Move target_info() into qom/object.c. Default to SYS_EMU_TARGET_NONE until a real target is selected.
- Add target_info_select(); it may be called only once with a non-NULL TargetInfo that is not SYS_EMU_TARGET_NONE.
- Invoke TypeInfo.is_available after select, passing target_info().
- Change target_* helpers to take const TargetInfo *.
- Select the sole TargetInfo in user-mode MODULE_INIT_TARGET_INFO.
With these changes, when qemu-system does not select TargetInfo, we can still list all machines and devices for each target properly.
``` $ ./qemu-system.exe -machine ? Supported machines are: none: amd-microblaze-v-generic AMD Microblaze-V generic platform xlnx-versal-virt AMD Versal Virtual development board (alias of amd-versal-virt) amd-versal-virt AMD Versal Virtual development board amd-versal2-virt AMD Versal Gen 2 Virtual development board anacapa-bmc Facebook Anacapa BMC (Cortex-A7) ast1030-evb Aspeed AST1030 MiniBMC (Cortex-M4) ast1040-evb Aspeed AST1040 BIC EVB (Cortex-M4F) ast1060-evb Aspeed AST1060 Platform Root of Trust (Cortex-M4) ast2500-evb Aspeed AST2500 EVB (ARM1176) ast2600-evb Aspeed AST2600 EVB (Cortex-A7) axiado-scm3003 Axiado SCM3003 EVK Board b-l475e-iot01a B-L475E-IOT01A Discovery Kit (Cortex-M4) bletchley-bmc Facebook Bletchley BMC (Cortex-A7) boston-aia MIPS Boston-aia bpim2u Bananapi M2U (Cortex-A7) canon-a1100 Canon PowerShot A1100 IS (ARM946) catalina-bmc Facebook Catalina BMC (Cortex-A7) collie Sharp SL-5500 (Collie) PDA (SA-1110) cubieboard cubietech cubieboard (Cortex-A8) emcraft-sf2 SmartFusion2 SOM kit from Emcraft (M2S010) fby35-bmc Facebook fby35 BMC (Cortex-A7) fuji-bmc Facebook Fuji BMC (Cortex-A7) g220a-bmc Bytedance G220A BMC (ARM1176) gb200nvl-bmc Nvidia GB200NVL BMC (Cortex-A7) imx25-pdk ARM i.MX25 PDK board (ARM926) imx8mm-evk NXP i.MX 8MM EVK Board imx8mp-evk NXP i.MX 8M Plus EVK Board integratorcp ARM Integrator/CP (ARM926EJ-S) kudo-bmc Kudo BMC (Cortex-A9) kzm ARM KZM Emulation Baseboard (ARM1136) lm3s6965evb Stellaris LM3S6965EVB (Cortex-M3) lm3s811evb Stellaris LM3S811EVB (Cortex-M3) max78000fthr MAX78000FTHR Board (Cortex-M4 / (Unimplemented) RISC-V) mcimx6ul-evk Freescale i.MX6UL Evaluation Kit (Cortex-A7) mcimx7d-sabre Freescale i.MX7 DUAL SABRE (Cortex-A7) microbit BBC micro:bit (Cortex-M0) mori-bmc Mori BMC (Cortex-A9) mps2-an385 ARM MPS2 with AN385 FPGA image for Cortex-M3 mps2-an386 ARM MPS2 with AN386 FPGA image for Cortex-M4 mps2-an500 ARM MPS2 with AN500 FPGA image for Cortex-M7 mps2-an505 ARM MPS2 with AN505 FPGA image for Cortex-M33 mps2-an511 ARM MPS2 with AN511 DesignStart FPGA image for Cortex-M3 mps2-an521 ARM MPS2 with AN521 FPGA image for dual Cortex-M33 mps3-an524 ARM MPS3 with AN524 FPGA image for dual Cortex-M33 mps3-an536 ARM MPS3 with AN536 FPGA image for Cortex-R52 mps3-an547 ARM MPS3 with AN547 FPGA image for Cortex-M55 mps3-an555 ARM MPS3 with AN555 FPGA image for Cortex-M85 musca-a ARM Musca-A board (dual Cortex-M33) musca-b1 ARM Musca-B1 board (dual Cortex-M33) netduino2 Netduino 2 Machine (Cortex-M3) netduinoplus2 Netduino Plus 2 Machine (Cortex-M4) none empty machine npcm750-evb Nuvoton NPCM750 Evaluation Board (Cortex-A9) npcm845-evb Nuvoton NPCM845 Evaluation Board (Cortex-A35) nuri Samsung NURI board (Exynos4210) olimex-stm32-h405 Olimex STM32-H405 (Cortex-M4) orangepi-pc Orange Pi PC (Cortex-A7) palmetto-bmc OpenPOWER Palmetto BMC (ARM926EJ-S) quanta-gbs-bmc Quanta GBS (Cortex-A9) quanta-gsj Quanta GSJ (Cortex-A9) quanta-q71l-bmc Quanta-Q71l BMC (ARM926EJ-S) rainier-bmc IBM Rainier BMC (Cortex-A7) raspi0 Raspberry Pi Zero (revision 1.2) raspi1ap Raspberry Pi A+ (revision 1.1) raspi2b Raspberry Pi 2B (revision 1.1) realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 romulus-bmc OpenPOWER Romulus BMC (ARM1176) sabrelite Freescale i.MX6 Quad SABRE Lite Board (Cortex-A9) sbsa-ref QEMU 'SBSA Reference' ARM Virtual Machine smdkc210 Samsung SMDKC210 board (Exynos4210) stm32vldiscovery ST STM32VLDISCOVERY (Cortex-M3) supermicro-x11spi-bmc Supermicro X11 SPI BMC (ARM1176) supermicrox11-bmc Supermicro X11 BMC (ARM926EJ-S) sx1 Siemens SX1 (OMAP310) V2 sx1-v1 Siemens SX1 (OMAP310) V1 tiogapass-bmc Facebook Tiogapass BMC (ARM1176) versatileab ARM Versatile/AB (ARM926EJ-S) versatilepb ARM Versatile/PB (ARM926EJ-S) vexpress-a15 ARM Versatile Express for Cortex-A15 vexpress-a9 ARM Versatile Express for Cortex-A9 virt-10.0 QEMU 10.0 ARM Virtual Machine virt-10.1 QEMU 10.1 ARM Virtual Machine virt-10.2 QEMU 10.2 ARM Virtual Machine virt-11.0 QEMU 11.0 ARM Virtual Machine virt-11.1 QEMU 11.1 ARM Virtual Machine virt QEMU 11.2 ARM Virtual Machine (alias of virt-11.2) virt-11.2 QEMU 11.2 ARM Virtual Machine virt-6.0 QEMU 6.0 ARM Virtual Machine (deprecated) virt-6.1 QEMU 6.1 ARM Virtual Machine (deprecated) virt-6.2 QEMU 6.2 ARM Virtual Machine (deprecated) virt-7.0 QEMU 7.0 ARM Virtual Machine (deprecated) virt-7.1 QEMU 7.1 ARM Virtual Machine (deprecated) virt-7.2 QEMU 7.2 ARM Virtual Machine (deprecated) virt-8.0 QEMU 8.0 ARM Virtual Machine (deprecated) virt-8.1 QEMU 8.1 ARM Virtual Machine (deprecated) virt-8.2 QEMU 8.2 ARM Virtual Machine (deprecated) virt-9.0 QEMU 9.0 ARM Virtual Machine virt-9.1 QEMU 9.1 ARM Virtual Machine virt-9.2 QEMU 9.2 ARM Virtual Machine witherspoon-bmc OpenPOWER Witherspoon BMC (ARM1176) xilinx-zynq-a9 Xilinx Zynq 7000 Platform Baseboard for Cortex-A9 xlnx-zcu102 Xilinx ZynqMP ZCU102 board with 4xA53s and 2xR5Fs based on the value of smp yosemitev2-bmc Facebook YosemiteV2 BMC (ARM1176) aarch64: ast2700a1-evb Aspeed AST2700 A1 EVB (Cortex-A35) ast2700-evb Aspeed AST2700 A2 EVB (Cortex-A35) (alias of ast2700a2-evb) ast2700a2-evb Aspeed AST2700 A2 EVB (Cortex-A35) ast2700fc ast2700 full core support raspi3ap Raspberry Pi 3A+ (revision 1.0) raspi3b Raspberry Pi 3B (revision 1.2) raspi4b Raspberry Pi 4B (revision 1.5) riscv32: k230 RISC-V Board compatible with Kendryte K230 SDK microchip-icicle-kit Microchip PolarFire SoC Icicle Kit opentitan RISC-V Board compatible with OpenTitan shakti_c RISC-V Board compatible with Shakti SDK (deprecated) sifive_e RISC-V Board compatible with SiFive E SDK sifive_u RISC-V Board compatible with SiFive U SDK spike RISC-V Spike board tt-atlantis Tenstorrent Atlantis RISC-V SoC (Experimental) virt RISC-V VirtIO board xiangshan-kunminghu RISC-V Board compatible with the Xiangshan Kunminghu FPGA prototype platform riscv64: k230 RISC-V Board compatible with Kendryte K230 SDK microchip-icicle-kit Microchip PolarFire SoC Icicle Kit opentitan RISC-V Board compatible with OpenTitan shakti_c RISC-V Board compatible with Shakti SDK (deprecated) sifive_e RISC-V Board compatible with SiFive E SDK sifive_u RISC-V Board compatible with SiFive U SDK spike RISC-V Spike board tt-atlantis Tenstorrent Atlantis RISC-V SoC (Experimental) virt RISC-V VirtIO board xiangshan-kunminghu RISC-V Board compatible with the Xiangshan Kunminghu FPGA prototype platform ```
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
From 8afca178b69ebf38e0f0ed048a59883ac92308b3 Mon Sep 17 00:00:00 2001
From: Yonggang Luo <[email protected]>
Date: Thu, 3 Sep 2026 13:12:32 +0800
Subject: [PATCH 2/3] qom: add target_info_select and pass TargetInfo to
is_available
- Move target_info() into qom/object.c. Default to SYS_EMU_TARGET_NONE until a real target is selected.
- Add target_info_select(); it may be called only once with a non-NULL TargetInfo that is not SYS_EMU_TARGET_NONE.
- Invoke TypeInfo.is_available after select, passing target_info().
- Change target_* helpers to take const TargetInfo *.
- Select the sole TargetInfo in user-mode MODULE_INIT_TARGET_INFO.
--- bsd-user/main.c | 1 + hw/arm/aspeed_ast27x0.c | 4 +-- hw/arm/virt.c | 4 +-- hw/nitro/machine.c | 2 +- hw/pci/pci.c | 2 +- hw/scsi/scsi-disk.c | 2 +- hw/vfio/migration-multifd.c | 2 +- hw/virtio/vhost-user.c | 2 +- include/qemu/target-info-impl.h | 13 +++----- include/qemu/target-info-init.h | 18 ++++++----- include/qemu/target-info.h | 44 +++++++++++++++++---------- include/qom/object.h | 53 +++++++++++++++++++++++++++++++-- linux-user/main.c | 1 + qom/object.c | 36 +++++++++++++++++++++- target-info-qom.c | 9 +----- target-info.c | 32 ++++++++++---------- target/arm/cpu-max.c | 2 +- target/arm/tcg/cpu-max-v8.c | 2 +- 18 files changed, 157 insertions(+), 72 deletions(-)
bsd-user/main.c +1 -0
@@ -285,6 +285,7 @@ int main(int argc, char **argv)error_init (argv[0 ]);module_call_init (MODULE_INIT_TRACE );qemu_init_cpu_list (); +module_call_init (MODULE_INIT_TARGET_INFO );module_call_init (MODULE_INIT_QOM ); envlist =envlist_create ();
hw/arm/aspeed_ast27x0.c +2 -2
@@ -420,7 +420,7 @@ static void aspeed_soc_ast2700_init(Object *obj) }for (i =0 ; i < sc->num_cpus; i++) { -if (qtest_enabled () && !target_aarch64 ()) { +if (qtest_enabled () && !target_aarch64 (target_info ())) {/* * Introspection qtest just want to create this object * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
@@ -703,7 +703,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)qemu_irq irq;int uart; -if (qtest_enabled () && !target_aarch64 ()) { +if (qtest_enabled () && !target_aarch64 (target_info ())) {g_assert_not_reached (); }
hw/arm/virt.c +2 -2
@@ -4132,7 +4132,7 @@ static GPtrArray *virt_get_valid_cpu_types(const MachineState *ms)g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a15" )));g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("max-v8" ))); } -if (tcg_enabled () &&target_aarch64 ()) { +if (tcg_enabled () &&target_aarch64 (target_info ())) {g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a35" )));g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a55" )));g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a72" )));
@@ -4144,7 +4144,7 @@ static GPtrArray *virt_get_valid_cpu_types(const MachineState *ms)g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("neoverse-n2" )));g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("max-v9" ))); } -if (target_aarch64 ()) { +if (target_aarch64 (target_info ())) {g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a53" )));g_ptr_array_add (vct,g_strdup (ARM_CPU_TYPE_NAME ("cortex-a57" )));if (kvm_enabled () ||hvf_enabled () ||whpx_enabled ()) {
hw/nitro/machine.c +1 -1
@@ -97,7 +97,7 @@ static char *build_eif(const char *kernel_data, gsize kernel_size, hdr = (EifHeader ) { .magic =EIF_MAGIC , .version =cpu_to_be16 (4 ), - .flags =cpu_to_be16 (target_aarch64 () ?EIF_HDR_ARCH_ARM64 :0 ), + .flags =cpu_to_be16 (target_aarch64 (target_info ()) ?EIF_HDR_ARCH_ARM64 :0 ), };g_byte_array_append (buf, (const uint8_t *)&hdr,sizeof (hdr));
hw/pci/pci.c +1 -1
@@ -2888,7 +2888,7 @@ void pci_qdev_property_add_specifics(DeviceClass *dc)ObjectClass *oc =OBJECT_CLASS (dc);/* The loadparm property is only supported on s390x */ -if (target_s390x ()) { +if (target_s390x (target_info ())) {object_class_property_add_str (oc,"loadparm" , pci_qdev_property_get_loadparm, pci_qdev_property_set_loadparm);
hw/scsi/scsi-disk.c +1 -1
@@ -3190,7 +3190,7 @@ static void scsi_property_add_specifics(DeviceClass *dc)ObjectClass *oc =OBJECT_CLASS (dc);/* The loadparm property is only supported on s390x */ -if (target_s390x ()) { +if (target_s390x (target_info ())) {object_class_property_add_str (oc,"loadparm" , scsi_property_get_loadparm, scsi_property_set_loadparm);
hw/vfio/migration-multifd.c +1 -1
@@ -54,7 +54,7 @@ bool vfio_load_config_after_iter(VFIODevice *vbasedev)* See commit d329f5032e17 ("vfio: Move the saving of the config space to * the right place in VFIO migration"). */ -return target_base_arm (); +return target_base_arm (target_info ()); }/* type safety */
hw/virtio/vhost-user.c +1 -1
@@ -2631,7 +2631,7 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,return -EINVAL ; } -const uint64_t vhost_user_max_ram_slots =target_base_ppc () ? +const uint64_t vhost_user_max_ram_slots =target_base_ppc (target_info ()) ?SPAPR_MAX_RAM_SLOTS :VHOST_USER_MAX_RAM_SLOTS ; u->user->memory_slots =MIN (ram_slots, vhost_user_max_ram_slots); }
include/qemu/target-info-impl.h +4 -9
@@ -9,10 +9,12 @@ #ifndef QEMU_TARGET_INFO_IMPL_H #define QEMU_TARGET_INFO_IMPL_H +#include "qemu/target-info.h" +#include "qom/object.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-types-machine.h" -typedef struct TargetInfo { +struct TargetInfo { /* runtime equivalent of TARGET_NAME definition */ const char *target_name; /* related to TARGET_ARCH definition */
@@ -30,13 +32,6 @@ typedef struct TargetInfo {unsigned page_bits_init;/* runtime equivalent of TARGET_PAGE_BITS_VARY definition */ bool page_bits_vary; -} TargetInfo; - -/** -* target_info: -* -* Returns: The TargetInfo structure definition for this target binary. -*/ -const TargetInfo *target_info (void ); +};#endif
include/qemu/target-info-init.h +10 -8
@@ -12,6 +12,8 @@#ifndef QEMU_TARGET_INFO_INIT_H #define QEMU_TARGET_INFO_INIT_H +#include "qom/object.h" +#define DEFINE_TARGET_INFO_TYPE (info) \ static void do_qemu_init_target_info(void) \ { \
@@ -23,19 +25,19 @@ module_init(do_qemu_init_target_info, MODULE_INIT_TARGET_INFO)#ifdef CONFIG_USER_ONLY /* -* User mode does not support multiple targets in the same binary, so just -* define target_info(). +* User mode does not support multiple targets in the same binary. +* Install the sole TargetInfo before MODULE_INIT_QOM. */ -#define target_info_init (ti_var) \ -const TargetInfo *target_info(void) \ -{ \ - return &ti_var; \ -} +#define target_info_init (ti_var) \ +static void do_qemu_init_target_info(void) \ +{ \ + target_info_select(&ti_var); \ +} \ +module_init(do_qemu_init_target_info, MODULE_INIT_TARGET_INFO)#else /* CONFIG_USER_ONLY */ #include "qemu/target-info-qom.h" -#include "qom/object.h" #define target_info_init (ti_var) \ static const TypeInfo target_info_qom_target_type_info = { \
include/qemu/target-info.h +28 -16
92 lines not on this page · raw message
include/qom/object.h +50 -3
77 lines not on this page · raw message
linux-user/main.c +1 -0
@@ -700,6 +700,7 @@ int main(int argc, char **argv, char **envp)error_init (argv[0 ]);module_call_init (MODULE_INIT_TRACE );qemu_init_cpu_list (); +module_call_init (MODULE_INIT_TARGET_INFO );module_call_init (MODULE_INIT_QOM ); envlist =envlist_create ();
qom/object.c +35 -1
@@ -15,6 +15,8 @@#include "qom/compat-properties.h" #include "qom/object.h" #include "qom/object_interfaces.h" +#include "qemu/target-info-impl.h" +#include "qemu/target-info-qapi.h" #include "qemu/cutils.h" #include "qemu/memalign.h" #include "qapi/visitor.h"
@@ -61,6 +63,7 @@ struct TypeImplvoid (*class_base_init)(ObjectClass *klass,const void *data);const void *class_data; +TypeIsAvailable *is_available;void (*instance_init)(Object *obj);void (*instance_post_init)(Object *obj);
@@ -83,6 +86,30 @@ static GHashTable *type_table;static bool enumerating_types; +static const TargetInfo target_info_none = { + .target_arch =SYS_EMU_TARGET_NONE , + .target_name ="none" , +}; + +/* Use TypeInfo.is_available at registration once TargetInfo is selected. */ +static bool target_info_selected = false; +static const TargetInfo *target_info_ptr = &target_info_none; + +const TargetInfo *target_info (void ) +{ +return target_info_ptr; +} + +void target_info_select (const TargetInfo *ti) +{ +g_assert (!target_info_selected); +g_assert (ti !=NULL ); +g_assert (ti->target_arch !=SYS_EMU_TARGET_NONE ); + + target_info_selected = true; + target_info_ptr = ti; +} +static void type_table_add (TypeImpl *ti) {assert (!enumerating_types);
@@ -116,6 +143,7 @@ static TypeImpl *type_new(const TypeInfo *info) ti->class_init = info->class_init; ti->class_base_init = info->class_base_init; ti->class_data = info->class_data; + ti->is_available = info->is_available; ti->instance_init = info->instance_init; ti->instance_post_init = info->instance_post_init;
@@ -163,7 +191,8 @@ static TypeImpl *type_register_internal(const TypeInfo *info)abort (); } -if (info->is_available && !info->is_available ()) { +if (target_info_selected && + info->is_available && !info->is_available (target_info ())) {return NULL ; }
@@ -1149,6 +1178,11 @@ const char *object_class_get_name(ObjectClass *klass)return klass->type->name; } +TypeIsAvailable *object_class_get_is_available (ObjectClass *klass) +{ +return klass->type->is_available; +} +ObjectClass *object_class_by_name (const char *typename) {TypeImpl *type =type_get_by_name_noload (typename);
target-info-qom.c +1 -8
@@ -33,13 +33,6 @@ static const TypeInfo target_info_parent_type = {DEFINE_TARGET_INFO_TYPE (target_info_parent_type) -static const TargetInfo *target_info_ptr; - -const TargetInfo *target_info (void ) -{ -return target_info_ptr; -} - void target_info_qom_set_target(void) {g_autoptr (GSList) targets =object_class_get_list (TYPE_TARGET_INFO , false);
@@ -51,5 +44,5 @@ void target_info_qom_set_target(void) "more than one target-info is available"); } - target_info_ptr =TARGET_INFO_CLASS (targets->data)->target_info; +target_info_select (TARGET_INFO_CLASS (targets->data)->target_info); }
target-info.c +16 -16
@@ -42,9 +42,9 @@ bool target_big_endian(void)return target_endian_mode () ==ENDIAN_MODE_BIG ; } -bool target_base_arm (void ) +bool target_base_arm (const TargetInfo *ti) { -switch (target_arch ()) { +switch (ti->target_arch) {case SYS_EMU_TARGET_ARM :case SYS_EMU_TARGET_AARCH64 :return true;
@@ -53,19 +53,19 @@ bool target_base_arm(void) } } -bool target_arm (void ) +bool target_arm (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_ARM ; +return ti->target_arch ==SYS_EMU_TARGET_ARM ; } -bool target_aarch64 (void ) +bool target_aarch64 (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_AARCH64 ; +return ti->target_arch ==SYS_EMU_TARGET_AARCH64 ; } -bool target_base_ppc (void ) +bool target_base_ppc (const TargetInfo *ti) { -switch (target_arch ()) { +switch (ti->target_arch) {case SYS_EMU_TARGET_PPC :case SYS_EMU_TARGET_PPC64 :return true;
@@ -74,22 +74,22 @@ bool target_base_ppc(void) } } -bool target_ppc (void ) +bool target_ppc (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_PPC ; +return ti->target_arch ==SYS_EMU_TARGET_PPC ; } -bool target_ppc64 (void ) +bool target_ppc64 (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_PPC64 ; +return ti->target_arch ==SYS_EMU_TARGET_PPC64 ; } -bool target_s390x (void ) +bool target_s390x (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_S390X ; +return ti->target_arch ==SYS_EMU_TARGET_S390X ; } -bool target_riscv64 (void ) +bool target_riscv64 (const TargetInfo *ti) { -return target_arch () ==SYS_EMU_TARGET_RISCV64 ; +return ti->target_arch ==SYS_EMU_TARGET_RISCV64 ; }
target/arm/cpu-max.c +1 -1
@@ -94,7 +94,7 @@ void aarch64_aa32_a57_init(ARMCPU *cpu, bool aarch64_enabled)static void cpu_max_initfn (Object *obj) {ARMCPU *cpu =ARM_CPU (obj); -const bool aarch64_enabled =target_aarch64 (); +const bool aarch64_enabled =target_aarch64 (target_info ());if (hwaccel_enabled ()) {assert (aarch64_enabled);
target/arm/tcg/cpu-max-v8.c +1 -1
@@ -125,6 +125,6 @@ static void cpu_max_v8_register_type(void) { .name = "max-v8", .initfn = aarch32_max_v8_tcg_initfn }, { .name = "max-v8", .initfn = aarch64_max_v8_tcg_initfn }, }; -arm_cpu_register (&max_v8[target_aarch64 ()]); +arm_cpu_register (&max_v8[target_aarch64 (target_info ())]); }type_init (cpu_max_v8_register_type)
Signature · 1 line
2.52.0.windows.1
From 991e312d4cfcd86dd57db1375d43cd296f06679a Mon Sep 17 00:00:00 2001
From: Yonggang Luo <[email protected]>
Date: Thu, 3 Sep 2026 16:30:40 +0800
Subject: [PATCH 3/3] system/vl: group -M help by TargetInfo
- For qemu-system with no selected target, print the none TargetInfo first, then each registered TYPE_TARGET_INFO section.
- Machines with no TypeInfo.is_available stay in the none group. Machines with a callback appear only under targets it accepts.
- Single-target binaries (exe name or -target) list registered machines without a section header and without re-checking is_available, since QOM already filtered types at registration.
--- system/vl.c | 54 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 8 deletions(-)
system/vl.c +46 -8
70 lines not on this page · raw message
Signature · 1 line
2.52.0.windows.1
From 64d48b5ca69ca45c72040b072d54406adef16ca9 Mon Sep 17 00:00:00 2001
From: Yonggang Luo <[email protected]>
Date: Thu, 3 Sep 2026 12:40:07 +0800
Subject: [PATCH 1/3] qapi: add SysEmuTarget none
- Add SysEmuTarget member none as the first enumerator (C value 0) for when no TargetInfo is selected.
- Document that none is not a qemu-system- executable name.
--- qapi/machine.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
qapi/machine.json +10 -5
@@ -22,6 +22,10 @@ # The individual target constants are not documented here, for the # time being. # +# @none: no TargetInfo selected. Not a qemu-system- executable name. +# Always the first enumerator (C value 0). +# (since 11.2) +# # @rx: since 5.0 # # @avr: since 5.1
@@ -30,15 +34,16 @@ # # @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". +# .. note:: Except for ``none``, 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". # # Since: 3.0 ## { 'enum' : 'SysEmuTarget', - 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'hexagon', 'hppa', 'i386', - 'loongarch64', 'm68k', 'microblaze', 'mips', 'mips64', + 'data' : [ 'none', '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',
Signature · 1 line
2.52.0.windows.1
Quoted 9 lines · Yonggang Luo
Quoted 6 lines
Quoted 5 lines
Pierrick Bouvier (14):
qom/object: addis_availablecallback to TypeInfoPatches for
is_availablecallback to TypeInfo, it's can be merged latter
It's needed because files in patch 2 already depend on existing filtering mechanism to distinguish between arm and aarch64. We found other places where such filter could be used to specify target related types within a single C file, thus allowing to remove #ifdef TARGET_X easily.
Quoted 10 lines
The reason is for the following command to execute:
we need add
target_info_selectand pass TargetInfo tois_available- Move
target_info()intoqom/object.c. Default toSYS_EMU_TARGET_NONEuntil a real target is selected.
- Addtarget_info_select(); it may be called only once with a non-NULL TargetInfo that is notSYS_EMU_TARGET_NONE.
- Invoke TypeInfo.is_available after select, passingtarget_info().
- Change target_* helpers to take const TargetInfo *.
We can wait to have a need for this. As long as there is no heterogeneous support, it's safe to assume there is a single target active globally.
Quoted 163 lines
- Select the sole TargetInfo in user-mode
MODULE_INIT_TARGET_INFO.With these changes, when
qemu-systemdoes not select TargetInfo, we can still list all machines and devices for each target properly.``` $ ./qemu-system.exe -machine ? Supported machines are: none: amd-microblaze-v-generic AMD Microblaze-V generic platform xlnx-versal-virt AMD Versal Virtual development board (alias of amd- versal-virt) amd-versal-virt AMD Versal Virtual development board amd-versal2-virt AMD Versal Gen 2 Virtual development board anacapa-bmc Facebook Anacapa BMC (Cortex-A7) ast1030-evb Aspeed AST1030 MiniBMC (Cortex-M4) ast1040-evb Aspeed AST1040 BIC EVB (Cortex-M4F) ast1060-evb Aspeed AST1060 Platform Root of Trust (Cortex-M4) ast2500-evb Aspeed AST2500 EVB (ARM1176) ast2600-evb Aspeed AST2600 EVB (Cortex-A7) axiado-scm3003 Axiado SCM3003 EVK Board b-l475e-iot01a B-L475E-IOT01A Discovery Kit (Cortex-M4) bletchley-bmc Facebook Bletchley BMC (Cortex-A7) boston-aia MIPS Boston-aia bpim2u Bananapi M2U (Cortex-A7) canon-a1100 Canon PowerShot A1100 IS (ARM946) catalina-bmc Facebook Catalina BMC (Cortex-A7) collie Sharp SL-5500 (Collie) PDA (SA-1110) cubieboard cubietech cubieboard (Cortex-A8) emcraft-sf2 SmartFusion2 SOM kit from Emcraft (M2S010) fby35-bmc Facebook fby35 BMC (Cortex-A7) fuji-bmc Facebook Fuji BMC (Cortex-A7) g220a-bmc Bytedance G220A BMC (ARM1176) gb200nvl-bmc Nvidia GB200NVL BMC (Cortex-A7) imx25-pdk ARM i.MX25 PDK board (ARM926) imx8mm-evk NXP i.MX 8MM EVK Board imx8mp-evk NXP i.MX 8M Plus EVK Board integratorcp ARM Integrator/CP (ARM926EJ-S) kudo-bmc Kudo BMC (Cortex-A9) kzm ARM KZM Emulation Baseboard (ARM1136) lm3s6965evb Stellaris LM3S6965EVB (Cortex-M3) lm3s811evb Stellaris LM3S811EVB (Cortex-M3) max78000fthr MAX78000FTHR Board (Cortex-M4 / (Unimplemented) RISC-V) mcimx6ul-evk Freescale i.MX6UL Evaluation Kit (Cortex-A7) mcimx7d-sabre Freescale i.MX7 DUAL SABRE (Cortex-A7) microbit BBC micro:bit (Cortex-M0) mori-bmc Mori BMC (Cortex-A9) mps2-an385 ARM MPS2 with AN385 FPGA image for Cortex-M3 mps2-an386 ARM MPS2 with AN386 FPGA image for Cortex-M4 mps2-an500 ARM MPS2 with AN500 FPGA image for Cortex-M7 mps2-an505 ARM MPS2 with AN505 FPGA image for Cortex-M33 mps2-an511 ARM MPS2 with AN511 DesignStart FPGA image for Cortex-M3 mps2-an521 ARM MPS2 with AN521 FPGA image for dual Cortex-M33 mps3-an524 ARM MPS3 with AN524 FPGA image for dual Cortex-M33 mps3-an536 ARM MPS3 with AN536 FPGA image for Cortex-R52 mps3-an547 ARM MPS3 with AN547 FPGA image for Cortex-M55 mps3-an555 ARM MPS3 with AN555 FPGA image for Cortex-M85 musca-a ARM Musca-A board (dual Cortex-M33) musca-b1 ARM Musca-B1 board (dual Cortex-M33) netduino2 Netduino 2 Machine (Cortex-M3) netduinoplus2 Netduino Plus 2 Machine (Cortex-M4) none empty machine npcm750-evb Nuvoton NPCM750 Evaluation Board (Cortex-A9) npcm845-evb Nuvoton NPCM845 Evaluation Board (Cortex-A35) nuri Samsung NURI board (Exynos4210) olimex-stm32-h405 Olimex STM32-H405 (Cortex-M4) orangepi-pc Orange Pi PC (Cortex-A7) palmetto-bmc OpenPOWER Palmetto BMC (ARM926EJ-S) quanta-gbs-bmc Quanta GBS (Cortex-A9) quanta-gsj Quanta GSJ (Cortex-A9) quanta-q71l-bmc Quanta-Q71l BMC (ARM926EJ-S) rainier-bmc IBM Rainier BMC (Cortex-A7) raspi0 Raspberry Pi Zero (revision 1.2) raspi1ap Raspberry Pi A+ (revision 1.1) raspi2b Raspberry Pi 2B (revision 1.1) realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 romulus-bmc OpenPOWER Romulus BMC (ARM1176) sabrelite Freescale i.MX6 Quad SABRE Lite Board (Cortex-A9) sbsa-ref QEMU 'SBSA Reference' ARM Virtual Machine smdkc210 Samsung SMDKC210 board (Exynos4210) stm32vldiscovery ST STM32VLDISCOVERY (Cortex-M3) supermicro-x11spi-bmc Supermicro X11 SPI BMC (ARM1176) supermicrox11-bmc Supermicro X11 BMC (ARM926EJ-S) sx1 Siemens SX1 (OMAP310) V2 sx1-v1 Siemens SX1 (OMAP310) V1 tiogapass-bmc Facebook Tiogapass BMC (ARM1176) versatileab ARM Versatile/AB (ARM926EJ-S) versatilepb ARM Versatile/PB (ARM926EJ-S) vexpress-a15 ARM Versatile Express for Cortex-A15 vexpress-a9 ARM Versatile Express for Cortex-A9 virt-10.0 QEMU 10.0 ARM Virtual Machine virt-10.1 QEMU 10.1 ARM Virtual Machine virt-10.2 QEMU 10.2 ARM Virtual Machine virt-11.0 QEMU 11.0 ARM Virtual Machine virt-11.1 QEMU 11.1 ARM Virtual Machine virt QEMU 11.2 ARM Virtual Machine (alias of virt-11.2) virt-11.2 QEMU 11.2 ARM Virtual Machine virt-6.0 QEMU 6.0 ARM Virtual Machine (deprecated) virt-6.1 QEMU 6.1 ARM Virtual Machine (deprecated) virt-6.2 QEMU 6.2 ARM Virtual Machine (deprecated) virt-7.0 QEMU 7.0 ARM Virtual Machine (deprecated) virt-7.1 QEMU 7.1 ARM Virtual Machine (deprecated) virt-7.2 QEMU 7.2 ARM Virtual Machine (deprecated) virt-8.0 QEMU 8.0 ARM Virtual Machine (deprecated) virt-8.1 QEMU 8.1 ARM Virtual Machine (deprecated) virt-8.2 QEMU 8.2 ARM Virtual Machine (deprecated) virt-9.0 QEMU 9.0 ARM Virtual Machine virt-9.1 QEMU 9.1 ARM Virtual Machine virt-9.2 QEMU 9.2 ARM Virtual Machine witherspoon-bmc OpenPOWER Witherspoon BMC (ARM1176) xilinx-zynq-a9 Xilinx Zynq 7000 Platform Baseboard for Cortex-A9 xlnx-zcu102 Xilinx ZynqMP ZCU102 board with 4xA53s and 2xR5Fs based on the value of smp yosemitev2-bmc Facebook YosemiteV2 BMC (ARM1176) aarch64: ast2700a1-evb Aspeed AST2700 A1 EVB (Cortex-A35) ast2700-evb Aspeed AST2700 A2 EVB (Cortex-A35) (alias of ast2700a2-evb) ast2700a2-evb Aspeed AST2700 A2 EVB (Cortex-A35) ast2700fc ast2700 full core support raspi3ap Raspberry Pi 3A+ (revision 1.0) raspi3b Raspberry Pi 3B (revision 1.2) raspi4b Raspberry Pi 4B (revision 1.5) riscv32: k230 RISC-V Board compatible with Kendryte K230 SDK microchip-icicle-kit Microchip PolarFire SoC Icicle Kit opentitan RISC-V Board compatible with OpenTitan shakti_c RISC-V Board compatible with Shakti SDK (deprecated) sifive_e RISC-V Board compatible with SiFive E SDK sifive_u RISC-V Board compatible with SiFive U SDK spike RISC-V Spike board tt-atlantis Tenstorrent Atlantis RISC-V SoC (Experimental) virt RISC-V VirtIO board xiangshan-kunminghu RISC-V Board compatible with the Xiangshan Kunminghu FPGA prototype platform riscv64: k230 RISC-V Board compatible with Kendryte K230 SDK microchip-icicle-kit Microchip PolarFire SoC Icicle Kit opentitan RISC-V Board compatible with OpenTitan shakti_c RISC-V Board compatible with Shakti SDK (deprecated) sifive_e RISC-V Board compatible with SiFive E SDK sifive_u RISC-V Board compatible with SiFive U SDK spike RISC-V Spike board tt-atlantis Tenstorrent Atlantis RISC-V SoC (Experimental) virt RISC-V VirtIO board xiangshan-kunminghu RISC-V Board compatible with the Xiangshan Kunminghu FPGA prototype platform ```--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
Quoted 29 lines · Pierrick Bouvier
Quoted 9 lines · Yonggang Luo
Quoted 6 lines
Quoted 5 lines
Pierrick Bouvier (14):
qom/object: addis_availablecallback to TypeInfoPatches for
is_availablecallback to TypeInfo, it's can be merged latterIt's needed because files in patch 2 already depend on existing filtering mechanism to distinguish between arm and aarch64. We found other places where such filter could be used to specify target related types within a single C file, thus allowing to remove #ifdef
TARGET_Xeasily.Quoted 10 lines
The reason is for the following command to execute:
we need add
target_info_selectand pass TargetInfo tois_available- Move
target_info()intoqom/object.c. Default toSYS_EMU_TARGET_NONEuntil a real target is selected.
- Addtarget_info_select(); it may be called only once with a non-NULL TargetInfo that is notSYS_EMU_TARGET_NONE.
- Invoke TypeInfo.is_available after select, passingtarget_info().
- Change target_* helpers to take const TargetInfo *.
Quoted 3 lines
We can wait to have a need for this. As long as there is no heterogeneous support, it's safe to assume there is a single target active globally.
Because we would have more and more usage of target_* , that's why I would suggest merge it as early as possible. I means directly usage of these functions.
Not use is_avaible, for example:
hw/arm/aspeed_ast27x0.c +1 -1
@@ -420,7 +420,7 @@ static void aspeed_soc_ast2700_init(Object *obj) }for (i =0 ; i < sc->num_cpus; i++) { -if (qtest_enabled () && !target_aarch64 ()) { +if (qtest_enabled () && !target_aarch64 (target_info ())) {/* * Introspection qtest just want to create this object * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
@@ -703,7 +703,7 @@ static void aspeed_soc_ast2700_realize(DeviceState
*dev, Error **errp)
qemu_irq irq;
int uart;- if (qtest_enabled() && !target_aarch64()) {
+ if (qtest_enabled() && !target_aarch64(target_info())) {
g_assert_not_reached();
}hw/arm/virt.c +0 -0
@@ -4132,7 +4132,7 @@ static GPtrArray *virt_get_valid_cpu_types(const
MachineState *ms)
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a15")));
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v8")));
}
- if (tcg_enabled() && target_aarch64()) {
+ if (tcg_enabled() && target_aarch64(target_info())) {
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a35")));
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a55")));
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a72")));
@@ -4144,7 +4144,7 @@ static GPtrArray *virt_get_valid_cpu_types(const
MachineState *ms)
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-n2")));
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v9")));
}
- if (target_aarch64()) {
+ if (target_aarch64(target_info())) {
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a53")));
g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a57")));
if (kvm_enabled() || hvf_enabled() || whpx_enabled()) {hw/nitro/machine.c +0 -0
@@ -97,7 +97,7 @@ static char *build_eif(const char *kernel_data, gsize
kernel_size,
hdr = (EifHeader) {
.magic = EIF_MAGIC,
.version = cpu_to_be16(4),
- .flags = cpu_to_be16(target_aarch64() ? EIF_HDR_ARCH_ARM64 : 0),
+ .flags = cpu_to_be16(target_aarch64(target_info()) ?
EIF_HDR_ARCH_ARM64 : 0),
};
g_byte_array_append(buf, (const uint8_t *)&hdr, sizeof(hdr));hw/pci/pci.c +1 -1
@@ -2888,7 +2888,7 @@ void pci_qdev_property_add_specifics(DeviceClass *dc)ObjectClass *oc =OBJECT_CLASS (dc);/* The loadparm property is only supported on s390x */ -if (target_s390x ()) { +if (target_s390x (target_info ())) {object_class_property_add_str (oc,"loadparm" , pci_qdev_property_get_loadparm, pci_qdev_property_set_loadparm);
hw/scsi/scsi-disk.c +0 -0
@@ -3190,7 +3190,7 @@ static void scsi_property_add_specifics(DeviceClass
*dc)
ObjectClass *oc = OBJECT_CLASS(dc);
/* The loadparm property is only supported on s390x */
- if (target_s390x()) {
+ if (target_s390x(target_info())) {
object_class_property_add_str(oc, "loadparm",
scsi_property_get_loadparm,
scsi_property_set_loadparm);hw/vfio/migration-multifd.c +0 -0
@@ -54,7 +54,7 @@ bool vfio_load_config_after_iter(VFIODevice *vbasedev)* See commit d329f5032e17 ("vfio: Move the saving of the config space
to
* the right place in VFIO migration").
*/
- return target_base_arm();
+ return target_base_arm(target_info());
}
/* type safety */
hw/virtio/vhost-user.c +0 -0
@@ -2631,7 +2631,7 @@ static int vhost_user_backend_init(struct vhost_dev
*dev, void *opaque,
return -EINVAL;
}- const uint64_t vhost_user_max_ram_slots = target_base_ppc() ?
+ const uint64_t vhost_user_max_ram_slots =
target_base_ppc(target_info()) ?
SPAPR_MAX_RAM_SLOTS : VHOST_USER_MAX_RAM_SLOTS;
u->user->memory_slots = MIN(ram_slots,
vhost_user_max_ram_slots);
}(quoted diff) +0 -0
b/include/qemu/target-info-impl.h
index cf42aabbc8b..61404baa4b5 100644
--- a/include/qemu/target-info-impl.h
any way, we can wait the following pull to be merged first
[PULL 00/51] Misc HW/accel patches for 2026-09-03
https://patchew.org/QEMU/[email protected]/
and a better way to deal with it would be appreciated.
I also have patches for riscv needs this.
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
Quoted 169 lines · Yonggang Luo
Quoted 29 lines · On Fri, Sep 4, 2026 at 12:28 AM Pierrick Bouvier…
Quoted 9 lines · Yonggang Luo
Quoted 6 lines
Quoted 5 lines
Pierrick Bouvier (14):
qom/object: addis_availablecallback to TypeInfoPatches for
is_availablecallback to TypeInfo, it's can be merged latterIt's needed because files in patch 2 already depend on existing filtering mechanism to distinguish between arm and aarch64. We found other places where such filter could be used to specify target related types within a single C file, thus allowing to remove #ifdef
TARGET_Xeasily.Quoted 10 lines
The reason is for the following command to execute:
we need add
target_info_selectand pass TargetInfo tois_available- Move
target_info()intoqom/object.c. Default toSYS_EMU_TARGET_NONEuntil a real target is selected.
- Addtarget_info_select(); it may be called only once with a non-NULL TargetInfo that is notSYS_EMU_TARGET_NONE.
- Invoke TypeInfo.is_available after select, passingtarget_info().
- Change target_* helpers to take const TargetInfo *.Quoted 3 lines
We can wait to have a need for this. As long as there is no heterogeneous support, it's safe to assume there is a single target active globally.
Because we would have more and more usage of target_* , that's why I would suggest merge it as early as possible. I means directly usage of these functions.
Not useis_avaible, for example:hw/arm/aspeed_ast27x0.c +0
-0@@ -420,7 +420,7 @@ static void aspeed_soc_ast2700_init(Object *obj) }
for (i = 0; i <sc->num_cpus; i++) {
- if (qtest_enabled()&& !target_aarch64()) {
+ if (qtest_enabled()&& !target_aarch64(target_info())) { /*
* Introspection qtest just want to create this object
* without realizing it.ARM_CPU_TYPE_NAME("cortex-a35")hw/arm/aspeed_ast27x0.c +0
-0@@ -703,7 +703,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp) qemu_irq irq; int uart;
- if (qtest_enabled()&& !target_aarch64()) {
+ if (qtest_enabled()&& !target_aarch64(target_info())) {g_assert_not_reached();
}hw/arm/virt.c +1
-1@@ -4132,7 +4132,7 @@ static GPtrArray *virt_get_valid_cpu_types(const MachineState *ms) g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a15"))); g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v8"))); } - if (tcg_enabled() && target_aarch64()) { + if (tcg_enabled() && target_aarch64(target_info())) { g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a35"))); g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a55")));g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a72")));
hw/arm/virt.c +1
-1@@ -4144,7 +4144,7 @@ static GPtrArray *virt_get_valid_cpu_types(const MachineState *ms) g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-n2"))); g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v9"))); } - if (target_aarch64()) { + if (target_aarch64(target_info())) { g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a53"))); g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a57")));if (
kvm_enabled()||hvf_enabled()||whpx_enabled()) {hw/nitro/machine.c +1
-1@@ -97,7 +97,7 @@ static char *build_eif(const char *kernel_data, gsize kernel_size, hdr = (EifHeader) { .magic = EIF_MAGIC, .version = cpu_to_be16(4), - .flags = cpu_to_be16(target_aarch64() ? EIF_HDR_ARCH_ARM64 : 0), + .flags = cpu_to_be16(target_aarch64(target_info()) ?EIF_HDR_ARCH_ARM64 :0 ), };
g_byte_array_append(buf, (constuint8_t*)&hdr, sizeof(hdr));hw/pci/pci.c +0
-0@@ -2888,7 +2888,7 @@ void pci_qdev_property_add_specifics(DeviceClass *dc) ObjectClass *oc = OBJECT_CLASS(dc);
/* The loadparm property is only supported on s390x */
- if (target_s390x()) {
+ if (target_s390x(target_info())) {object_class_property_add_str(oc, "loadparm", pci_qdev_property_get_loadparm, pci_qdev_property_set_loadparm);hw/scsi/scsi-disk.c +0
-0@@ -3190,7 +3190,7 @@ static voidscsi_property_add_specifics (DeviceClass *dc) ObjectClass *oc = OBJECT_CLASS(dc);
/* The loadparm property is only supported on s390x */
- if (target_s390x()) {
+ if (target_s390x(target_info())) {object_class_property_add_str(oc, "loadparm", scsi_property_get_loadparm, scsi_property_set_loadparm);hw/vfio/migration-multifd.c +0
-0@@ -54,7 +54,7 @@ bool vfio_load_config_after_iter(VFIODevice *vbasedev) * See commit d329f5032e17 ("vfio: Move the saving of the configspace to
* the right place in VFIO migration").
*/
- returntarget_base_arm();
+ return target_base_arm(target_info());
}
/* type safety */hw/virtio/vhost-user.c +0
-0@@ -2631,7 +2631,7 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque, return -EINVAL; }
- constuint64_tvhost_user_max_ram_slots=target_base_ppc()?
+ constuint64_tvhost_user_max_ram_slots= target_base_ppc(target_info()) ?
SPAPR_MAX_RAM_SLOTS :VHOST_USER_MAX_RAM_SLOTS;u->user->memory_slots=MIN(ram_slots, vhost_user_max_ram_slots);
}include/qemu/target-info- renamed from include/qemu/target-info-impl.h +0
-0
impl.h
indexcf42aabbc8b..61404baa4b5100644
---a/include/qemu/target-info-impl.hany way, we can wait the following pull to be merged first
Quoted 9 lines
[PULL 00/51] Misc HW/accel patches for 2026-09-03
https://patchew.org/QEMU/[email protected]/
<https://patchew.org/QEMU/[email protected]/>and a better way to deal with it would be appreciated.
I also have patches for riscv needs this.
As I mentioned in our private discussion, we understood that some members of our community don't see the need to introduce the single-binary in its current form. We take note about this, and decided to not upstream it. As a consequence, it's not needed to filter *all* the types, like what previous series were trying to do.
It does not mean we stop working on this topic, simply that we'll keep this binary downstream until we have heterogeneous emulation ready.
That said, feel free to iterate and send a series on your own. I don't see any possibility of change in existing opinions, so be prepared to swim against the tide.
Also, I'll be off next week, so don't be surprised if you don't see any answer from me.
Quoted 9 lines
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
Regards,
Pierrick