From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Andreas Färber" <afaerber@suse.de>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: [Qemu-devel] [PATCH 1/7] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump
Date: Wed, 5 Sep 2012 17:41:07 -0300 [thread overview]
Message-ID: <1346877673-9136-2-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1346877673-9136-1-git-send-email-ehabkost@redhat.com>
From: Peter Maydell <peter.maydell@linaro.org>
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>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
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 423e009..5c98064 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1073,70 +1073,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);
}
CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
--
1.7.11.4
next prev parent reply other threads:[~2012-09-05 20:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 20:41 [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Eduardo Habkost
2012-09-05 20:41 ` Eduardo Habkost [this message]
2012-09-10 9:40 ` [Qemu-devel] [PATCH 1/7] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 2/7] Drop cpu_list_id macro Eduardo Habkost
2012-09-10 9:46 ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 3/7] i386: add missing CPUID_* constants Eduardo Habkost
2012-09-10 9:57 ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C Eduardo Habkost
2012-09-10 12:18 ` Igor Mammedov
2012-09-10 12:31 ` Igor Mammedov
2012-09-10 13:04 ` Igor Mammedov
2012-09-10 14:50 ` Don Slutz
2012-09-10 14:58 ` Andreas Färber
2012-09-10 15:07 ` Eduardo Habkost
2012-09-10 15:13 ` Andreas Färber
2012-09-10 15:04 ` Eduardo Habkost
2012-09-10 13:40 ` Igor Mammedov
2012-09-11 19:45 ` Don Slutz
2012-09-05 20:41 ` [Qemu-devel] [PATCH 5/7] eliminate cpus-x86_64.conf file Eduardo Habkost
2012-09-10 13:46 ` Igor Mammedov
2012-09-05 20:41 ` [Qemu-devel] [PATCH 6/7] x86_cpudef_setup: coding style change Eduardo Habkost
2012-09-11 19:45 ` Don Slutz
2012-09-05 20:41 ` [Qemu-devel] [PATCH 7/7] i386: kill cpudef config section support Eduardo Habkost
2012-09-10 14:20 ` Igor Mammedov
2012-09-10 15:17 ` [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Andreas Färber
2012-09-10 15:30 ` Igor Mammedov
2012-09-10 15:46 ` [Qemu-devel] CPU code roadmap (was Re: [PATCH 0/7] x86 CPU patches that didn't get into 1.2) Eduardo Habkost
2012-09-11 14:59 ` Eduardo Habkost
2012-09-17 17:29 ` [Qemu-devel] [PATCH 0/7] x86 CPU patches that didn't get into 1.2 Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346877673-9136-2-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=imammedo@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).