diff mbox

qemu-kvm: Ask kernel about supported svm features

Message ID 1271933879-15849-1-git-send-email-joerg.roedel@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joerg Roedel April 22, 2010, 10:57 a.m. UTC
None
diff mbox

Patch

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 748ff69..6eccd69 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1327,8 +1327,18 @@  int kvm_arch_init_vcpu(CPUState *cenv)
     qemu_kvm_cpuid_on_env(&copy);
     limit = copy.regs[R_EAX];
 
-    for (i = 0x80000000; i <= limit; ++i)
-	do_cpuid_ent(&cpuid_ent[cpuid_nent++], i, 0, &copy);
+    for (i = 0x80000000; i <= limit; ++i) {
+        do_cpuid_ent(&cpuid_ent[cpuid_nent], i, 0, &copy);
+        switch (i) {
+            case 0x8000000a:
+                cpuid_ent[cpuid_nent].eax = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EAX);
+                cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX);
+                cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX);
+                cpuid_ent[cpuid_nent].edx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EDX);
+                break;
+        }
+        cpuid_nent += 1;
+    }
 
     kvm_setup_cpuid2(cenv, cpuid_nent, cpuid_ent);