]> git.proxmox.com Git - mirror_qemu.git/commitdiff
enable architectural PMU cpuid leaf for kvm
authorGleb Natapov <gleb@redhat.com>
Thu, 15 Dec 2011 10:44:05 +0000 (12:44 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 22 Dec 2011 16:53:01 +0000 (14:53 -0200)
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
target-i386/cpuid.c

index 0b3af9060ce5c6149a168662051477b6781ed3fd..91a104ba0b1d6da5bb35a75e1531c51ad825fe06 100644 (file)
@@ -1180,10 +1180,19 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         break;
     case 0xA:
         /* Architectural Performance Monitoring Leaf */
-        *eax = 0;
-        *ebx = 0;
-        *ecx = 0;
-        *edx = 0;
+        if (kvm_enabled()) {
+            KVMState *s = env->kvm_state;
+
+            *eax = kvm_arch_get_supported_cpuid(s, 0xA, count, R_EAX);
+            *ebx = kvm_arch_get_supported_cpuid(s, 0xA, count, R_EBX);
+            *ecx = kvm_arch_get_supported_cpuid(s, 0xA, count, R_ECX);
+            *edx = kvm_arch_get_supported_cpuid(s, 0xA, count, R_EDX);
+        } else {
+            *eax = 0;
+            *ebx = 0;
+            *ecx = 0;
+            *edx = 0;
+        }
         break;
     case 0xD:
         /* Processor Extended State */