cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()
commitd5be19f514ece5e20baf560f466ee46766e7d5a3
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 8 Sep 2023 08:09:23 +0000 (8 10:09 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 5 Jan 2024 15:20:14 +0000 (5 16:20 +0100)
treeabe15eb7e9e0bb6716b586f83ffef48927e3a7b0
parentb0b8fa181472a7e745cb0c2c33b5c84dbb3b34ef
cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()

For all targets, the CPU class returned from CPUClass::class_by_name()
and object_class_dynamic_cast(oc, CPU_RESOLVING_TYPE) need to be
compatible. Lets apply the check in cpu_class_by_name() for once,
instead of having the check in CPUClass::class_by_name() for individual
target.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Message-ID: <20231114235628.534334-4-gshan@redhat.com>
13 files changed:
hw/core/cpu-common.c
target/alpha/cpu.c
target/arm/cpu.c
target/avr/cpu.c
target/cris/cpu.c
target/hexagon/cpu.c
target/hppa/cpu.c
target/loongarch/cpu.c
target/m68k/cpu.c
target/openrisc/cpu.c
target/riscv/cpu.c
target/tricore/cpu.c
target/xtensa/cpu.c