From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Subject: Re: [PATCH v2] target-i386: Improve x86_cpu_list output Date: Wed, 27 Feb 2013 10:33:24 +0100 Message-ID: <512DD2E4.1050605@suse.de> References: <512DCEC7.3030902@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Anthony Liguori , qemu-devel , Eduardo Habkost , Igor Mammedov , kvm To: Jan Kiszka Return-path: Received: from cantor2.suse.de ([195.135.220.15]:54717 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755374Ab3B0Jd1 (ORCPT ); Wed, 27 Feb 2013 04:33:27 -0500 In-Reply-To: <512DCEC7.3030902@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 27.02.2013 10:15, schrieb Jan Kiszka: > Several issues fixed: > - We were missing a bunch of feature lists. Fix this by simply dumpi= ng > the meta list feature_word_info. > - kvm_enabled() cannot be true at this point because accelerators ar= e > initialized much later during init. Also, hiding this makes it ver= y > hard to discover for users. Simply dump unconditionally if CONFIG_= KVM > is set. > - Add explanation for "host" CPU type. >=20 > Signed-off-by: Jan Kiszka > --- >=20 > Changes in v2: > - Do not dump "host" type if CONFIG_KVM is not set > - Explain that "host" depends on KVM mode I had requested on v1 to not fix multiple issues in one patch, but I ca= n split it myself on Friday if there's no other issues. Andreas >=20 > target-i386/cpu.c | 23 ++++++++++++----------- > 1 files changed, 12 insertions(+), 11 deletions(-) >=20 > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 5582e5f..b4189c3 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -1463,18 +1463,19 @@ void x86_cpu_list(FILE *f, fprintf_function c= pu_fprintf) > snprintf(buf, sizeof(buf), "%s", def->name); > (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id); > } > - if (kvm_enabled()) { > - (*cpu_fprintf)(f, "x86 %16s\n", "[host]"); > - } > +#ifdef CONFIG_KVM > + (*cpu_fprintf)(f, "x86 %16s %-48s\n", "host", > + "KVM processor with all supported host features " > + "(only available in KVM mode)"); > +#endif > + > (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n"); > - listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1); > - (*cpu_fprintf)(f, " %s\n", buf); > - listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1); > - (*cpu_fprintf)(f, " %s\n", buf); > - listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1); > - (*cpu_fprintf)(f, " %s\n", buf); > - listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1); > - (*cpu_fprintf)(f, " %s\n", buf); > + for (i =3D 0; i < ARRAY_SIZE(feature_word_info); i++) { > + FeatureWordInfo *fw =3D &feature_word_info[i]; > + > + listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1)= ; > + (*cpu_fprintf)(f, " %s\n", buf); > + } > } > =20 > CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg