diff options
author | Gleb Natapov <gleb@redhat.com> | 2011-12-15 12:44:05 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-12-22 13:06:59 -0200 |
commit | 665f6b6cb59cce982a6df285a8a49dad8504034e (patch) | |
tree | 3468a5e7b3728095b56b4c56299fae3ddc94598f | |
parent | c36c2555eb04bd3094d2e10abeb954c6edcc06f0 (diff) |
enable architectural PMU cpuid leaf for kvmuq/masterirqchip
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | target-i386/cpuid.c | 17 |
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 */ |