All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback
@ 2025-03-24 18:58 Philippe Mathieu-Daudé
  2025-03-24 18:58 ` [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Since v2
- Added R-b tags
- Added missing s390x hunk

Since v1 (Thomas review comments)
- Move s390_set_qemu_cpu_model/s390_cpu_list to "cpu_models.h"
- Correct 'target/s390x: Register CPUClass:list_cpus' subject

'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.

Based-on: <20250324165356.39540-1-philmd@linaro.org>

Philippe Mathieu-Daudé (7):
  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/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h
  target/s390x: 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         |  7 -------
 target/s390x/cpu_models.h  |  3 +++
 target/sparc/cpu.h         |  3 ---
 cpu-target.c               | 25 ++++++++++++-------------
 hw/s390x/s390-virtio-ccw.c |  2 +-
 target/i386/cpu.c          |  3 ++-
 target/ppc/cpu_init.c      |  3 ++-
 target/s390x/cpu.c         |  1 +
 target/sparc/cpu.c         |  3 ++-
 12 files changed, 25 insertions(+), 34 deletions(-)

-- 
2.47.1



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

* [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-26  7:43   ` Zhao Liu
  2025-03-24 18:58 ` [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Some targets define cpu_list to a method listing their
CPUs on stdout. In order to make list_cpus() generic,
introduce the CPUClass::list_cpus() callback.
When no callback is registered, list_cpus() defaults
to the cpu_list definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/hw/core/cpu.h | 2 ++
 cpu-target.c          | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5d11d26556a..ccfcd3eb3a6 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -102,6 +102,7 @@ struct SysemuCPUOps;
  * CPUClass:
  * @class_by_name: Callback to map -cpu command line model name to an
  *                 instantiatable CPU type.
+ * @list_cpus: list available CPU models and flags.
  * @parse_features: Callback to parse command line arguments.
  * @reset_dump_flags: #CPUDumpFlags to use for reset logging.
  * @mmu_index: Callback for choosing softmmu mmu index;
@@ -150,6 +151,7 @@ struct CPUClass {
     /*< public >*/
 
     ObjectClass *(*class_by_name)(const char *cpu_model);
+    void (*list_cpus)(void);
     void (*parse_features)(const char *typename, char *str, Error **errp);
 
     int (*mmu_index)(CPUState *cpu, bool ifetch);
diff --git a/cpu-target.c b/cpu-target.c
index cae77374b38..5947ca31a0a 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -98,7 +98,13 @@ static void cpu_list(void)
 
 void list_cpus(void)
 {
-    cpu_list();
+    CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
+
+    if (cc->list_cpus) {
+        cc->list_cpus();
+    } else {
+        cpu_list();
+    }
 }
 
 /* enable or disable single step mode. EXCP_DEBUG is returned by the
-- 
2.47.1



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

* [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
  2025-03-24 18:58 ` [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-26  7:45   ` Zhao Liu
  2025-03-24 18:58 ` [PATCH v3 3/7] target/ppc: " Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Register x86_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/i386/cpu.h | 3 ---
 target/i386/cpu.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 76f24446a55..28011eff0a8 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2367,7 +2367,6 @@ int x86_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
 int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 void x86_cpu_gdb_init(CPUState *cs);
 
-void x86_cpu_list(void);
 int cpu_x86_support_mca_broadcast(CPUX86State *env);
 
 #ifndef CONFIG_USER_ONLY
@@ -2561,8 +2560,6 @@ uint64_t cpu_get_tsc(CPUX86State *env);
 #define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu32")
 #endif
 
-#define cpu_list x86_cpu_list
-
 /* MMU modes definitions */
 #define MMU_KSMAP64_IDX    0
 #define MMU_KSMAP32_IDX    1
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1b64ceaaba4..1f502587c96 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6305,7 +6305,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
 }
 
 /* list available CPU models and flags */
-void x86_cpu_list(void)
+static void x86_cpu_list(void)
 {
     int i, j;
     GSList *list;
@@ -8924,6 +8924,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP;
 
     cc->class_by_name = x86_cpu_class_by_name;
+    cc->list_cpus = x86_cpu_list;
     cc->parse_features = x86_cpu_parse_featurestr;
     cc->mmu_index = x86_cpu_mmu_index;
     cc->dump_state = x86_cpu_dump_state;
-- 
2.47.1



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

* [PATCH v3 3/7] target/ppc: Register CPUClass:list_cpus
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
  2025-03-24 18:58 ` [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
  2025-03-24 18:58 ` [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-26  8:17   ` Zhao Liu
  2025-03-24 18:58 ` [PATCH v3 4/7] target/sparc: " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Register ppc_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/ppc/cpu.h      | 4 ----
 target/ppc/cpu_init.c | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index efab54a0683..0062579ef3e 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1597,8 +1597,6 @@ void ppc_store_dawrx1(CPUPPCState *env, uint32_t value);
 #endif /* !defined(CONFIG_USER_ONLY) */
 void ppc_store_msr(CPUPPCState *env, target_ulong value);
 
-void ppc_cpu_list(void);
-
 /* Time-base and decrementer management */
 uint64_t cpu_ppc_load_tbl(CPUPPCState *env);
 uint32_t cpu_ppc_load_tbu(CPUPPCState *env);
@@ -1660,8 +1658,6 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn)
 int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp);
 int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val);
 
-#define cpu_list ppc_cpu_list
-
 /* MMU modes definitions */
 #define MMU_USER_IDX 0
 static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch)
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 8b590e7f17c..0ccb9068c89 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7184,7 +7184,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
     g_free(name);
 }
 
-void ppc_cpu_list(void)
+static void ppc_cpu_list(void)
 {
     GSList *list;
 
@@ -7525,6 +7525,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
                                        &pcc->parent_phases);
 
     cc->class_by_name = ppc_cpu_class_by_name;
+    cc->list_cpus = ppc_cpu_list;
     cc->mmu_index = ppc_cpu_mmu_index;
     cc->dump_state = ppc_cpu_dump_state;
     cc->set_pc = ppc_cpu_set_pc;
-- 
2.47.1



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

* [PATCH v3 4/7] target/sparc: Register CPUClass:list_cpus
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-03-24 18:58 ` [PATCH v3 3/7] target/ppc: " Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-26  8:19   ` Zhao Liu
  2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Register sparc_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/sparc/cpu.h | 3 ---
 target/sparc/cpu.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 462bcb6c0e6..7c6296ae70e 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -594,7 +594,6 @@ G_NORETURN void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t);
 
 /* cpu_init.c */
 void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu);
-void sparc_cpu_list(void);
 /* mmu_helper.c */
 bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                         MMUAccessType access_type, int mmu_idx,
@@ -665,8 +664,6 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
 
 #define CPU_RESOLVING_TYPE TYPE_SPARC_CPU
 
-#define cpu_list sparc_cpu_list
-
 /* MMU modes definitions */
 #if defined (TARGET_SPARC64)
 #define MMU_USER_IDX   0
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 57161201173..635d5d81143 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -579,7 +579,7 @@ static void print_features(uint32_t features, const char *prefix)
     }
 }
 
-void sparc_cpu_list(void)
+static void sparc_cpu_list(void)
 {
     unsigned int i;
 
@@ -1031,6 +1031,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data)
                                        &scc->parent_phases);
 
     cc->class_by_name = sparc_cpu_class_by_name;
+    cc->list_cpus = sparc_cpu_list,
     cc->parse_features = sparc_cpu_parse_features;
     cc->mmu_index = sparc_cpu_mmu_index;
     cc->dump_state = sparc_cpu_dump_state;
-- 
2.47.1



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

* [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2025-03-24 18:58 ` [PATCH v3 4/7] target/sparc: " Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-25  5:30   ` Thomas Huth
                     ` (2 more replies)
  2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  7 siblings, 3 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Both s390_cpu_list() and s390_set_qemu_cpu_model() are
defined in cpu_models.c, move their declarations in the
related "cpu_models.h" header. Use full path to header
in s390-virtio-ccw.c file.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/s390x/cpu.h         | 4 ----
 target/s390x/cpu_models.h  | 3 +++
 hw/s390x/s390-virtio-ccw.c | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 5b7992deda6..8dd1936e3e2 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -900,11 +900,7 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
 }
 
 
-/* cpu_models.c */
-void s390_cpu_list(void);
 #define cpu_list s390_cpu_list
-void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
-                             const S390FeatInit feat_init);
 
 
 /* helper.c */
diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
index 71d4bc2dd4a..f701bc0b532 100644
--- a/target/s390x/cpu_models.h
+++ b/target/s390x/cpu_models.h
@@ -113,6 +113,9 @@ static inline uint64_t s390_cpuid_from_cpu_model(const S390CPUModel *model)
 }
 S390CPUDef const *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,
                                     S390FeatBitmap features);
+void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
+                             const S390FeatInit feat_init);
+void s390_cpu_list(void);
 
 bool kvm_s390_cpu_models_supported(void);
 bool kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp);
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 75b32182eb0..4f11c75b625 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -35,7 +35,7 @@
 #include "hw/s390x/css-bridge.h"
 #include "hw/s390x/ap-bridge.h"
 #include "migration/register.h"
-#include "cpu_models.h"
+#include "target/s390x/cpu_models.h"
 #include "hw/nmi.h"
 #include "hw/qdev-properties.h"
 #include "hw/s390x/tod.h"
-- 
2.47.1



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

* [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-24 19:02   ` Richard Henderson
                     ` (2 more replies)
  2025-03-24 18:58 ` [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
  2025-04-17 16:16 ` [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
  7 siblings, 3 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

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



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

* [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
@ 2025-03-24 18:58 ` Philippe Mathieu-Daudé
  2025-03-26  8:34   ` Zhao Liu
  2025-04-17 16:16 ` [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
  7 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 18:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Marcel Apfelbaum

Since we removed all definitions of cpu_list, the #ifdef
check is always true. Remove it, inlining cpu_list().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 cpu-target.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/cpu-target.c b/cpu-target.c
index 5947ca31a0a..30598619581 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -71,7 +71,6 @@ const char *parse_cpu_option(const char *cpu_option)
     return cpu_type;
 }
 
-#ifndef cpu_list
 static void cpu_list_entry(gpointer data, gpointer user_data)
 {
     CPUClass *cc = CPU_CLASS(OBJECT_CLASS(data));
@@ -85,17 +84,6 @@ static void cpu_list_entry(gpointer data, gpointer user_data)
     }
 }
 
-static void cpu_list(void)
-{
-    GSList *list;
-
-    list = object_class_get_list_sorted(TYPE_CPU, false);
-    qemu_printf("Available CPUs:\n");
-    g_slist_foreach(list, cpu_list_entry, NULL);
-    g_slist_free(list);
-}
-#endif
-
 void list_cpus(void)
 {
     CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
@@ -103,7 +91,12 @@ void list_cpus(void)
     if (cc->list_cpus) {
         cc->list_cpus();
     } else {
-        cpu_list();
+        GSList *list;
+
+        list = object_class_get_list_sorted(TYPE_CPU, false);
+        qemu_printf("Available CPUs:\n");
+        g_slist_foreach(list, cpu_list_entry, NULL);
+        g_slist_free(list);
     }
 }
 
-- 
2.47.1



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

* Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
@ 2025-03-24 19:02   ` Richard Henderson
  2025-03-24 19:04     ` Philippe Mathieu-Daudé
  2025-03-26  8:40   ` Zhao Liu
  2025-03-26 13:20   ` Eric Farman
  2 siblings, 1 reply; 22+ messages in thread
From: Richard Henderson @ 2025-03-24 19:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

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~


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

* Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 19:02   ` Richard Henderson
@ 2025-03-24 19:04     ` Philippe Mathieu-Daudé
  2025-03-25  5:29       ` Thomas Huth
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-24 19:04 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

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.



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

* Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 19:04     ` Philippe Mathieu-Daudé
@ 2025-03-25  5:29       ` Thomas Huth
  0 siblings, 0 replies; 22+ messages in thread
From: Thomas Huth @ 2025-03-25  5:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Richard Henderson, qemu-devel
  Cc: qemu-s390x, Daniel Henrique Barboza, David Hildenbrand,
	Christian Borntraeger, Artyom Tarasenko, Eric Farman,
	Paolo Bonzini, Halil Pasic, Zhao Liu, Eduardo Habkost, Yanan Wang,
	qemu-ppc, Nicholas Piggin, Ilya Leoshkevich, Mark Cave-Ayland,
	Marcel Apfelbaum

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>



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

* Re: [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h
  2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
@ 2025-03-25  5:30   ` Thomas Huth
  2025-03-26  8:40   ` Zhao Liu
  2025-03-26 13:20   ` Eric Farman
  2 siblings, 0 replies; 22+ messages in thread
From: Thomas Huth @ 2025-03-25  5:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-s390x, Daniel Henrique Barboza, David Hildenbrand,
	Christian Borntraeger, Artyom Tarasenko, Eric Farman,
	Paolo Bonzini, Halil Pasic, Zhao Liu, Eduardo Habkost, Yanan Wang,
	Richard Henderson, qemu-ppc, Nicholas Piggin, Ilya Leoshkevich,
	Mark Cave-Ayland, Marcel Apfelbaum

On 24/03/2025 19.58, Philippe Mathieu-Daudé wrote:
> Both s390_cpu_list() and s390_set_qemu_cpu_model() are
> defined in cpu_models.c, move their declarations in the
> related "cpu_models.h" header. Use full path to header
> in s390-virtio-ccw.c file.
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/cpu.h         | 4 ----
>   target/s390x/cpu_models.h  | 3 +++
>   hw/s390x/s390-virtio-ccw.c | 2 +-
>   3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index 5b7992deda6..8dd1936e3e2 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -900,11 +900,7 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
>   }
>   
>   
> -/* cpu_models.c */
> -void s390_cpu_list(void);
>   #define cpu_list s390_cpu_list
> -void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
> -                             const S390FeatInit feat_init);
>   
>   
>   /* helper.c */
> diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
> index 71d4bc2dd4a..f701bc0b532 100644
> --- a/target/s390x/cpu_models.h
> +++ b/target/s390x/cpu_models.h
> @@ -113,6 +113,9 @@ static inline uint64_t s390_cpuid_from_cpu_model(const S390CPUModel *model)
>   }
>   S390CPUDef const *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,
>                                       S390FeatBitmap features);
> +void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
> +                             const S390FeatInit feat_init);
> +void s390_cpu_list(void);
>   
>   bool kvm_s390_cpu_models_supported(void);
>   bool kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp);
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 75b32182eb0..4f11c75b625 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -35,7 +35,7 @@
>   #include "hw/s390x/css-bridge.h"
>   #include "hw/s390x/ap-bridge.h"
>   #include "migration/register.h"
> -#include "cpu_models.h"
> +#include "target/s390x/cpu_models.h"
>   #include "hw/nmi.h"
>   #include "hw/qdev-properties.h"
>   #include "hw/s390x/tod.h"

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



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

