From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdp3B-0006qV-F0 for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rdp39-0007ES-QY for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:15:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdp39-0007Da-Az for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:15:35 -0500 From: Marcelo Tosatti Date: Thu, 22 Dec 2011 18:13:50 -0200 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 5/5] enable architectural PMU cpuid leaf for kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Gleb Natapov , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Marcelo Tosatti --- 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