qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hw/core/cpu-common: Consolidate cpu_class_by_name()
@ 2023-09-08 11:22 Philippe Mathieu-Daudé
  2023-09-08 11:22 ` [PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name() Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-08 11:22 UTC (permalink / raw)
  To: qemu-devel, David Hildenbrand, Gavin Shan
  Cc: Chris Wulff, David Gibson, qemu-s390x, Weiwei Li, qemu-arm,
	Mark Cave-Ayland, Jiaxun Yang, Yoshinori Sato, Richard Henderson,
	Marcel Apfelbaum, Max Filippov, Nicholas Piggin, Eduardo Habkost,
	Ilya Leoshkevich, Bastian Koppelmann, Greg Kurz,
	Edgar E. Iglesias, qemu-ppc, Daniel Henrique Barboza, Marek Vasut,
	Palmer Dabbelt, Michael Rolnik, Laurent Vivier, Peter Maydell,
	Philippe Mathieu-Daudé, qemu-riscv, Aurelien Jarno, Bin Meng,
	Xiaojuan Yang, Daniel Henrique Barboza, Aleksandar Rikalo,
	Artyom Tarasenko, Song Gao, Stafford Horne, Yanan Wang,
	Alistair Francis, Brian Cain, Cédric Le Goater, Thomas Huth,
	Liu Zhiwei

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/ab07d81c-da98-a270-c3f6-0625912c6d0b@redhat.com/

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(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-10-11  6:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-08 11:22 [PATCH 0/4] hw/core/cpu-common: Consolidate cpu_class_by_name() Philippe Mathieu-Daudé
2023-09-08 11:22 ` [PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name() Philippe Mathieu-Daudé
2023-09-09 22:17   ` Richard Henderson
2023-09-10 23:29   ` Gavin Shan
2023-09-08 11:22 ` [PATCH 2/4] hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name() Philippe Mathieu-Daudé
2023-09-09 22:18   ` Richard Henderson
2023-09-08 11:22 ` [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field Philippe Mathieu-Daudé
2023-09-09 22:21   ` Richard Henderson
2023-09-10 23:28   ` Gavin Shan
2023-09-11  9:43     ` Philippe Mathieu-Daudé
2023-09-11 10:55       ` Igor Mammedov
2023-09-11 22:40       ` Gavin Shan
2023-09-25  0:24         ` Gavin Shan
2023-10-11  3:28           ` Philippe Mathieu-Daudé
2023-10-11  6:45             ` Gavin Shan
2023-09-08 11:22 ` [PATCH 4/4] hw/cpu: Call object_class_dynamic_cast() once in cpu_class_by_name() Philippe Mathieu-Daudé
2023-09-09 23:26   ` Richard Henderson
2023-09-10 23:40   ` Gavin Shan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).