Skip to content

hw/core/cpu-common: Consolidate cpu_class_by_name()

Philippe Mathieu-Daudé qemu-arm qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4target/alpha: Tidy up alpha_cpu_class_by_name()target/alpha/cpu.c+2 -52 replies
2/4hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name()hw/core/cpu-common.c include/hw/core/cpu.h target/arm/cpu.c +11 more+26 -341 reply
3/4hw/cpu: Introduce CPUClass::cpu_resolving_type fieldhw/core/cpu-common.c include/hw/core/cpu.h target/alpha/cpu.c +20 more+24 -18 replies
4/4hw/cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()hw/core/cpu-common.c target/alpha/cpu.c target/arm/cpu.c +10 more+14 -352 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonGavin Shan
1/4R-b R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] hw/core/cpu-common: Consolidate cpu_class_by_name()

Gavin noticed the same pattern is duplicated in many CPUClass::class_by_name() handlers [*].
This series consolidate the calls to
- object_class_is_abstract()
- object_class_dynamic_cast()
in the common cpu_class_by_name(), by introducing the CPUClass::cpu_resolving_type field.

[*] https://lore.kernel.org/qemu-devel/[email protected]/

Philippe Mathieu-Daudé (4):
target/alpha: Tidy up alpha_cpu_class_by_name()
hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name() hw/cpu: Introduce CPUClass::cpu_resolving_type field hw/cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()

 include/hw/core/cpu.h   |  9 ++++++---
 hw/core/cpu-common.c    | 15 ++++++++++++---
 target/alpha/cpu.c      | 11 ++++-------
 target/arm/cpu.c        |  6 ++----
 target/avr/cpu.c        |  6 ++----
 target/cris/cpu.c       |  6 ++----
 target/hexagon/cpu.c    |  6 ++----
 target/hppa/cpu.c       |  1 +
 target/i386/cpu.c       |  1 +
 target/loongarch/cpu.c  |  7 ++-----
 target/m68k/cpu.c       |  6 ++----
 target/microblaze/cpu.c |  1 +
 target/mips/cpu.c       |  1 +
 target/nios2/cpu.c      |  1 +
 target/openrisc/cpu.c   |  6 ++----
 target/ppc/cpu_init.c   |  1 +
 target/riscv/cpu.c      |  6 ++----
 target/rx/cpu.c         |  7 ++-----
 target/s390x/cpu.c      |  1 +
 target/sh4/cpu.c        |  4 +---
 target/sparc/cpu.c      |  1 +
 target/tricore/cpu.c    |  6 ++----
 target/xtensa/cpu.c     |  6 ++----
 23 files changed, 53 insertions(+), 62 deletions(-)
Signature · 1 line
2.41.0