Message ID | 1233859341-10419-2-git-send-email-glommer@redhat.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
I am all for it. Just one nit, below. > > +char * __cpuinit hypervisor_str(struct cpuinfo_x86 *c) > +{ > + if (c->x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) > + return "VMWare"; Better to have "VMware" string instead. Thanks, Alok -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
* Glauber Costa <glommer@redhat.com> wrote: > +char * __cpuinit hypervisor_str(struct cpuinfo_x86 *c) > +{ > + if (c->x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) > + return "VMWare"; > + else > + return "none"; > +} i'd suggest these variants instead: virtualization: native kernel virtualization: KVM guest virtualization: VMWare guest virtualization: Linux guest Ingo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
* Ingo Molnar (mingo@elte.hu) wrote:
> virtualization: Linux guest
That's confusing. Meaning lguest? These are all Linux guests ;-)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ingo Molnar wrote: > * Glauber Costa <glommer@redhat.com> wrote: > > >> +char * __cpuinit hypervisor_str(struct cpuinfo_x86 *c) >> +{ >> + if (c->x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) >> + return "VMWare"; >> + else >> + return "none"; >> +} >> > > i'd suggest these variants instead: > > virtualization: native kernel > I don't think "native kernel" really ports well to other architectures (like s390 or PPC) that always have hypervisors present in some form. I think "none" makes more sense in the case of bare metal x86. Regards, Anthony Liguori > virtualization: KVM guest > virtualization: VMWare guest > virtualization: Linux guest > > Ingo > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h index 369f5c5..a0c0b0f 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -22,5 +22,6 @@ extern unsigned long get_hypervisor_tsc_freq(void); extern void init_hypervisor(struct cpuinfo_x86 *c); +extern char *hypervisor_str(struct cpuinfo_x86 *c); #endif diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index fb5b86a..8c3fca7 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -51,6 +51,14 @@ hypervisor_set_feature_bits(struct cpuinfo_x86 *c) } } +char * __cpuinit hypervisor_str(struct cpuinfo_x86 *c) +{ + if (c->x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) + return "VMWare"; + else + return "none"; +} + void __cpuinit init_hypervisor(struct cpuinfo_x86 *c) { detect_hypervisor_vendor(c); diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 01b1244..3700607 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -4,6 +4,8 @@ #include <linux/seq_file.h> #include <linux/cpufreq.h> +#include <asm/hypervisor.h> + /* * Get CPU information for use by the procfs. */ @@ -90,12 +92,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) "vendor_id\t: %s\n" "cpu family\t: %d\n" "model\t\t: %u\n" - "model name\t: %s\n", + "model name\t: %s\n" + "hypervisor\t: %s\n", cpu, c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown", c->x86, c->x86_model, - c->x86_model_id[0] ? c->x86_model_id : "unknown"); + c->x86_model_id[0] ? c->x86_model_id : "unknown", + hypervisor_str(c)); if (c->x86_mask || c->cpuid_level >= 0) seq_printf(m, "stepping\t: %d\n", c->x86_mask);