From: Ingo Molnar Subject: Re: KVM PMU virtualization Date: Fri, 26 Feb 2010 12:26:38 +0100 Message-ID: <20100226112638.GH7463@elte.hu> References: <4B86917C.4070102@redhat.com> <20100225173423.GB4246@8bytes.org> <20100226084241.GF15885@elte.hu> <4B87987A.2020302@redhat.com> <20100226104437.GB7463@elte.hu> <4B87AD89.60209@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Joerg Roedel , Jes Sorensen , KVM General , Peter Zijlstra , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com, "Zhang, Yanmin" , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" , Arjan van de Ven , Fr??d??ric Weisbecker , Arnaldo Carvalho de Melo To: Avi Kivity Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:42526 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934502Ab0BZL04 (ORCPT ); Fri, 26 Feb 2010 06:26:56 -0500 Content-Disposition: inline In-Reply-To: <4B87AD89.60209@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Avi Kivity wrote: > On 02/26/2010 12:44 PM, Ingo Molnar wrote: > >>>Far cleaner would be to expose it via hypercalls to guest OSs that are > >>>interested in instrumentation. > >>It's also slower - you can give the guest direct access to the various > >>counters so no exits are taken when reading the counters (though perhaps > >>many tools are only interested in the interrupts, not the counter values). > >Direct access to counters is not something that is a big issue. [ Given that i > >sometimes can see KVM redraw the screen of a guest OS real-time i doubt this > >is the biggest of performance challenges right now ;-) ] > > Outside 4-bit vga mode, this shouldn't happen. Can you describe > your scenario? > > >By far the biggest instrumentation issue is: > > > > - availability > > - usability > > - flexibility > > > >Exposing the raw hw is a step backwards in many regards. > > In a way, virtualization as a whole is a step backwards. We take the nice > firesystem/timer/network/scheduler APIs, and expose them as raw hardware. > The pmu isn't any different. Uhm, it's obviously very different. A fake NE2000 will work on both Intel and AMD CPUs. Same for a fake PIT. PMU drivers are fundamentally per CPU vendor though. So there's no "generic hardware" to emulate. Ingo