From: Ian Campbell Subject: Re: [PATCH 2/4] xen/arm: Implement a dummy Performance Monitor for ARM32 Date: Fri, 13 Jun 2014 13:02:30 +0100 Message-ID: <1402660950.19520.5.camel@kazak.uk.xensource.com> References: <1398379556-1132-1-git-send-email-julien.grall@linaro.org> <1398379556-1132-3-git-send-email-julien.grall@linaro.org> <1399028472.32736.39.camel@kazak.uk.xensource.com> <53639262.2090208@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WvQC7-0003hJ-Un for xen-devel@lists.xenproject.org; Fri, 13 Jun 2014 12:02:56 +0000 In-Reply-To: <53639262.2090208@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-05-02 at 13:41 +0100, Julien Grall wrote: > On 05/02/2014 12:01 PM, Ian Campbell wrote: > > On Thu, 2014-04-24 at 23:45 +0100, Julien Grall wrote: > >> XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance > >> Monitor registers") disable Performance Monitor. > >> > >> When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, regardless the > >> ID_DFR0 (which tell if Perfomance Monitors Extension is implemented) the > >> kernel will try to access to PMCR. > >> > >> Therefore we tell the guest we have 0 counters. Unfortunately we must always > >> support PMCCNTR (the cycle counter): we just RAZ/WI for all PM register, > >> which doesn't crash the kernel at least. > > > > How often does this trap occur in practice? Once at start of day? Only > > if you run perf? Or on every guest context switch? (obviously the last > > one would be bad...) > > There is few calls to the perf registers during the boot (when Linux is > compiled with CONFIG_PERF_EVENTS=y). > > I didn't see any usage during guest context switch. I haven't try perf. Great. Acked-by: Ian Campbell