Skip to content

Commit

Permalink
enable architectural PMU cpuid leaf for kvm
Browse files Browse the repository at this point in the history
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
Gleb Natapov authored and matosatti committed Dec 22, 2011
1 parent 991dfef commit a0fa820
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions target-i386/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit a0fa820

Please sign in to comment.