diff mbox series

[RFC,PATCH-for-10.1,03/39] target/arm: Filter CPU types for binary

Message ID 20250403235821.9909-4-philmd@linaro.org (mailing list archive)
State New
Headers show
Series single-binary: Make hw/arm/ common | expand

Commit Message

Philippe Mathieu-Daudé April 3, 2025, 11:57 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/cpu.c   | 2 ++
 target/arm/cpu64.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Pierrick Bouvier April 4, 2025, 6:17 p.m. UTC | #1
On 4/3/25 16:57, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/cpu.c   | 2 ++
>   target/arm/cpu64.c | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 377791c84dd..b1aa482c726 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -50,6 +50,7 @@
>   #include "disas/capstone.h"
>   #include "fpu/softfloat.h"
>   #include "cpregs.h"
> +#include "qemu/target_info-qom.h"
>   #include "target/arm/cpu-qom.h"
>   #include "target/arm/gtimer.h"
>   
> @@ -2759,6 +2760,7 @@ void arm_cpu_register(const ARMCPUInfo *info)
>           .instance_init = arm_cpu_instance_init,
>           .class_init = info->class_init ?: cpu_register_class_init,
>           .class_data = (void *)info,
> +        .interfaces = LEGACY_BINARY_QEMU_SYSTEM_ARM_INTERFACE,
>       };
>   
>       type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index 8188ede5cc8..9f8c98563ac 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -24,6 +24,7 @@
>   #include "cpregs.h"
>   #include "qemu/module.h"
>   #include "qemu/units.h"
> +#include "qemu/target_info-qom.h"
>   #include "system/kvm.h"
>   #include "system/hvf.h"
>   #include "system/qtest.h"
> @@ -856,6 +857,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info)
>           .instance_init = aarch64_cpu_instance_init,
>           .class_init = info->class_init ?: cpu_register_class_init,
>           .class_data = (void *)info,
> +        .interfaces = LEGACY_BINARY_QEMU_SYSTEM_AARCH64_INTERFACE,
>       };
>   
>       type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);

I would stick to specific CPU interface type, instead of using any 
SYSTEM_AARCH64 type.

TYPE_TARGET_CPU_ARM, TYPE_TARGET_CPU_AARCH64.
And for machines:
TYPE_TARGET_MACHINE_ARM, TYPE_TARGET_MACHINE_AARCH64.
diff mbox series

Patch

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 377791c84dd..b1aa482c726 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -50,6 +50,7 @@ 
 #include "disas/capstone.h"
 #include "fpu/softfloat.h"
 #include "cpregs.h"
+#include "qemu/target_info-qom.h"
 #include "target/arm/cpu-qom.h"
 #include "target/arm/gtimer.h"
 
@@ -2759,6 +2760,7 @@  void arm_cpu_register(const ARMCPUInfo *info)
         .instance_init = arm_cpu_instance_init,
         .class_init = info->class_init ?: cpu_register_class_init,
         .class_data = (void *)info,
+        .interfaces = LEGACY_BINARY_QEMU_SYSTEM_ARM_INTERFACE,
     };
 
     type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 8188ede5cc8..9f8c98563ac 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -24,6 +24,7 @@ 
 #include "cpregs.h"
 #include "qemu/module.h"
 #include "qemu/units.h"
+#include "qemu/target_info-qom.h"
 #include "system/kvm.h"
 #include "system/hvf.h"
 #include "system/qtest.h"
@@ -856,6 +857,7 @@  void aarch64_cpu_register(const ARMCPUInfo *info)
         .instance_init = aarch64_cpu_instance_init,
         .class_init = info->class_init ?: cpu_register_class_init,
         .class_data = (void *)info,
+        .interfaces = LEGACY_BINARY_QEMU_SYSTEM_AARCH64_INTERFACE,
     };
 
     type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);