public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] target-i386: Improve x86_cpu_list output
@ 2013-02-27  9:15 Jan Kiszka
  2013-02-27  9:30 ` Igor Mammedov
  2013-02-27  9:33 ` Andreas Färber
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2013-02-27  9:15 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Igor Mammedov, kvm, qemu-devel, Andreas Färber,
	Eduardo Habkost

Several issues fixed:
 - We were missing a bunch of feature lists. Fix this by simply dumping
   the meta list feature_word_info.
 - kvm_enabled() cannot be true at this point because accelerators are
   initialized much later during init. Also, hiding this makes it very
   hard to discover for users. Simply dump unconditionally if CONFIG_KVM
   is set.
 - Add explanation for "host" CPU type.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - Do not dump "host" type if CONFIG_KVM is not set
 - Explain that "host" depends on KVM mode

 target-i386/cpu.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

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 cpu_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 = 0; i < ARRAY_SIZE(feature_word_info); i++) {
+        FeatureWordInfo *fw = &feature_word_info[i];
+
+        listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1);
+        (*cpu_fprintf)(f, "  %s\n", buf);
+    }
 }
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] target-i386: Improve x86_cpu_list output
  2013-02-27  9:15 [PATCH v2] target-i386: Improve x86_cpu_list output Jan Kiszka
@ 2013-02-27  9:30 ` Igor Mammedov
  2013-02-27  9:33 ` Andreas Färber
  1 sibling, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2013-02-27  9:30 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Eduardo Habkost, Anthony Liguori, qemu-devel, kvm,
	Andreas Färber

On Wed, 27 Feb 2013 10:15:51 +0100
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> Several issues fixed:
>  - We were missing a bunch of feature lists. Fix this by simply dumping
>    the meta list feature_word_info.
>  - kvm_enabled() cannot be true at this point because accelerators are
>    initialized much later during init. Also, hiding this makes it very
>    hard to discover for users. Simply dump unconditionally if CONFIG_KVM
>    is set.
>  - Add explanation for "host" CPU type.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-By: Igor Mammedov <imammedo@redhat.com>

> ---
> 
> Changes in v2:
>  - Do not dump "host" type if CONFIG_KVM is not set
>  - Explain that "host" depends on KVM mode
> 
>  target-i386/cpu.c |   23 ++++++++++++-----------
>  1 files changed, 12 insertions(+), 11 deletions(-)
> 
> 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
> cpu_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 = 0; i < ARRAY_SIZE(feature_word_info); i++) {
> +        FeatureWordInfo *fw = &feature_word_info[i];
> +
> +        listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1);
> +        (*cpu_fprintf)(f, "  %s\n", buf);
> +    }
>  }
>  
>  CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] target-i386: Improve x86_cpu_list output
  2013-02-27  9:15 [PATCH v2] target-i386: Improve x86_cpu_list output Jan Kiszka
  2013-02-27  9:30 ` Igor Mammedov
@ 2013-02-27  9:33 ` Andreas Färber
  2013-02-27  9:37   ` Jan Kiszka
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2013-02-27  9:33 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Anthony Liguori, qemu-devel, Eduardo Habkost, Igor Mammedov, kvm

Am 27.02.2013 10:15, schrieb Jan Kiszka:
> Several issues fixed:
>  - We were missing a bunch of feature lists. Fix this by simply dumping
>    the meta list feature_word_info.
>  - kvm_enabled() cannot be true at this point because accelerators are
>    initialized much later during init. Also, hiding this makes it very
>    hard to discover for users. Simply dump unconditionally if CONFIG_KVM
>    is set.
>  - Add explanation for "host" CPU type.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> 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 can
split it myself on Friday if there's no other issues.

Andreas

> 
>  target-i386/cpu.c |   23 ++++++++++++-----------
>  1 files changed, 12 insertions(+), 11 deletions(-)
> 
> 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 cpu_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 = 0; i < ARRAY_SIZE(feature_word_info); i++) {
> +        FeatureWordInfo *fw = &feature_word_info[i];
> +
> +        listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1);
> +        (*cpu_fprintf)(f, "  %s\n", buf);
> +    }
>  }
>  
>  CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] target-i386: Improve x86_cpu_list output
  2013-02-27  9:33 ` Andreas Färber
@ 2013-02-27  9:37   ` Jan Kiszka
  2013-03-24 17:38     ` [Qemu-devel] " Andreas Färber
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2013-02-27  9:37 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Igor Mammedov, Anthony Liguori, qemu-devel, kvm, Eduardo Habkost

On 2013-02-27 10:33, Andreas Färber wrote:
> Am 27.02.2013 10:15, schrieb Jan Kiszka:
>> Several issues fixed:
>>  - We were missing a bunch of feature lists. Fix this by simply dumping
>>    the meta list feature_word_info.
>>  - kvm_enabled() cannot be true at this point because accelerators are
>>    initialized much later during init. Also, hiding this makes it very
>>    hard to discover for users. Simply dump unconditionally if CONFIG_KVM
>>    is set.
>>  - Add explanation for "host" CPU type.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>
>> 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 can
> split it myself on Friday if there's no other issues.

Sorry, missed that. But I also see no point in splitting up in this
case, specifically as we no agree on the result.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] target-i386: Improve x86_cpu_list output
  2013-02-27  9:37   ` Jan Kiszka
@ 2013-03-24 17:38     ` Andreas Färber
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2013-03-24 17:38 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Igor Mammedov, Anthony Liguori, qemu-devel, kvm, Eduardo Habkost

Am 27.02.2013 10:37, schrieb Jan Kiszka:
> On 2013-02-27 10:33, Andreas Färber wrote:
>> Am 27.02.2013 10:15, schrieb Jan Kiszka:
>>> Several issues fixed:
>>>  - We were missing a bunch of feature lists. Fix this by simply dumping
>>>    the meta list feature_word_info.
>>>  - kvm_enabled() cannot be true at this point because accelerators are
>>>    initialized much later during init. Also, hiding this makes it very
>>>    hard to discover for users. Simply dump unconditionally if CONFIG_KVM
>>>    is set.
>>>  - Add explanation for "host" CPU type.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>
>>> 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 can
>> split it myself on Friday if there's no other issues.
> 
> Sorry, missed that. But I also see no point in splitting up in this
> case, specifically as we no agree on the result.

Thanks, applied to qom-cpu as two patches (clean git-checkout -p split):
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Sorry for taking so long.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-24 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27  9:15 [PATCH v2] target-i386: Improve x86_cpu_list output Jan Kiszka
2013-02-27  9:30 ` Igor Mammedov
2013-02-27  9:33 ` Andreas Färber
2013-02-27  9:37   ` Jan Kiszka
2013-03-24 17:38     ` [Qemu-devel] " Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox