Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp314566pxa; Wed, 19 Aug 2020 01:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7HuwfhHqopa/fRi5xkW6MquVfOaFi7kzrB3Eo1e196+b9saip9KiVlZTYMyR0nHh8w+pz X-Received: by 2002:aa7:dd15:: with SMTP id i21mr23775462edv.153.1597827452029; Wed, 19 Aug 2020 01:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597827452; cv=none; d=google.com; s=arc-20160816; b=gm1PMe8RcvPmy8ujVLdw3Oz9OdlGj6A/Ef0t8n/ma+3maD9xmKJDCUvNV2I9ZT+qOn FL5Mz3uxmXD/8n0BmHcfXMSCAQT+thNOWtxtL82KmrW8Tbv/AkJxVbSdMxAoPiytcNw8 CU4O/wLwbLl32ev7RvKG1RI/hjeQ2C6gfFZA+5GY2A+b3MPlxMB+IBBmq0shLv3ngNem MYXnaUodBtmENtw8qCkN7we+9cHdBSgevd/rT3IlkoFVtoQRYkenvH5Qre1df16fWHYv NJZHM6XkRmwi9dt2OdKWBqQH7BAiQCz9RVXI+UH/QERTbVzLkYTt0VZ+I2m6qA5djIEJ Nf3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=yDhTYGjcq4hRoNjkXO7m3LqBsirHwTeENnCZjBg6PJM=; b=ma5sEuT2Gx4zR7T00m0mwUhI15X3HxvjD1ewY1aQm4z90fR410SsLentTUdgvRRR7z 13rxpBhnIWDGeKWiEAGliE40rFXyG1b25rI11UAYNVQI/Reh3yUwCP4WKq2DTD4NLHa6 qGm80yCowBW6tLSmuxbOFE9En+ZmkF7T9xtPtwTxCheyXK5/cSfYAs6o3qoNJNY7JXqr EjHinAeNvbLWu0Ar3s7RZSdg61tTg2uPzWxvIwKVenmbuAi8c8oeZhJmWSh4DMPcd8x5 6nofme1i5gn+5js9V4QV8C+mCm2qRNz1FCSZV+6tKaBL3PYuuA2QcFxcpj0o0nExz4Ac EkpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=rzGMCDTZ; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si15130274eja.210.2020.08.19.01.57.08; Wed, 19 Aug 2020 01:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=rzGMCDTZ; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgHSIy1 (ORCPT + 99 others); Wed, 19 Aug 2020 04:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbgHSIwJ (ORCPT ); Wed, 19 Aug 2020 04:52:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78770C061343; Wed, 19 Aug 2020 01:52:08 -0700 (PDT) Date: Wed, 19 Aug 2020 08:52:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597827126; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yDhTYGjcq4hRoNjkXO7m3LqBsirHwTeENnCZjBg6PJM=; b=rzGMCDTZHriZ0ClfBtf5zXZYM2lvj7TORbrBEupYGKTnk7DGF1S7Vy9nilYhPndEBKowSd PLsaiLovRJLQPuEPpQCosw2IX3VBAeVibei4q0fdL8XIItpo+6tZT8GOIeXUZdjsnZPa/D +BBRmkeiSjJEO6KA5+9l3uMKtsHhh9sskKfzoj3EGOR1i23JeVGen9SAw5urniCgS6fCg2 Vh2nso/yf4zy5NY23aFlMIDciL/Y1vJBua9xPeXHUW5VnKPcct40GxLRQ6vAy7mLQZl0Vy OAgIMtRHpfxrsGeGkdoifIgHxRDJ5D+vYfSR2H4K4DrqJ3LrMVFC0HY3DuX3sQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597827126; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yDhTYGjcq4hRoNjkXO7m3LqBsirHwTeENnCZjBg6PJM=; b=DIXLXeyUUUqpXrHZRxoUWeu4777+i3mZ8GMoaZLAWSV7R6rwgzQl/gAPrUYtLt5Wv0jh0d PCnysNUNsHLQcQAQ== From: "tip-bot2 for Kan Liang" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86: Add a macro for RDPMC offset of fixed counters Cc: Kan Liang , "Peter Zijlstra (Intel)" , x86 , LKML In-Reply-To: <20200723171117.9918-10-kan.liang@linux.intel.com> References: <20200723171117.9918-10-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <159782712634.3192.7845292859376351543.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 0e2e45e2ded4988f5641115fd996c75dc32e4be3 Gitweb: https://git.kernel.org/tip/0e2e45e2ded4988f5641115fd996c75dc32e4be3 Author: Kan Liang AuthorDate: Thu, 23 Jul 2020 10:11:12 -07:00 Committer: Peter Zijlstra CommitterDate: Tue, 18 Aug 2020 16:34:36 +02:00 perf/x86: Add a macro for RDPMC offset of fixed counters The RDPMC base offset of fixed counters is hard-code. Use a meaningful name to replace the magic number to improve the readability of the code. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200723171117.9918-10-kan.liang@linux.intel.com --- arch/x86/events/core.c | 3 ++- arch/x86/include/asm/perf_event.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 53fcf0a..ebf723f 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1151,7 +1151,8 @@ static inline void x86_assign_hw_event(struct perf_event *event, hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL; hwc->event_base = MSR_ARCH_PERFMON_FIXED_CTR0 + (idx - INTEL_PMC_IDX_FIXED); - hwc->event_base_rdpmc = (idx - INTEL_PMC_IDX_FIXED) | 1<<30; + hwc->event_base_rdpmc = (idx - INTEL_PMC_IDX_FIXED) | + INTEL_PMC_FIXED_RDPMC_BASE; break; default: diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h index 000cab7..964ba31 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h @@ -196,6 +196,9 @@ struct x86_pmu_capability { * Fixed-purpose performance events: */ +/* RDPMC offset for Fixed PMCs */ +#define INTEL_PMC_FIXED_RDPMC_BASE (1 << 30) + /* * All the fixed-mode PMCs are configured via this single MSR: */