On 4/22/25 07:54, Philippe Mathieu-Daudé wrote:
Since the qemu-system-aarch64 binary is able to run all machines indistinctly, simply register the TYPE_TARGET_AARCH64_MACHINE interface for all existing machines under the hw/arm/ directory.
"indistinctly" is the wrong word. I'm not quite sure what you're trying to say in order to suggest a replacement.
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 82f42582fa3..ce4d49a9f59 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -15,6 +15,7 @@ #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/arm/aspeed_eeprom.h" +#include "hw/arm/machines-qom.h" #include "hw/block/flash.h" #include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_eeprom.h" @@ -1760,91 +1761,199 @@ static const TypeInfo aspeed_machine_types[] = { .name = MACHINE_TYPE_NAME("palmetto-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_palmetto_class_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_TARGET_ARM_MACHINE }, + { TYPE_TARGET_AARCH64_MACHINE }, + { }, + }, }, { .name = MACHINE_TYPE_NAME("supermicrox11-bmc"), .parent = TYPE_ASPEED_MACHINE, .class_init = aspeed_machine_supermicrox11_bmc_class_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_TARGET_ARM_MACHINE }, + { TYPE_TARGET_AARCH64_MACHINE }, + { }, + },
Don't replicate these anonymous arrays. You want common extern InterfaceInfo arm_aarch64_machine_interfaces[]; extern InterfaceInfo aarch64_machine_interfaces[]; to be shared by all. As a cleanup, we really should make all of these const. r~