Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759495Ab2JSQqh (ORCPT ); Fri, 19 Oct 2012 12:46:37 -0400 Received: from casper.infradead.org ([85.118.1.10]:51961 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758293Ab2JSQqg convert rfc822-to-8bit (ORCPT ); Fri, 19 Oct 2012 12:46:36 -0400 Message-ID: <1350665152.2768.41.camel@twins> Subject: Re: [PATCH 2/2] perf: SNB exclusive PMU access for INST_RETIRED:PREC_DIST From: Peter Zijlstra To: Stephane Eranian Cc: LKML , "mingo@elte.hu" , "ak@linux.intel.com" , Arnaldo Carvalho de Melo , Jiri Olsa Date: Fri, 19 Oct 2012 18:45:52 +0200 In-Reply-To: References: <1350658326-14715-1-git-send-email-eranian@google.com> <1350658326-14715-3-git-send-email-eranian@google.com> <1350664077.2768.32.camel@twins> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 25 On Fri, 2012-10-19 at 18:31 +0200, Stephane Eranian wrote: > On Fri, Oct 19, 2012 at 6:27 PM, Peter Zijlstra wrote: > > On Fri, 2012-10-19 at 16:52 +0200, Stephane Eranian wrote: > >> +static int intel_pebs_aliases_snb(struct perf_event *event) > >> +{ > >> + u64 cfg = event->hw.config; > >> + /* > >> + * for INST_RETIRED.PREC_DIST to work correctly with PEBS, it must > >> + * be measured alone on SNB (exclusive PMU access) as per Intel SDM. > >> + */ > >> + if ((cfg & INTEL_ARCH_EVENT_MASK) == 0x01c0 && !event->attr.exclusive) { > >> + pr_info("perf: INST_RETIRED.PREC_DIST only works in exclusive mode\n"); > >> + return -EINVAL; > > > > This isn't limited to admin, right? So the above turns into a DoS on the > > console. > > > Ok, so how about a WARN_ON_ONCE() instead? That should be fine I guess ;-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/