From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 2/4] xen/arm: Implement a dummy Performance Monitor for ARM32 Date: Fri, 02 May 2014 13:41:06 +0100 Message-ID: <53639262.2090208@linaro.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WgCm6-0000tm-Ai for xen-devel@lists.xenproject.org; Fri, 02 May 2014 12:41:26 +0000 Received: by mail-ee0-f46.google.com with SMTP id d49so394523eek.19 for ; Fri, 02 May 2014 05:41:08 -0700 (PDT) In-Reply-To: <1399028472.32736.39.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org 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. Regards, -- Julien Grall