* [PATCH-for-7.0 v2] softmmu: List CPU types again
@ 2022-03-10 14:07 Philippe Mathieu-Daudé
2022-03-10 15:16 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-10 14:07 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Thomas Huth, Richard Henderson,
Philippe Mathieu-Daudé, Max Filippov
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
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.
Fixes: e0220bb5b2 ("softmmu: Build target-agnostic objects once")
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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(-)
diff --git a/cpu.c b/cpu.c
index d564886149..d50845f713 100644
--- a/cpu.c
+++ b/cpu.c
@@ -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)
{
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 7f7b5943c7..50a7d2912e 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -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 */
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 868f1192de..b5c87d48b3 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -55,6 +55,4 @@ extern int smp_cores;
extern int smp_threads;
#endif
-void list_cpus(const char *optarg);
-
#endif
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index e1d84c8ccb..7b75bb66d5 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -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)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH-for-7.0 v2] softmmu: List CPU types again
2022-03-10 14:07 [PATCH-for-7.0 v2] softmmu: List CPU types again Philippe Mathieu-Daudé
@ 2022-03-10 15:16 ` Thomas Huth
2022-03-14 13:59 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2022-03-10 15:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Paolo Bonzini, Richard Henderson, Philippe Mathieu-Daudé,
Max Filippov
On 10/03/2022 15.07, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> 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.
>
> Fixes: e0220bb5b2 ("softmmu: Build target-agnostic objects once")
> Reported-by: Max Filippov <jcmvbkbc@gmail.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> 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(-)
>
> diff --git a/cpu.c b/cpu.c
> index d564886149..d50845f713 100644
> --- a/cpu.c
> +++ b/cpu.c
> @@ -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?
> #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)
> {
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 7f7b5943c7..50a7d2912e 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -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 */
> diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
> index 868f1192de..b5c87d48b3 100644
> --- a/include/sysemu/cpus.h
> +++ b/include/sysemu/cpus.h
> @@ -55,6 +55,4 @@ extern int smp_cores;
> extern int smp_threads;
> #endif
>
> -void list_cpus(const char *optarg);
> -
> #endif
> diff --git a/softmmu/cpus.c b/softmmu/cpus.c
> index e1d84c8ccb..7b75bb66d5 100644
> --- a/softmmu/cpus.c
> +++ b/softmmu/cpus.c
> @@ -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)
> {
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH-for-7.0 v2] softmmu: List CPU types again
2022-03-10 15:16 ` Thomas Huth
@ 2022-03-14 13:59 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-14 13:59 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Paolo Bonzini, Richard Henderson, Philippe Mathieu-Daudé,
Max Filippov
On 10/3/22 16:16, Thomas Huth wrote:
> On 10/03/2022 15.07, Philippe Mathieu-Daudé wrote:
>> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>> 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.
>>
>> Fixes: e0220bb5b2 ("softmmu: Build target-agnostic objects once")
>> Reported-by: Max Filippov <jcmvbkbc@gmail.com>
>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> 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(-)
>>
>> diff --git a/cpu.c b/cpu.c
>> index d564886149..d50845f713 100644
>> --- a/cpu.c
>> +++ b/cpu.c
>> @@ -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.
> Reviewed-by: Thomas Huth <thuth@redhat.com>
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-14 14:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10 14:07 [PATCH-for-7.0 v2] softmmu: List CPU types again Philippe Mathieu-Daudé
2022-03-10 15:16 ` Thomas Huth
2022-03-14 13:59 ` Philippe Mathieu-Daudé
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).