From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbCwE-0003iM-KA for qemu-devel@nongnu.org; Thu, 15 Dec 2011 10:09:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbCwD-0001j6-JR for qemu-devel@nongnu.org; Thu, 15 Dec 2011 10:09:38 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:51477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbCwD-0001iz-Bj for qemu-devel@nongnu.org; Thu, 15 Dec 2011 10:09:37 -0500 Received: by ghbg19 with SMTP id g19so1873398ghb.4 for ; Thu, 15 Dec 2011 07:09:37 -0800 (PST) Message-ID: <4EEA0DAC.3090209@codemonkey.ws> Date: Thu, 15 Dec 2011 09:09:32 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <20111215104405.GD21664@redhat.com> In-Reply-To: <20111215104405.GD21664@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On 12/15/2011 04:44 AM, Gleb Natapov wrote: > > Signed-off-by: Gleb Natapov This should go in via uq/master. Regards, Anthony Liguori > 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 */ > -- > Gleb. > >