[PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus

Philippe Mathieu-Daudé posted 7 patches 10 months, 2 weeks ago
[PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Philippe Mathieu-Daudé 10 months, 2 weeks ago
Register s390_cpu_list() as CPUClass:list_cpus callback
and remove the cpu_list definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/s390x/cpu.h | 3 ---
 target/s390x/cpu.c | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 8dd1936e3e2..1012be35d25 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -900,9 +900,6 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
 }
 
 
-#define cpu_list s390_cpu_list
-
-
 /* helper.c */
 #define CPU_RESOLVING_TYPE TYPE_S390_CPU
 
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 1f75629ddc2..ac05e82f0ac 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -378,6 +378,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
                                        &scc->parent_phases);
 
     cc->class_by_name = s390_cpu_class_by_name;
+    cc->list_cpus = s390_cpu_list;
     cc->mmu_index = s390x_cpu_mmu_index;
     cc->dump_state = s390_cpu_dump_state;
     cc->query_cpu_fast = s390_query_cpu_fast;
-- 
2.47.1


Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Eric Farman 10 months, 2 weeks ago
On Mon, 2025-03-24 at 19:58 +0100, Philippe Mathieu-Daudé wrote:
> Register s390_cpu_list() as CPUClass:list_cpus callback
> and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/s390x/cpu.h | 3 ---
>  target/s390x/cpu.c | 1 +
>  2 files changed, 1 insertion(+), 3 deletions(-)

Fine squashed with patch 5 or not...

Reviewed-by: Eric Farman <farman@linux.ibm.com>
Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Zhao Liu 10 months, 2 weeks ago
On Mon, Mar 24, 2025 at 07:58:36PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:36 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
> X-Mailer: git-send-email 2.47.1
> 
> Register s390_cpu_list() as CPUClass:list_cpus callback
> and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/s390x/cpu.h | 3 ---
>  target/s390x/cpu.c | 1 +
>  2 files changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Richard Henderson 10 months, 2 weeks ago
On 3/24/25 11:58, Philippe Mathieu-Daudé wrote:
> Register s390_cpu_list() as CPUClass:list_cpus callback
> and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/cpu.h | 3 ---
>   target/s390x/cpu.c | 1 +
>   2 files changed, 1 insertion(+), 3 deletions(-)

I really think this has to be merged with the previous.
I strongly suspect that it either doesn't compile separately,
or doesn't function as desired.


r~

Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Philippe Mathieu-Daudé 10 months, 2 weeks ago
On 24/3/25 20:02, Richard Henderson wrote:
> On 3/24/25 11:58, Philippe Mathieu-Daudé wrote:
>> Register s390_cpu_list() as CPUClass:list_cpus callback
>> and remove the cpu_list definition.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   target/s390x/cpu.h | 3 ---
>>   target/s390x/cpu.c | 1 +
>>   2 files changed, 1 insertion(+), 3 deletions(-)
> 
> I really think this has to be merged with the previous.
> I strongly suspect that it either doesn't compile separately,
> or doesn't function as desired.

It does compile, because "cpu.h" includes "cpu_models.h".

I don't mind squashing if Thomas is OK.

Thanks,

Phil.


Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
Posted by Thomas Huth 10 months, 2 weeks ago
On 24/03/2025 20.04, Philippe Mathieu-Daudé wrote:
> On 24/3/25 20:02, Richard Henderson wrote:
>> On 3/24/25 11:58, Philippe Mathieu-Daudé wrote:
>>> Register s390_cpu_list() as CPUClass:list_cpus callback
>>> and remove the cpu_list definition.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>>   target/s390x/cpu.h | 3 ---
>>>   target/s390x/cpu.c | 1 +
>>>   2 files changed, 1 insertion(+), 3 deletions(-)
>>
>> I really think this has to be merged with the previous.
>> I strongly suspect that it either doesn't compile separately,
>> or doesn't function as desired.
> 
> It does compile, because "cpu.h" includes "cpu_models.h".
> 
> I don't mind squashing if Thomas is OK.

I don't mind either way!

Reviewed-by: Thomas Huth <thuth@redhat.com>