On 22/4/25 19:40, Richard Henderson wrote:
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.
I want to express that qemu-system-aarch64 is a superset of
qemu-system-arm machines.
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.
"common" was my first approach (not via extern but macro)
https://lore.kernel.org/qemu-devel/20250403235821.9909-5-phi...@linaro.org/
but Pierrick said on offlist review we want this array to
be verbose.
Pierrick, are you OK with external symbols?