Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp630947imm; Thu, 6 Sep 2018 07:49:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYKGoTcRcBj8HFIIX3JIz/yKDS4XPCp9xnDn3zxGTI2SunK071bYX3MVdfu9j7A/5zojTcE X-Received: by 2002:a63:ba1c:: with SMTP id k28-v6mr3087655pgf.76.1536245394667; Thu, 06 Sep 2018 07:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536245394; cv=none; d=google.com; s=arc-20160816; b=Nh9i4LXOWUsCGFez/Y2JCUQ7JYEbNGVu/oRzhNdZuQhQ6p75iqvXx9F9b5L5NbS3qC 2Zo1NePAfzfEK3XXTtOilry6CuMfe3h5balo40sg7NeRl5gSolQPE5SUwFUFMNr6aJmB rto2pPOy0rpAjbR4JNwKtskrUDSESWMilECVyMs9ZWdpNTf6xgVIYZ7DjM1Bkhhe2llT 55zJ9GhMThXRYh/V012G5/9RMI/lGbGLWWD+ojSAmHYNC5iOEgL7Jbm2iVJl+ZOjiLcs EoW3BauxJD0OgnU6ej+8V7Cm+0rQhJGb68WQr6gBSuIERSm3pxeJhUkS6DnQS/lmav+G h/bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W/ss8ssgpE7WXWaH2yTlb156wPiBdu0VdxFunSPagrU=; b=B2B8aR/HXjuz2PfctqJwIW2bqoXTnBKG9jiJVz31Bu3WIEMFvQwX4+oCKUilJOKWCg jeuRwqf8f+2Jgv7Skhc4Io0Byl/VQGgLGVX1fb68pqTRMPgO0KlrqCf0RHazNMSyccxK nVFEAt02LF2IUAZZ+FDTAjqg8crtua/zw2H73/h5TD6mAFWTnAdcRVAh+tCr1MGHA+YE udiX+A+YhRRA/breykpp3RzHq8GwSTAoA/Qid4FgJq3Qd8D6/IESAA+s9xqCMS2sQUNP 8vuZ9RyDzjNrgi7WGpyfyWuv9hkQFQhdAYLllqE8E7lwNfcNuv+MwIqRFUDaRJDWLTW+ BLFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jjGHxc8e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si5466328pfh.64.2018.09.06.07.49.38; Thu, 06 Sep 2018 07:49:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jjGHxc8e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730169AbeIFTXs (ORCPT + 99 others); Thu, 6 Sep 2018 15:23:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56456 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729840AbeIFTXs (ORCPT ); Thu, 6 Sep 2018 15:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=W/ss8ssgpE7WXWaH2yTlb156wPiBdu0VdxFunSPagrU=; b=jjGHxc8ehQ6epmQBpL4zO0f6p mqw0zvPcTXcoPjDIqSj3shGEH+tthlBZ7gkdPE+AqPbO9i/1erq0i3t9Yg8Pzp7Y2n8I/pOkTGMBQ 0NvZyPLugc2F+TZVWPl50pLoIyJjHvF3l3wfHCWT2XfhVZE/joZqlHDivXPQxKgXXp/xSKuVNuCra CNC2TsB3DmrwMs3UeBhX/XiKHzP6wbOF8ouzEAmHt1VXPm8gzPPXWAu5GrnnVhqq03pBTZVgtWA3r SwW/MOX4wI8UdenWi5T9NYXnBbxvolIQ8s+KRtM6YM+SAfAFmuaYbF9EQVQctBvF6KeCDfT1LJMlx X7MzEvUMg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxvZZ-0008H4-Db; Thu, 06 Sep 2018 14:47:53 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C3E1F2018BF7D; Thu, 6 Sep 2018 16:47:51 +0200 (CEST) Date: Thu, 6 Sep 2018 16:47:51 +0200 From: Peter Zijlstra To: Reinette Chatre Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, mingo@redhat.com, acme@kernel.org, vikas.shivappa@linux.intel.com, gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 4/6] x86/intel_rdt: Add helper to obtain performance counter index Message-ID: <20180906144751.GH24106@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 16, 2018 at 01:16:07PM -0700, Reinette Chatre wrote: > +static inline int x86_perf_rdpmc_ctr_get(struct perf_event *event) > +{ > + lockdep_assert_irqs_disabled(); > + > + return IS_ERR_OR_NULL(event) ? -1 : event->hw.event_base_rdpmc; > +} That should be in arch/x86/include/asm/perf_event.h if anywhere. Also, call the thing x86_perf_rdpmc_index(), that's consistent with the other naming. I don't think there's any point in testing for !event, this is an interface that mandates you know wth you're doing anyway.