aboutsummaryrefslogtreecommitdiffstats
path: root/target-i386
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2011-12-15 12:44:05 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2011-12-22 14:53:01 -0200
commita0fa82085e175bf8ce6d69a3f83695f81af2a649 (patch)
tree5c68792b1008704ef5dcf14758e846226ad91482 /target-i386
parent991dfefdee8f4d1405f4b3cd799e7579f54b6c9f (diff)
enable architectural PMU cpuid leaf for kvm
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/cpuid.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 0b3af9060..91a104ba0 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -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 */