From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: How to know that vPMU is enabled or disabled? Date: Tue, 24 Jun 2014 22:38:11 +0200 Message-ID: <53A9E1B3.3010405@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Jidong Xiao , KVM Return-path: Received: from mail-wg0-f45.google.com ([74.125.82.45]:49162 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143AbaFXUiR (ORCPT ); Tue, 24 Jun 2014 16:38:17 -0400 Received: by mail-wg0-f45.google.com with SMTP id l18so984793wgh.4 for ; Tue, 24 Jun 2014 13:38:16 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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