]> Pileus Git - ~andy/linux/blobdiff - arch/x86/include/asm/kvm_para.h
Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[~andy/linux] / arch / x86 / include / asm / kvm_para.h
index 183922e13de1aa83ead2959144378e96934d4608..63ab1661d00eb0401eba1a379eb49409933332fa 100644 (file)
@@ -95,6 +95,14 @@ struct kvm_vcpu_pv_apf_data {
 extern void kvmclock_init(void);
 extern int kvm_register_clock(char *txt);
 
+#ifdef CONFIG_KVM_CLOCK
+bool kvm_check_and_clear_guest_paused(void);
+#else
+static inline bool kvm_check_and_clear_guest_paused(void)
+{
+       return false;
+}
+#endif /* CONFIG_KVMCLOCK */
 
 /* This instruction is vmcall.  On non-VT architectures, it will generate a
  * trap that we will then rewrite to the appropriate instruction.
@@ -173,14 +181,16 @@ static inline int kvm_para_available(void)
        if (boot_cpu_data.cpuid_level < 0)
                return 0;       /* So we don't blow up on old processors */
 
-       cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
-       memcpy(signature + 0, &ebx, 4);
-       memcpy(signature + 4, &ecx, 4);
-       memcpy(signature + 8, &edx, 4);
-       signature[12] = 0;
+       if (cpu_has_hypervisor) {
+               cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
+               memcpy(signature + 0, &ebx, 4);
+               memcpy(signature + 4, &ecx, 4);
+               memcpy(signature + 8, &edx, 4);
+               signature[12] = 0;
 
-       if (strcmp(signature, "KVMKVMKVM") == 0)
-               return 1;
+               if (strcmp(signature, "KVMKVMKVM") == 0)
+                       return 1;
+       }
 
        return 0;
 }