From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jes Sorensen Subject: Re: KVM PMU virtualization Date: Fri, 26 Feb 2010 12:03:35 +0100 Message-ID: <4B87AA87.1050100@redhat.com> References: <4B86917C.4070102@redhat.com> <4B869ACE.30808@siemens.com> <20100225162631.GA21920@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , KVM General , Peter Zijlstra , Avi Kivity , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com, "Zhang, Yanmin" To: Ingo Molnar Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43652 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934028Ab0BZLED (ORCPT ); Fri, 26 Feb 2010 06:04:03 -0500 In-Reply-To: <20100225162631.GA21920@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On 02/25/10 17:26, Ingo Molnar wrote: >> Given that perf can apply the PMU to individual host tasks, I don't see >> fundamental problems multiplexing it between individual guests (which can >> then internally multiplex it again). > > In terms of how to expose it to guests, a 'soft PMU' might be a usable > approach. Although to Linux guests you could expose much more functionality > and an non-PMU-limited number of instrumentation events, via a more > intelligent interface. > > But note that in terms of handling it on the host side the PMU approach is not > acceptable: instead it should map to proper perf_events, not try to muck with > the PMU itself. I am not keen on emulating the PMU, if we do that we end up having to emulate a large number of MSR accesses, which is really costly. It makes a lot more sense to give the guest direct access to the PMU. The problem here is how to manage it without too much overhead. Cheers, Jes