diff options
author | Alan Cox <alan@linux.intel.com> | 2012-05-14 21:41:09 +0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-14 21:49:32 +0400 |
commit | c3709e6734daa4d9b37fe31592ebb0eb57bae1bb (patch) | |
tree | ede4448a81dde842ca3af8a09077ce29235377af /arch | |
parent | b2a3477727c1d43b92a3e4223f10ad5bf639df06 (diff) | |
download | linux-c3709e6734daa4d9b37fe31592ebb0eb57bae1bb.tar.xz |
x86, kvm: KVM paravirt kernels don't check for CPUID being unavailable
We set cpuid_level to -1 if there is no CPUID instruction (only
possible on i386).
Signed-off-by: Alan Cox <alan@linux.intel.com>
Link: http://lkml.kernel.org/r/20120514174059.30236.1064.stgit@bluebook
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=12122
Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/kvm_para.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 734c3767cfac..183922e13de1 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h @@ -170,6 +170,9 @@ static inline int kvm_para_available(void) unsigned int eax, ebx, ecx, edx; char signature[13]; + 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); |