* Re: [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback
  2025-03-24 18:58 ` [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
@ 2025-03-26  7:43   ` Zhao Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  7:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:31PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:31 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback
> X-Mailer: git-send-email 2.47.1
> 
> Some targets define cpu_list to a method listing their
> CPUs on stdout. In order to make list_cpus() generic,
> introduce the CPUClass::list_cpus() callback.
> When no callback is registered, list_cpus() defaults
> to the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  include/hw/core/cpu.h | 2 ++
>  cpu-target.c          | 8 +++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
@ 2025-03-26  7:45   ` Zhao Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  7:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:32PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:32 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus
> X-Mailer: git-send-email 2.47.1
> 
> Register x86_cpu_list() as CPUClass:list_cpus callback.
> Reduce its scope and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/i386/cpu.h | 3 ---
>  target/i386/cpu.c | 3 ++-
>  2 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 3/7] target/ppc: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 3/7] target/ppc: " Philippe Mathieu-Daudé
@ 2025-03-26  8:17   ` Zhao Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  8:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:33PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:33 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 3/7] target/ppc: Register CPUClass:list_cpus
> X-Mailer: git-send-email 2.47.1
> 
> Register ppc_cpu_list() as CPUClass:list_cpus callback.
> Reduce its scope and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/ppc/cpu.h      | 4 ----
>  target/ppc/cpu_init.c | 3 ++-
>  2 files changed, 2 insertions(+), 5 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 4/7] target/sparc: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 4/7] target/sparc: " Philippe Mathieu-Daudé
@ 2025-03-26  8:19   ` Zhao Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  8:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:34PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:34 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 4/7] target/sparc: Register CPUClass:list_cpus
> X-Mailer: git-send-email 2.47.1
> 
> Register sparc_cpu_list() as CPUClass:list_cpus callback.
> Reduce its scope and remove the cpu_list definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/sparc/cpu.h | 3 ---
>  target/sparc/cpu.c | 3 ++-
>  2 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition
  2025-03-24 18:58 ` [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
@ 2025-03-26  8:34   ` Zhao Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  8:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:37PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:37 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition
> X-Mailer: git-send-email 2.47.1
> 
> Since we removed all definitions of cpu_list, the #ifdef
> check is always true. Remove it, inlining cpu_list().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  cpu-target.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h
  2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
  2025-03-25  5:30   ` Thomas Huth
@ 2025-03-26  8:40   ` Zhao Liu
  2025-03-26 13:20   ` Eric Farman
  2 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  8:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

On Mon, Mar 24, 2025 at 07:58:35PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon, 24 Mar 2025 19:58:35 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v3 5/7] target/s390x: Declare
>  s390_set_qemu_cpu_model/cpu_list in cpu_models.h
> X-Mailer: git-send-email 2.47.1
> 
> Both s390_cpu_list() and s390_set_qemu_cpu_model() are
> defined in cpu_models.c, move their declarations in the
> related "cpu_models.h" header. Use full path to header
> in s390-virtio-ccw.c file.
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/s390x/cpu.h         | 4 ----
>  target/s390x/cpu_models.h  | 3 +++
>  hw/s390x/s390-virtio-ccw.c | 2 +-
>  3 files changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



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

* Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
  2025-03-24 19:02   ` Richard Henderson
@ 2025-03-26  8:40   ` Zhao Liu
  2025-03-26 13:20   ` Eric Farman
  2 siblings, 0 replies; 22+ messages in thread
From: Zhao Liu @ 2025-03-26  8:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Eduardo Habkost,
	Yanan Wang, Richard Henderson, qemu-ppc, Nicholas Piggin,
	Ilya Leoshkevich, Mark Cave-Ayland, Marcel Apfelbaum

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>



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

* Re: [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h
  2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
  2025-03-25  5:30   ` Thomas Huth
  2025-03-26  8:40   ` Zhao Liu
@ 2025-03-26 13:20   ` Eric Farman
  2 siblings, 0 replies; 22+ messages in thread
From: Eric Farman @ 2025-03-26 13:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Paolo Bonzini, Halil Pasic, Zhao Liu, Eduardo Habkost, Yanan Wang,
	Richard Henderson, qemu-ppc, Nicholas Piggin, Ilya Leoshkevich,
	Mark Cave-Ayland, Marcel Apfelbaum

On Mon, 2025-03-24 at 19:58 +0100, Philippe Mathieu-Daudé wrote:
> Both s390_cpu_list() and s390_set_qemu_cpu_model() are
> defined in cpu_models.c, move their declarations in the
> related "cpu_models.h" header. Use full path to header
> in s390-virtio-ccw.c file.
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/s390x/cpu.h         | 4 ----
>  target/s390x/cpu_models.h  | 3 +++
>  hw/s390x/s390-virtio-ccw.c | 2 +-
>  3 files changed, 4 insertions(+), 5 deletions(-)

