softmmu: List CPU types again
PATCH v2 1/1 softmmu: List CPU types again
From: Philippe Mathieu-Daudé <[email protected]>
Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Move list_cpus() declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by user-mode, along with moving its implementation to cpu.c, which is compiled per target.
--- cpu.c | 9 +++++++++ include/exec/cpu-common.h | 2 ++ include/sysemu/cpus.h | 2 -- softmmu/cpus.c | 8 -------- 4 files changed, 11 insertions(+), 10 deletions(-)
cpu.c +9 -0
@@ -35,6 +35,7 @@#include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "sysemu/replay.h" +#include "exec/cpu-all.h" #include "exec/exec-all.h" #include "exec/translate-all.h" #include "exec/log.h"
@@ -266,6 +267,14 @@ const char *parse_cpu_option(const char *cpu_option)return cpu_type; } +void list_cpus (const char *optarg) +{ +/* XXX: implement xxx_cpu_list for targets that still miss it */ +#if defined(cpu_list) +cpu_list (); +#endif +} +#if defined(CONFIG_USER_ONLY )void tb_invalidate_phys_addr (target_ulong addr) {
include/exec/cpu-common.h +2 -0
@@ -158,4 +158,6 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,/* vl.c */ extern int singlestep; +void list_cpus (const char *optarg); +#endif /* CPU_COMMON_H */
include/sysemu/cpus.h +0 -2
@@ -55,6 +55,4 @@ extern int smp_cores;extern int smp_threads;#endif -void list_cpus (const char *optarg); -#endif
softmmu/cpus.c +0 -8
@@ -728,14 +728,6 @@ int vm_stop_force_state(RunState state) } } -void list_cpus (const char *optarg) -{ -/* XXX: implement xxx_cpu_list for targets that still miss it */ -#if defined(cpu_list) -cpu_list (); -#endif -} -void qmp_memsave (int64_t addr,int64_t size,const char *filename,bool has_cpu,int64_t cpu_index,Error **errp) {
Signature · 1 line
2.34.1
Quoted 25 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
Commit
e0220bb5b2madecpus.ctarget-agnostic but didn't notice thecpu_list()function is only defined in target-specific code in "cpu.h". Movelist_cpus()declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by user-mode, along with moving its implementation tocpu.c, which is compiled per target.Fixes e0220bb5b2 ("softmmu: Build target-agnostic objects once")Reported-by Max Filippov <[email protected]>Suggested-by Paolo Bonzini <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- cpu.c | 9 +++++++++ include/exec/cpu-common.h | 2 ++ include/sysemu/cpus.h | 2 -- softmmu/cpus.c | 8 -------- 4 files changed, 11 insertions(+), 10 deletions(-)cpu.c +0
-0
cpu.c line 38
Quoted 4 lines
cpu.c +1
-0@@ -35,6 +35,7 @@#include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "sysemu/replay.h" +#include "exec/cpu-all.h"
Why not cpu-common.h?
Quoted 49 lines
cpu.c +8
-0#include "exec/exec-all.h" #include "exec/translate-all.h" #include "exec/log.h" @@ -266,6 +267,14 @@ const char *parse_cpu_option(const char *cpu_option)return cpu_type; } +void list_cpus (const char *optarg) +{ +/* XXX: implement xxx_cpu_list for targets that still miss it */ +#if defined(cpu_list) +cpu_list (); +#endif +} +#if defined(CONFIG_USER_ONLY )void tb_invalidate_phys_addr (target_ulong addr) {include/exec/cpu-common.h +2
-0@@ -158,4 +158,6 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,/* vl.c */ extern int singlestep; +void list_cpus (const char *optarg); +#endif /* CPU_COMMON_H */ include/sysemu/cpus.h +0
-2@@ -55,6 +55,4 @@ extern int smp_cores;extern int smp_threads;#endif -void list_cpus (const char *optarg); -#endif softmmu/cpus.c +0
-1@@ -728,14 +728,6 @@ int vm_stop_force_state(RunState state) } } -void list_cpus (const char *optarg)
softmmu/cpus.c int vm_stop_force_state(RunState state) · line 733
Quoted 10 lines
softmmu/cpus.c +0
-7-{ -/* XXX: implement xxx_cpu_list for targets that still miss it */ -#if defined(cpu_list) -cpu_list (); -#endif -} -void qmp_memsave (int64_t addr,int64_t size,const char *filename,bool has_cpu,int64_t cpu_index,Error **errp) {
Quoted 21 lines · Thomas Huth
Quoted 20 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
Commit
e0220bb5b2madecpus.ctarget-agnostic but didn't notice thecpu_list()function is only defined in target-specific code in "cpu.h". Movelist_cpus()declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by user-mode, along with moving its implementation tocpu.c, which is compiled per target.Fixes e0220bb5b2 ("softmmu: Build target-agnostic objects once")Reported-by Max Filippov <[email protected]>Suggested-by Paolo Bonzini <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
cpu.c | 9 +++++++++
include/exec/cpu-common.h| 2 ++
include/sysemu/cpus.h | 2 --
softmmu/cpus.c | 8 --------4 files changed, 11 insertions(+), 10 deletions(-)
Quoted 11 lines
cpu.c line 38
Quoted 9 lines
cpu.c +1
-0@@ -35,6 +35,7 @@ #include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "sysemu/replay.h" +#include "exec/cpu-all.h" Why not
cpu-common.h?
Copy/paste mistake I presume.
Quoted 1 line
Reviewed-by Thomas Huth <[email protected]>
Thanks!