Received: from eggs.gnu.org ([208.118.235.92]:35640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4Qu-0004td-MC for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF4Qs-0004Il-HY for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:20 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35794 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4Qs-0004Ig-7p for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:18 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 21 Sep 2012 16:38:26 +0200 Message-Id: <1348238315-29748-3-git-send-email-afaerber@suse.de> In-Reply-To: <1348238315-29748-1-git-send-email-afaerber@suse.de> References: <1348238315-29748-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 02/11] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Eduardo Habkost , anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Peter Maydell 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 Signed-off-by: Eduardo Habkost Reviewed-by: Eduardo Habkost Reviewed-by: Igor Mammedov Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpu.c | 64 +++++++++--------------------------------------= ------ 1 Datei ge=C3=A4ndert, 11 Zeilen hinzugef=C3=BCgt(+), 53 Zeilen entfernt= (-) 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, uin= t32_t fbits, } } =20 -/* 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 *opt= arg) { - unsigned char model =3D !strcmp("?model", optarg); - unsigned char dump =3D !strcmp("?dump", optarg); - unsigned char cpuid =3D !strcmp("?cpuid", optarg); x86_def_t *def; char buf[256]; =20 - 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 =3D x86_defs; def; def =3D 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] =3D '\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_feat= ures, - buf); - listflags(buf, sizeof (buf), def->ext2_features, ext2_featur= e_name, - 0); - (*cpu_fprintf)(f, " extfeature_edx %08x (%s)\n", - def->ext2_features, buf); - listflags(buf, sizeof (buf), def->ext3_features, ext3_featur= e_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); } =20 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) --=20 1.7.10.4