From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: KVM PMU virtualization Date: Mon, 1 Mar 2010 09:39:04 +0100 Message-ID: <20100301083904.GE19395@elte.hu> References: <20100226084241.GF15885@elte.hu> <4B87987A.2020302@redhat.com> <20100226104437.GB7463@elte.hu> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , 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: Joerg Roedel Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:34294 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063Ab0CAIji (ORCPT ); Mon, 1 Mar 2010 03:39:38 -0500 Content-Disposition: inline In-Reply-To: <20100228161142.GA19879@8bytes.org> Sender: kvm-owner@vger.kernel.org List-ID: * Joerg Roedel wrote: > > - It's more secure: the host can have a finegrained policy about what kinds of > > events it exposes to the guest. It might chose to only expose software > > events for example. > > What do you mean by software events? Things like: aldebaran:~> perf stat -a sleep 1 Performance counter stats for 'sleep 1': 15995.719133 task-clock-msecs # 15.981 CPUs 5787 context-switches # 0.000 M/sec 210 CPU-migrations # 0.000 M/sec 193909 page-faults # 0.012 M/sec 28704833507 cycles # 1794.532 M/sec (scaled from 78.69%) 14387445668 instructions # 0.501 IPC (scaled from 90.71%) 736644616 branches # 46.053 M/sec (scaled from 90.52%) 695884659 branch-misses # 94.467 % (scaled from 90.70%) 727070678 cache-references # 45.454 M/sec (scaled from 88.11%) 1305560420 cache-misses # 81.619 M/sec (scaled from 52.00%) 1.000942399 seconds time elapsed These lines: 15995.719133 task-clock-msecs # 15.981 CPUs 5787 context-switches # 0.000 M/sec 210 CPU-migrations # 0.000 M/sec 193909 page-faults # 0.012 M/sec Are software events of the host - a subset of which could be transparently exposed to the guest. Same for tracepoints, probes, etc. Those are not exposed by the hardware PMU. So by doing a 'soft' PMU (or even better: a paravirt channel to perf events) we gain a lot more than just raw PMU functionality. 'performance events' are about a lot more than just the PMU, it's a coherent system health / system events / structured logging framework. Ingo