From: tip-bot for Alan Cox <alan@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, alan@linux.intel.com,
hpa@zytor.com, mingo@kernel.org, mtosatti@redhat.com,
tglx@linutronix.de, hpa@linux.intel.com, avi@redhat.com
Subject: [tip:x86/urgent] x86, kvm: KVM paravirt kernels don' t check for CPUID being unavailable
Date: Mon, 14 May 2012 13:31:52 -0700 [thread overview]
Message-ID: <tip-c3709e6734daa4d9b37fe31592ebb0eb57bae1bb@git.kernel.org> (raw)
In-Reply-To: <20120514174059.30236.1064.stgit@bluebook>
Commit-ID: c3709e6734daa4d9b37fe31592ebb0eb57bae1bb
Gitweb: http://git.kernel.org/tip/c3709e6734daa4d9b37fe31592ebb0eb57bae1bb
Author: Alan Cox <alan@linux.intel.com>
AuthorDate: Mon, 14 May 2012 18:41:09 +0100
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Mon, 14 May 2012 10:49:32 -0700
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>
---
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 734c376..183922e 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);
parent reply other threads:[~2012-05-14 20:32 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20120514174059.30236.1064.stgit@bluebook>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-c3709e6734daa4d9b37fe31592ebb0eb57bae1bb@git.kernel.org \
--to=alan@linux.intel.com \
--cc=avi@redhat.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome