From: Anthony Liguori <anthony@codemonkey.ws>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm
Date: Thu, 15 Dec 2011 09:09:32 -0600 [thread overview]
Message-ID: <4EEA0DAC.3090209@codemonkey.ws> (raw)
In-Reply-To: <20111215104405.GD21664@redhat.com>
On 12/15/2011 04:44 AM, Gleb Natapov wrote:
>
> Signed-off-by: Gleb Natapov<gleb@redhat.com>
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.
>
>
next prev parent reply other threads:[~2011-12-15 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 10:44 [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm Gleb Natapov
2011-12-15 15:09 ` Anthony Liguori [this message]
2011-12-15 15:13 ` Gleb Natapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EEA0DAC.3090209@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=gleb@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).