From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: PMU in KVM Date: Tue, 26 Nov 2013 11:08:23 +0200 Message-ID: <20131126090823.GG959@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm To: Arthur Chunqi Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55200 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752754Ab3KZJI2 (ORCPT ); Tue, 26 Nov 2013 04:08:28 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Nov 26, 2013 at 04:02:36PM +0800, Arthur Chunqi Li wrote: > Hi Gleb, > > I noticed that arch/x86/kvm/pmu.c is on your management and I have > some questions about PMU in KVM. Thanks ahead if you can spare time > answering these questions. > > 1. How could PMU cooperate with Intel VT? For example, I only find > flags in IA32_PERFEVTSELx MSRs to count in OS and USER mode (Ring 0 > and other rings). What is the consequence when I open VMXON with PMU > enabled? Can I distinguish the counts in root and non-root mode? I > cannot find the related descriptions in Intel manual. > No you cannot. You can disable/enable PMU counters before/after vmexit/vmentry and in this way know in what sate event was counted. That what MPU emulation does. > 2. What is the current status of vPMU in KVM? Is it auto-enabled? And > how can I use (or enable/disable) it? > If you run with -cpu host on Intel machine it will be enabled. -- Gleb.