aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-09-10 11:31:06 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:48 -0400
commit4c62a2dc92518c5adf434df8e5c2283c6762672a (patch)
tree610ba76b930c0d126a72871ba15b35c89b06fbc3 /arch/x86/kvm/svm.c
parent3d4aeaad8bb8f8084a414819934b73ab49c26c92 (diff)
KVM: X86: Report SVM bit to userspace only when supported
This patch fixes a bug in KVM where it _always_ reports the support of the SVM feature to userspace. But KVM only supports SVM on AMD hardware and only when it is enabled in the kernel module. This patch fixes the wrong reporting. Cc: stable@kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 36e6c88913d..e0f4da07f98 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3469,6 +3469,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu)
3469static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) 3469static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
3470{ 3470{
3471 switch (func) { 3471 switch (func) {
3472 case 0x80000001:
3473 if (nested)
3474 entry->ecx |= (1 << 2); /* Set SVM bit */
3475 break;
3472 case 0x8000000A: 3476 case 0x8000000A:
3473 entry->eax = 1; /* SVM revision 1 */ 3477 entry->eax = 1; /* SVM revision 1 */
3474 entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper 3478 entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper