From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: KVM PMU virtualization Date: Mon, 1 Mar 2010 19:36:41 +0100 Message-ID: <20100301183641.GF19879@8bytes.org> References: <4B87AF44.9090702@redhat.com> <20100226114217.GI7463@elte.hu> <4B87C354.9020209@redhat.com> <20100226130656.GA2518@elte.hu> <4B87CCF5.6000209@redhat.com> <20100226134400.GB23422@elte.hu> <20100228161142.GA19879@8bytes.org> <20100301084450.GF19395@elte.hu> <20100301111108.GE19879@8bytes.org> <1267463860.1579.25.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ingo Molnar , Avi Kivity , Jes Sorensen , KVM General , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com, "Zhang, Yanmin" , Thomas Gleixner , "H. Peter Anvin" , Arjan van de Ven , Fr??d??ric Weisbecker , Arnaldo Carvalho de Melo To: Peter Zijlstra Return-path: Received: from 8bytes.org ([88.198.83.132]:57955 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087Ab0CASgm (ORCPT ); Mon, 1 Mar 2010 13:36:42 -0500 Content-Disposition: inline In-Reply-To: <1267463860.1579.25.camel@laptop> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Mar 01, 2010 at 06:17:40PM +0100, Peter Zijlstra wrote: > On Mon, 2010-03-01 at 12:11 +0100, Joerg Roedel wrote: > > > > 1. Enhance perf to count pmu events only when cpu is in guest mode. > > No enhancements needed, only hardware support for Intel doesn't provide > this iirc. At least the guest-bit for AMD perfctl registers is not supported yet ;-) Implementing this eliminates the requirement to write the perfctl msrs on every vmrun and every vmexit. But thats a minor change. > > 4. Some additional magic to reinject pmu events into the guest > > Right, that is needed, and might be 'interesting' since we get them from > NMI context. I imagine some kind of callback which sets a flag in the kvm vcpu structure. Since the NMI already triggered a vmexit the kvm code checks for this bit on its path to re-entry. Joerg