* [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm
@ 2011-12-15 10:44 Gleb Natapov
2011-12-15 15:09 ` Anthony Liguori
0 siblings, 1 reply; 3+ messages in thread
From: Gleb Natapov @ 2011-12-15 10:44 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Gleb Natapov <gleb@redhat.com>
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.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm
2011-12-15 10:44 [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm Gleb Natapov
@ 2011-12-15 15:09 ` Anthony Liguori
2011-12-15 15:13 ` Gleb Natapov
0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2011-12-15 15:09 UTC (permalink / raw)
To: Gleb Natapov; +Cc: qemu-devel
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.
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm
2011-12-15 15:09 ` Anthony Liguori
@ 2011-12-15 15:13 ` Gleb Natapov
0 siblings, 0 replies; 3+ messages in thread
From: Gleb Natapov @ 2011-12-15 15:13 UTC (permalink / raw)
To: Anthony Liguori; +Cc: mtosatti, qemu-devel, avi
On Thu, Dec 15, 2011 at 09:09:32AM -0600, Anthony Liguori wrote:
> 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.
uq/master maintainers can you take it?
>
> 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.
> >
> >
--
Gleb.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-15 15:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 10:44 [Qemu-devel] [PATCH] enable architectural PMU cpuid leaf for kvm Gleb Natapov
2011-12-15 15:09 ` Anthony Liguori
2011-12-15 15:13 ` Gleb Natapov
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).