(resending with reply-all)

Reviewed-by: Eric Farman <farman@linux.ibm.com>


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

* Re: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus
  2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
  2025-03-24 19:02   ` Richard Henderson
  2025-03-26  8:40   ` Zhao Liu
@ 2025-03-26 13:20   ` Eric Farman
  2 siblings, 0 replies; 22+ messages in thread
From: Eric Farman @ 2025-03-26 13:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Paolo Bonzini, Halil Pasic, Zhao Liu, Eduardo Habkost, Yanan Wang,
	Richard Henderson, qemu-ppc, Nicholas Piggin, Ilya Leoshkevich,
	Mark Cave-Ayland, Marcel Apfelbaum

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>


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

* Re: [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback
  2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2025-03-24 18:58 ` [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
@ 2025-04-17 16:16 ` Philippe Mathieu-Daudé
  7 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 16:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-s390x, Daniel Henrique Barboza,
	David Hildenbrand, Christian Borntraeger, Artyom Tarasenko,
	Eric Farman, Paolo Bonzini, Halil Pasic, Zhao Liu,
	Eduardo Habkost, Yanan Wang, Richard Henderson, qemu-ppc,
	Nicholas Piggin, Ilya Leoshkevich, Mark Cave-Ayland,
	Marcel Apfelbaum

On 24/3/25 19:58, Philippe Mathieu-Daudé wrote:

> Based-on: <20250324165356.39540-1-philmd@linaro.org>
> 
> Philippe Mathieu-Daudé (7):
>    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/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h

While this patch builds correctly, I'm squashing it with next one as
suggested by Richard, and queuing the whole series.

Thanks all for the reviews!

>    target/s390x: Register CPUClass:list_cpus
>    cpus: Remove #ifdef check on cpu_list definition



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

end of thread, other threads:[~2025-04-17 16:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 18:58 [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé
2025-03-24 18:58 ` [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
2025-03-26  7:43   ` Zhao Liu
2025-03-24 18:58 ` [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
2025-03-26  7:45   ` Zhao Liu
2025-03-24 18:58 ` [PATCH v3 3/7] target/ppc: " Philippe Mathieu-Daudé
2025-03-26  8:17   ` Zhao Liu
2025-03-24 18:58 ` [PATCH v3 4/7] target/sparc: " Philippe Mathieu-Daudé
2025-03-26  8:19   ` Zhao Liu
2025-03-24 18:58 ` [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Philippe Mathieu-Daudé
2025-03-25  5:30   ` Thomas Huth
2025-03-26  8:40   ` Zhao Liu
2025-03-26 13:20   ` Eric Farman
2025-03-24 18:58 ` [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Philippe Mathieu-Daudé
2025-03-24 19:02   ` Richard Henderson
2025-03-24 19:04     ` Philippe Mathieu-Daudé
2025-03-25  5:29       ` Thomas Huth
2025-03-26  8:40   ` Zhao Liu
2025-03-26 13:20   ` Eric Farman
2025-03-24 18:58 ` [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
2025-03-26  8:34   ` Zhao Liu
2025-04-17 16:16 ` [PATCH v3 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.