* How to know that vPMU is enabled or disabled?
@ 2014-06-23 17:41 Jidong Xiao
2014-06-23 17:47 ` Jidong Xiao
2014-06-24 8:33 ` Jidong Xiao
0 siblings, 2 replies; 5+ messages in thread
From: Jidong Xiao @ 2014-06-23 17:41 UTC (permalink / raw)
To: KVM
Hi, All,
I am using a virtual machine in a cloud environment, which means I am
in control of the Guest OS, but have no access to the Host OS. Is
there a simple way to know whether or not the vPMU is enabled or
disabled? Or, is there something I can control so as to turn its state
from enable to disable, or vice versa? Thanks.
-Jidong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to know that vPMU is enabled or disabled?
2014-06-23 17:41 How to know that vPMU is enabled or disabled? Jidong Xiao
@ 2014-06-23 17:47 ` Jidong Xiao
2014-06-24 8:33 ` Jidong Xiao
1 sibling, 0 replies; 5+ messages in thread
From: Jidong Xiao @ 2014-06-23 17:47 UTC (permalink / raw)
To: KVM
On Mon, Jun 23, 2014 at 1:41 PM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
> Hi, All,
>
> I am using a virtual machine in a cloud environment, which means I am
> in control of the Guest OS, but have no access to the Host OS. Is
> there a simple way to know whether or not the vPMU is enabled or
> disabled? Or, is there something I can control so as to turn its state
> from enable to disable, or vice versa? Thanks.
>
> -Jidong
The cloud is using KVM as their hypervisor.
-Jidong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to know that vPMU is enabled or disabled?
2014-06-23 17:41 How to know that vPMU is enabled or disabled? Jidong Xiao
2014-06-23 17:47 ` Jidong Xiao
@ 2014-06-24 8:33 ` Jidong Xiao
2014-06-24 20:38 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Jidong Xiao @ 2014-06-24 8:33 UTC (permalink / raw)
To: KVM
On Mon, Jun 23, 2014 at 1:41 PM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
> Hi, All,
>
> I am using a virtual machine in a cloud environment, which means I am
> in control of the Guest OS, but have no access to the Host OS. Is
> there a simple way to know whether or not the vPMU is enabled or
> disabled? Or, is there something I can control so as to turn its state
> from enable to disable, or vice versa? Thanks.
>
I think I have figured out this. According to this patch (as well as
the Intel SDM manual), it looks like pmu is exposed via the cpuid leaf
0xah.
https://github.com/torvalds/linux/commit/a6c06ed1a60aff77b27ba558c315c3fed4e35565
Therefore, in the guest os, one can run the cpuid instruction with
leaf 0xa, and if vpmu is supported/enabled, the return value in
eax/ebx/ecx/edx should be something non-zero, and in the cloud machine
which I am using I see these registers are all zero, therefore I think
vpmu is not supported in my virtual machine. Probably it is masked by
Qemu.
-Jidong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to know that vPMU is enabled or disabled?
2014-06-24 8:33 ` Jidong Xiao
@ 2014-06-24 20:38 ` Paolo Bonzini
2014-06-25 4:55 ` Jidong Xiao
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2014-06-24 20:38 UTC (permalink / raw)
To: Jidong Xiao, KVM
Il 24/06/2014 10:33, Jidong Xiao ha scritto:
> I think I have figured out this. According to this patch (as well as
> the Intel SDM manual), it looks like pmu is exposed via the cpuid leaf
> 0xah.
>
> https://github.com/torvalds/linux/commit/a6c06ed1a60aff77b27ba558c315c3fed4e35565
>
> Therefore, in the guest os, one can run the cpuid instruction with
> leaf 0xa, and if vpmu is supported/enabled, the return value in
> eax/ebx/ecx/edx should be something non-zero, and in the cloud machine
> which I am using I see these registers are all zero, therefore I think
> vpmu is not supported in my virtual machine. Probably it is masked by
> Qemu.
This is correct. QEMU only enables vPMU if you use "-cpu host".
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to know that vPMU is enabled or disabled?
2014-06-24 20:38 ` Paolo Bonzini
@ 2014-06-25 4:55 ` Jidong Xiao
0 siblings, 0 replies; 5+ messages in thread
From: Jidong Xiao @ 2014-06-25 4:55 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: KVM
On Tue, Jun 24, 2014 at 4:38 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 24/06/2014 10:33, Jidong Xiao ha scritto:
>
>> I think I have figured out this. According to this patch (as well as
>> the Intel SDM manual), it looks like pmu is exposed via the cpuid leaf
>> 0xah.
>>
>>
>> https://github.com/torvalds/linux/commit/a6c06ed1a60aff77b27ba558c315c3fed4e35565
>>
>> Therefore, in the guest os, one can run the cpuid instruction with
>> leaf 0xa, and if vpmu is supported/enabled, the return value in
>> eax/ebx/ecx/edx should be something non-zero, and in the cloud machine
>> which I am using I see these registers are all zero, therefore I think
>> vpmu is not supported in my virtual machine. Probably it is masked by
>> Qemu.
>
>
> This is correct. QEMU only enables vPMU if you use "-cpu host".
>
> Paolo
Thanks Paolo.
-Jidong
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-25 4:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 17:41 How to know that vPMU is enabled or disabled? Jidong Xiao
2014-06-23 17:47 ` Jidong Xiao
2014-06-24 8:33 ` Jidong Xiao
2014-06-24 20:38 ` Paolo Bonzini
2014-06-25 4:55 ` Jidong Xiao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox