From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jes Sorensen Subject: Re: KVM PMU virtualization Date: Fri, 26 Feb 2010 14:13:16 +0100 Message-ID: <4B87C8EC.8080304@redhat.com> References: <4B86917C.4070102@redhat.com> <20100225173423.GB4246@8bytes.org> <20100226084241.GF15885@elte.hu> <4B87987A.2020302@redhat.com> <20100226104437.GB7463@elte.hu> <4B87AF44.9090702@redhat.com> <20100226114217.GI7463@elte.hu> <4B87B5DE.30503@redhat.com> <20100226120750.GA11578@elte.hu> <4B87BC74.7050207@redhat.com> <20100226123850.GA19476@elte.hu> <4B87C6C4.3040407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Ingo Molnar , Joerg Roedel , 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 mx1.redhat.com ([209.132.183.28]:25981 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936095Ab0BZNOG (ORCPT ); Fri, 26 Feb 2010 08:14:06 -0500 In-Reply-To: <4B87C6C4.3040407@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/26/10 14:04, Avi Kivity wrote: > On 02/26/2010 02:38 PM, Ingo Molnar wrote: >> Yes, something like Core2 with 2 generic events. >> >> That would leave 2 extra generic events on Nehalem and better. (which is >> really the target CPU type for any new feature we are talking about >> right now. >> Plus performance analysis tends to skew towards more modern CPU types as >> well.) > > Can you emulate the Core 2 pmu on, say, a P4? Those P4s have very > different instruction caches so I imagine the events are very different > as well. > > Agree about favouring modern processors. You certainly cannot emulate the Core2 on a P4. The Core2 is Perfmon v2, whereas Nehalem and Atom are v3 if I remember correctly. I am not even 100% sure a v3 is capable of emulating a v2, though I expect v3 to have bigger counters then v2, but I don't think that is guaranteed. I can only handle so many hours of reading Intel manuals per day, before I end up in a padded cell, so I could be wrong on some of this. >> Plus the emulation can be smart about it and only use up a given >> number. Most >> guest OSs dont use the full PMU - they use a single counter. > > But you have to expose all of the counters, no? Unless you go with a > kvm-specific pmu as described below. You have to, at least all the fixed ones (3 on Core2) and the two arch ones. Thats the minimum and any guest being told it's running on a Core2 will expect to find those. Cheers, Jes