[PATCH-for-10.1 0/6] cpus: Convert cpu_list definition to CPUClass:list_cpus callback

Philippe Mathieu-Daudé posted 6 patches 6 days, 7 hours ago
There is a newer version of this series
include/hw/core/cpu.h |  2 ++
target/i386/cpu.h     |  3 ---
target/ppc/cpu.h      |  4 ----
target/s390x/cpu.h    |  1 -
target/sparc/cpu.h    |  3 ---
cpu-target.c          | 25 ++++++++++++-------------
target/i386/cpu.c     |  3 ++-
target/ppc/cpu_init.c |  3 ++-
target/s390x/cpu.c    |  1 +
target/sparc/cpu.c    |  3 ++-
10 files changed, 21 insertions(+), 27 deletions(-)
[PATCH-for-10.1 0/6] cpus: Convert cpu_list definition to CPUClass:list_cpus callback
Posted by Philippe Mathieu-Daudé 6 days, 7 hours ago
'cpu_list' might be defined per target, and force code to be
built per-target. We can avoid that by introducing a CPUClass
callback.

This series combined with another which converts CPU_RESOLVING_TYPE
to a runtime helper, allows to move most of cpu-target to common.

Philippe Mathieu-Daudé (6):
  cpus: Introduce CPUClass::list_cpus() callback
  target/i386: Register CPUClass:list_cpus
  target/ppc: Register CPUClass:list_cpus
  target/sparc: Register CPUClass:list_cpus
  target/sparc: Register CPUClass:list_cpus
  cpus: Remove #ifdef check on cpu_list definition

 include/hw/core/cpu.h |  2 ++
 target/i386/cpu.h     |  3 ---
 target/ppc/cpu.h      |  4 ----
 target/s390x/cpu.h    |  1 -
 target/sparc/cpu.h    |  3 ---
 cpu-target.c          | 25 ++++++++++++-------------
 target/i386/cpu.c     |  3 ++-
 target/ppc/cpu_init.c |  3 ++-
 target/s390x/cpu.c    |  1 +
 target/sparc/cpu.c    |  3 ++-
 10 files changed, 21 insertions(+), 27 deletions(-)

-- 
2.47.1


Re: [PATCH-for-10.1 0/6] cpus: Convert cpu_list definition to CPUClass:list_cpus callback
Posted by Richard Henderson 5 days, 11 hours ago
On 3/23/25 15:40, Philippe Mathieu-Daudé wrote:
> 'cpu_list' might be defined per target, and force code to be
> built per-target. We can avoid that by introducing a CPUClass
> callback.
> 
> This series combined with another which converts CPU_RESOLVING_TYPE
> to a runtime helper, allows to move most of cpu-target to common.
> 
> Philippe Mathieu-Daudé (6):
>    cpus: Introduce CPUClass::list_cpus() callback
>    target/i386: Register CPUClass:list_cpus
>    target/ppc: Register CPUClass:list_cpus
>    target/sparc: Register CPUClass:list_cpus
>    target/sparc: Register CPUClass:list_cpus
>    cpus: Remove #ifdef check on cpu_list definition

Modulo the s390x niggles Thomas pointed out,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~