target-i386: Improve x86_cpu_list output
PATCH v2 1/1 target-i386: Improve x86_cpu_list output
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.
---
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(-)
target-i386/cpu.c +12 -11
@@ -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)
Signature · 1 line
1.7.3.4
Quoted 10 lines · On Wed, 27 Feb 2013 10:15:51 +0100 Jan Kiszka <[email protected]> wrote:
Several issues fixed:
- We were missing a bunch of feature lists. Fix this by simply dumping the meta listfeature_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 ifCONFIG_KVMis set.
- Add explanation for "host" CPU type.Signed-off-by Jan Kiszka <[email protected]>
Quoted 44 lines
---
Changes in v2:
- Do not dump "host" type ifCONFIG_KVMis not set
- Explain that "host" depends on KVM modetarget-i386/cpu.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)target-i386/cpu.c +12
-11@@ -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)
Am 27.02.2013 10:15, schrieb Jan Kiszka:
Quoted 9 lines
Several issues fixed:
- We were missing a bunch of feature lists. Fix this by simply dumping the meta listfeature_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 ifCONFIG_KVMis set.
- Add explanation for "host" CPU type.
Quoted 6 lines
Signed-off-by Jan Kiszka <[email protected]>---
Changes in v2:
- Do not dump "host" type ifCONFIG_KVMis 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
Quoted 40 lines
target-i386/cpu.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)target-i386/cpu.c +12
-11@@ -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)
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 13 lines · Andreas Färber
Am 27.02.2013 10:15, schrieb Jan Kiszka:
Quoted 12 lines
Several issues fixed:
- We were missing a bunch of feature lists. Fix this by simply dumping the meta listfeature_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 ifCONFIG_KVMis set.
- Add explanation for "host" CPU type.Signed-off-by Jan Kiszka <[email protected]>---
Quoted 6 lines
Quoted 3 lines
Changes in v2:
- Do not dump "host" type ifCONFIG_KVMis not set
- Explain that "host" depends on KVM modeI 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
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux
Andreas Färber
AppliedAm 27.02.2013 10:37, schrieb Jan Kiszka:
Quoted 18 lines · Andreas Färber
Quoted 17 lines
Am 27.02.2013 10:15, schrieb Jan Kiszka:
Quoted 15 lines
Several issues fixed:
- We were missing a bunch of feature lists. Fix this by simply dumping the meta listfeature_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 ifCONFIG_KVMis set.
- Add explanation for "host" CPU type.Signed-off-by Jan Kiszka <[email protected]>---
Changes in v2:
- Do not dump "host" type ifCONFIG_KVMis not set
- Explain that "host" depends on KVM mode
Quoted 5 lines
Quoted 2 lines
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
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg