@@ -126,6 +126,7 @@ struct cpuinfo_x86 {
#define X86_HYPER_VENDOR_NONE 0
#define X86_HYPER_VENDOR_VMWARE 1
+#define X86_HYPER_VENDOR_KVM 2
/*
* capabilities of CPUs
@@ -23,6 +23,7 @@
#include <asm/processor.h>
#include <asm/vmware.h>
+#include <asm/kvm_para.h>
#include <asm/hypervisor.h>
static inline void __cpuinit
@@ -30,6 +31,8 @@ detect_hypervisor_vendor(struct cpuinfo_x86 *c)
{
if (vmware_platform()) {
c->x86_hyper_vendor = X86_HYPER_VENDOR_VMWARE;
+ } else if (kvm_para_available()) {
+ c->x86_hyper_vendor = X86_HYPER_VENDOR_KVM;
} else {
c->x86_hyper_vendor = X86_HYPER_VENDOR_NONE;
}
@@ -55,6 +58,8 @@ char * __cpuinit hypervisor_str(struct cpuinfo_x86 *c)
{
if (c->x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE)
return "VMWare";
+ else if (c->x86_hyper_vendor == X86_HYPER_VENDOR_KVM)
+ return "KVM";
else
return "none";
}