On 4/22/25 07:54, Philippe Mathieu-Daudé wrote:
> Replace the target-specific TARGET_AARCH64 definition
> by a call to the generic target_aarch64() helper.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> This removes the last TARGET_AARCH64 in hw/arm/.
> ---
> hw/arm/virt.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index d7197958f7c..4e11272a3ac 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -32,6 +32,7 @@
> #include "qemu/datadir.h"
> #include "qemu/units.h"
> #include "qemu/option.h"
> +#include "qemu/target-info.h"
> #include "monitor/qdev.h"
> #include "hw/sysbus.h"
> #include "hw/arm/boot.h"
> @@ -3137,7 +3138,8 @@ static GSList *virt_get_valid_cpu_types(const MachineState *ms)
> if (tcg_enabled()) {
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a7")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a15")));
> -#ifdef TARGET_AARCH64
> + }
> + if (tcg_enabled() && target_aarch64()) {
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a35")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a55")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a72")));
> @@ -3147,15 +3149,14 @@ static GSList *virt_get_valid_cpu_types(const MachineState *ms)
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-n1")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-v1")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-n2")));
> -#endif /* TARGET_AARCH64 */
> }
> -#ifdef TARGET_AARCH64
> + if (target_aarch64()) {
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a53")));
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a57")));
> if (kvm_enabled() || hvf_enabled()) {
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("host")));
> }
> -#endif /* TARGET_AARCH64 */
> + }
> vct = g_slist_prepend(vct, g_strdup(ARM_CPU_TYPE_NAME("max")));
>
> return vct;
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>