* [Qemu-devel] [PATCH 0/2] target-i386: roll -cpu ?help, ?cpuid into help list, drop ?dump
@ 2012-08-10 14:35 Peter Maydell
2012-08-10 14:35 ` [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, " Peter Maydell
2012-08-10 14:35 ` [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro Peter Maydell
0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2012-08-10 14:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Eric Blake, Eduardo Habkost, patches
Commit c8057f95 (accidentally) disabled the ability to pass
option strings starting with '?' to the target-specific
cpu_list function, so the target-i386 specific "-cpu ?dump",
"-cpu ?cpuid" and "-cpu ?model" stopped working.
Since these options are undocumented and not used by libvirt,
simply drop them completely rather than reinstating them
with new style syntax. Instead, we fold the ?model and ?cpuid
output into the output of the plain "-cpu help" output. The
detailed output produced by ?dump is dropped.
Peter Maydell (2):
target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop
?dump
Drop cpu_list_id macro
cpus.c | 6 ++---
linux-user/main.c | 6 ++---
target-i386/cpu.c | 66 ++++++++++-------------------------------------------
target-i386/cpu.h | 4 ++--
4 files changed, 18 insertions(+), 64 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump
2012-08-10 14:35 [Qemu-devel] [PATCH 0/2] target-i386: roll -cpu ?help, ?cpuid into help list, drop ?dump Peter Maydell
@ 2012-08-10 14:35 ` Peter Maydell
2012-08-10 14:40 ` Eduardo Habkost
2012-08-10 14:35 ` [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro Peter Maydell
1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2012-08-10 14:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Eric Blake, Eduardo Habkost, patches
Commit c8057f95 (accidentally) disabled the ability to pass
option strings starting with '?' to the target-specific
cpu_list function, so the target-i386 specific "-cpu ?dump",
"-cpu ?cpuid" and "-cpu ?model" stopped working.
Since these options are undocumented and not used by libvirt,
simply drop them completely rather than reinstating them
with new style syntax. Instead, we fold the ?model and ?cpuid
output into the output of the plain "-cpu help" output. The
detailed output produced by ?dump is dropped.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target-i386/cpu.c | 64 +++++++++--------------------------------------------
1 file changed, 11 insertions(+), 53 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 880cfea..d3a2b47 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1059,70 +1059,28 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
}
}
-/* generate CPU information:
- * -? list model names
- * -?model list model names/IDs
- * -?dump output all model (x86_def_t) data
- * -?cpuid list all recognized cpuid flag names
- */
+/* generate CPU information */
void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
{
- unsigned char model = !strcmp("?model", optarg);
- unsigned char dump = !strcmp("?dump", optarg);
- unsigned char cpuid = !strcmp("?cpuid", optarg);
x86_def_t *def;
char buf[256];
- if (cpuid) {
- (*cpu_fprintf)(f, "Recognized CPUID flags:\n");
- listflags(buf, sizeof (buf), (uint32_t)~0, feature_name, 1);
- (*cpu_fprintf)(f, " f_edx: %s\n", buf);
- listflags(buf, sizeof (buf), (uint32_t)~0, ext_feature_name, 1);
- (*cpu_fprintf)(f, " f_ecx: %s\n", buf);
- listflags(buf, sizeof (buf), (uint32_t)~0, ext2_feature_name, 1);
- (*cpu_fprintf)(f, " extf_edx: %s\n", buf);
- listflags(buf, sizeof (buf), (uint32_t)~0, ext3_feature_name, 1);
- (*cpu_fprintf)(f, " extf_ecx: %s\n", buf);
- return;
- }
for (def = x86_defs; def; def = def->next) {
snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
- if (model || dump) {
- (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
- } else {
- (*cpu_fprintf)(f, "x86 %16s\n", buf);
- }
- if (dump) {
- memcpy(buf, &def->vendor1, sizeof (def->vendor1));
- memcpy(buf + 4, &def->vendor2, sizeof (def->vendor2));
- memcpy(buf + 8, &def->vendor3, sizeof (def->vendor3));
- buf[12] = '\0';
- (*cpu_fprintf)(f,
- " family %d model %d stepping %d level %d xlevel 0x%x"
- " vendor \"%s\"\n",
- def->family, def->model, def->stepping, def->level,
- def->xlevel, buf);
- listflags(buf, sizeof (buf), def->features, feature_name, 0);
- (*cpu_fprintf)(f, " feature_edx %08x (%s)\n", def->features,
- buf);
- listflags(buf, sizeof (buf), def->ext_features, ext_feature_name,
- 0);
- (*cpu_fprintf)(f, " feature_ecx %08x (%s)\n", def->ext_features,
- buf);
- listflags(buf, sizeof (buf), def->ext2_features, ext2_feature_name,
- 0);
- (*cpu_fprintf)(f, " extfeature_edx %08x (%s)\n",
- def->ext2_features, buf);
- listflags(buf, sizeof (buf), def->ext3_features, ext3_feature_name,
- 0);
- (*cpu_fprintf)(f, " extfeature_ecx %08x (%s)\n",
- def->ext3_features, buf);
- (*cpu_fprintf)(f, "\n");
- }
+ (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
}
if (kvm_enabled()) {
(*cpu_fprintf)(f, "x86 %16s\n", "[host]");
}
+ (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
+ listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1);
+ (*cpu_fprintf)(f, " f_edx: %s\n", buf);
+ listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1);
+ (*cpu_fprintf)(f, " f_ecx: %s\n", buf);
+ listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1);
+ (*cpu_fprintf)(f, " extf_edx: %s\n", buf);
+ listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1);
+ (*cpu_fprintf)(f, " extf_ecx: %s\n", buf);
}
int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro
2012-08-10 14:35 [Qemu-devel] [PATCH 0/2] target-i386: roll -cpu ?help, ?cpuid into help list, drop ?dump Peter Maydell
2012-08-10 14:35 ` [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, " Peter Maydell
@ 2012-08-10 14:35 ` Peter Maydell
2012-08-10 14:41 ` Eduardo Habkost
1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2012-08-10 14:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Eric Blake, Eduardo Habkost, patches
Since the only user of the extended cpu_list_id() format
was the x86 ?model/?dump/?cpuid output, we can drop it
completely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
cpus.c | 6 ++----
linux-user/main.c | 6 ++----
target-i386/cpu.c | 4 ++--
target-i386/cpu.h | 4 ++--
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/cpus.c b/cpus.c
index 3de2e27..c965b3a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1191,10 +1191,8 @@ void set_cpu_log_filename(const char *optarg)
void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
{
/* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
- cpu_list_id(f, cpu_fprintf, optarg);
-#elif defined(cpu_list)
- cpu_list(f, cpu_fprintf); /* deprecated */
+#if defined(cpu_list)
+ cpu_list(f, cpu_fprintf);
#endif
}
diff --git a/linux-user/main.c b/linux-user/main.c
index 53714de..8b50163 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3143,10 +3143,8 @@ static void handle_arg_cpu(const char *arg)
cpu_model = strdup(arg);
if (cpu_model == NULL || is_help_option(cpu_model)) {
/* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
- cpu_list_id(stdout, &fprintf, "");
-#elif defined(cpu_list)
- cpu_list(stdout, &fprintf); /* deprecated */
+#if defined(cpu_list)
+ cpu_list(stdout, &fprintf);
#endif
exit(1);
}
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index d3a2b47..a902502 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1059,8 +1059,8 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
}
}
-/* generate CPU information */
-void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
+/* generate CPU information. */
+void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
{
x86_def_t *def;
char buf[256];
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 60f9e97..751f44d 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -791,7 +791,7 @@ typedef struct CPUX86State {
X86CPU *cpu_x86_init(const char *cpu_model);
int cpu_x86_exec(CPUX86State *s);
-void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char *optarg);
+void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf);
void x86_cpudef_setup(void);
int cpu_x86_support_mca_broadcast(CPUX86State *env);
@@ -975,7 +975,7 @@ static inline CPUX86State *cpu_init(const char *cpu_model)
#define cpu_exec cpu_x86_exec
#define cpu_gen_code cpu_x86_gen_code
#define cpu_signal_handler cpu_x86_signal_handler
-#define cpu_list_id x86_cpu_list
+#define cpu_list x86_cpu_list
#define cpudef_setup x86_cpudef_setup
#define CPU_SAVE_VERSION 12
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump
2012-08-10 14:35 ` [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, " Peter Maydell
@ 2012-08-10 14:40 ` Eduardo Habkost
0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2012-08-10 14:40 UTC (permalink / raw)
To: Peter Maydell; +Cc: Anthony Liguori, Eric Blake, qemu-devel, patches
On Fri, Aug 10, 2012 at 03:35:17PM +0100, Peter Maydell wrote:
> Commit c8057f95 (accidentally) disabled the ability to pass
> option strings starting with '?' to the target-specific
> cpu_list function, so the target-i386 specific "-cpu ?dump",
> "-cpu ?cpuid" and "-cpu ?model" stopped working.
>
> Since these options are undocumented and not used by libvirt,
> simply drop them completely rather than reinstating them
> with new style syntax. Instead, we fold the ?model and ?cpuid
> output into the output of the plain "-cpu help" output. The
> detailed output produced by ?dump is dropped.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> target-i386/cpu.c | 64 +++++++++--------------------------------------------
> 1 file changed, 11 insertions(+), 53 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 880cfea..d3a2b47 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1059,70 +1059,28 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
> }
> }
>
> -/* generate CPU information:
> - * -? list model names
> - * -?model list model names/IDs
> - * -?dump output all model (x86_def_t) data
> - * -?cpuid list all recognized cpuid flag names
> - */
> +/* generate CPU information */
> void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
> {
> - unsigned char model = !strcmp("?model", optarg);
> - unsigned char dump = !strcmp("?dump", optarg);
> - unsigned char cpuid = !strcmp("?cpuid", optarg);
> x86_def_t *def;
> char buf[256];
>
> - if (cpuid) {
> - (*cpu_fprintf)(f, "Recognized CPUID flags:\n");
> - listflags(buf, sizeof (buf), (uint32_t)~0, feature_name, 1);
> - (*cpu_fprintf)(f, " f_edx: %s\n", buf);
> - listflags(buf, sizeof (buf), (uint32_t)~0, ext_feature_name, 1);
> - (*cpu_fprintf)(f, " f_ecx: %s\n", buf);
> - listflags(buf, sizeof (buf), (uint32_t)~0, ext2_feature_name, 1);
> - (*cpu_fprintf)(f, " extf_edx: %s\n", buf);
> - listflags(buf, sizeof (buf), (uint32_t)~0, ext3_feature_name, 1);
> - (*cpu_fprintf)(f, " extf_ecx: %s\n", buf);
> - return;
> - }
> for (def = x86_defs; def; def = def->next) {
> snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
> - if (model || dump) {
> - (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
> - } else {
> - (*cpu_fprintf)(f, "x86 %16s\n", buf);
> - }
> - if (dump) {
> - memcpy(buf, &def->vendor1, sizeof (def->vendor1));
> - memcpy(buf + 4, &def->vendor2, sizeof (def->vendor2));
> - memcpy(buf + 8, &def->vendor3, sizeof (def->vendor3));
> - buf[12] = '\0';
> - (*cpu_fprintf)(f,
> - " family %d model %d stepping %d level %d xlevel 0x%x"
> - " vendor \"%s\"\n",
> - def->family, def->model, def->stepping, def->level,
> - def->xlevel, buf);
> - listflags(buf, sizeof (buf), def->features, feature_name, 0);
> - (*cpu_fprintf)(f, " feature_edx %08x (%s)\n", def->features,
> - buf);
> - listflags(buf, sizeof (buf), def->ext_features, ext_feature_name,
> - 0);
> - (*cpu_fprintf)(f, " feature_ecx %08x (%s)\n", def->ext_features,
> - buf);
> - listflags(buf, sizeof (buf), def->ext2_features, ext2_feature_name,
> - 0);
> - (*cpu_fprintf)(f, " extfeature_edx %08x (%s)\n",
> - def->ext2_features, buf);
> - listflags(buf, sizeof (buf), def->ext3_features, ext3_feature_name,
> - 0);
> - (*cpu_fprintf)(f, " extfeature_ecx %08x (%s)\n",
> - def->ext3_features, buf);
> - (*cpu_fprintf)(f, "\n");
> - }
> + (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
> }
> if (kvm_enabled()) {
> (*cpu_fprintf)(f, "x86 %16s\n", "[host]");
> }
> + (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
> + listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1);
> + (*cpu_fprintf)(f, " f_edx: %s\n", buf);
> + listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1);
> + (*cpu_fprintf)(f, " f_ecx: %s\n", buf);
> + listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1);
> + (*cpu_fprintf)(f, " extf_edx: %s\n", buf);
> + listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1);
> + (*cpu_fprintf)(f, " extf_ecx: %s\n", buf);
> }
>
> int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
> --
> 1.7.9.5
>
--
Eduardo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro
2012-08-10 14:35 ` [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro Peter Maydell
@ 2012-08-10 14:41 ` Eduardo Habkost
0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2012-08-10 14:41 UTC (permalink / raw)
To: Peter Maydell; +Cc: Anthony Liguori, Eric Blake, qemu-devel, patches
On Fri, Aug 10, 2012 at 03:35:18PM +0100, Peter Maydell wrote:
> Since the only user of the extended cpu_list_id() format
> was the x86 ?model/?dump/?cpuid output, we can drop it
> completely.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> cpus.c | 6 ++----
> linux-user/main.c | 6 ++----
> target-i386/cpu.c | 4 ++--
> target-i386/cpu.h | 4 ++--
> 4 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 3de2e27..c965b3a 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1191,10 +1191,8 @@ void set_cpu_log_filename(const char *optarg)
> void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
> {
> /* XXX: implement xxx_cpu_list for targets that still miss it */
> -#if defined(cpu_list_id)
> - cpu_list_id(f, cpu_fprintf, optarg);
> -#elif defined(cpu_list)
> - cpu_list(f, cpu_fprintf); /* deprecated */
> +#if defined(cpu_list)
> + cpu_list(f, cpu_fprintf);
> #endif
> }
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 53714de..8b50163 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -3143,10 +3143,8 @@ static void handle_arg_cpu(const char *arg)
> cpu_model = strdup(arg);
> if (cpu_model == NULL || is_help_option(cpu_model)) {
> /* XXX: implement xxx_cpu_list for targets that still miss it */
> -#if defined(cpu_list_id)
> - cpu_list_id(stdout, &fprintf, "");
> -#elif defined(cpu_list)
> - cpu_list(stdout, &fprintf); /* deprecated */
> +#if defined(cpu_list)
> + cpu_list(stdout, &fprintf);
> #endif
> exit(1);
> }
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index d3a2b47..a902502 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1059,8 +1059,8 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
> }
> }
>
> -/* generate CPU information */
> -void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
> +/* generate CPU information. */
> +void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
> {
> x86_def_t *def;
> char buf[256];
> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> index 60f9e97..751f44d 100644
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -791,7 +791,7 @@ typedef struct CPUX86State {
>
> X86CPU *cpu_x86_init(const char *cpu_model);
> int cpu_x86_exec(CPUX86State *s);
> -void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char *optarg);
> +void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf);
> void x86_cpudef_setup(void);
> int cpu_x86_support_mca_broadcast(CPUX86State *env);
>
> @@ -975,7 +975,7 @@ static inline CPUX86State *cpu_init(const char *cpu_model)
> #define cpu_exec cpu_x86_exec
> #define cpu_gen_code cpu_x86_gen_code
> #define cpu_signal_handler cpu_x86_signal_handler
> -#define cpu_list_id x86_cpu_list
> +#define cpu_list x86_cpu_list
> #define cpudef_setup x86_cpudef_setup
>
> #define CPU_SAVE_VERSION 12
> --
> 1.7.9.5
>
--
Eduardo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-10 14:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-10 14:35 [Qemu-devel] [PATCH 0/2] target-i386: roll -cpu ?help, ?cpuid into help list, drop ?dump Peter Maydell
2012-08-10 14:35 ` [Qemu-devel] [PATCH 1/2] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, " Peter Maydell
2012-08-10 14:40 ` Eduardo Habkost
2012-08-10 14:35 ` [Qemu-devel] [PATCH 2/2] Drop cpu_list_id macro Peter Maydell
2012-08-10 14:41 ` Eduardo Habkost
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).