[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/5] enable architectural PMU cpuid leaf for kvm
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 5/5] enable architectural PMU cpuid leaf for kvm |
Date: |
Thu, 22 Dec 2011 18:13:50 -0200 |
From: Gleb Natapov <address@hidden>
Signed-off-by: Gleb Natapov <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
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 0b3af90..91a104b 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 */
--
1.7.6.4
- [Qemu-devel] [PATCH 0/5] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2011/12/22
- [Qemu-devel] [PATCH 2/5] kvm: x86: Avoid runtime allocation of xsave buffer, Marcelo Tosatti, 2011/12/22
- [Qemu-devel] [PATCH 5/5] enable architectural PMU cpuid leaf for kvm,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 4/5] Set numa topology for max_cpus, Marcelo Tosatti, 2011/12/22
- [Qemu-devel] [PATCH 3/5] kvm: x86: Drop redundant apic base and tpr update from kvm_get_sregs, Marcelo Tosatti, 2011/12/22
- [Qemu-devel] [PATCH 1/5] kvm: x86: Use symbols for all xsave field, Marcelo Tosatti, 2011/12/22
- Re: [Qemu-devel] [PATCH 0/5] [PULL] qemu-kvm.git uq/master queue, Anthony Liguori, 2011/12/27