From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbcHLI3U (ORCPT ); Fri, 12 Aug 2016 04:29:20 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52624 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbcHLI2T (ORCPT ); Fri, 12 Aug 2016 04:28:19 -0400 Date: Fri, 12 Aug 2016 01:27:48 -0700 From: tip-bot for Kan Liang Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, mingo@kernel.org, alexander.shishkin@linux.intel.com, lukasz.odzioba@intel.com, kan.liang@intel.com, stable@vger.kernel.org, vincent.weaver@maine.edu, eranian@google.com, peterz@infradead.org, torvalds@linux-foundation.org, jolsa@redhat.com, hpa@zytor.com Reply-To: jolsa@redhat.com, hpa@zytor.com, peterz@infradead.org, torvalds@linux-foundation.org, eranian@google.com, stable@vger.kernel.org, vincent.weaver@maine.edu, lukasz.odzioba@intel.com, kan.liang@intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, mingo@kernel.org, alexander.shishkin@linux.intel.com In-Reply-To: <1470925820-59847-1-git-send-email-kan.liang@intel.com> References: <1470925820-59847-1-git-send-email-kan.liang@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/x86/intel/uncore: Fix uncore num_counters Git-Commit-ID: 10e9e7bd598f9a66a11a22514c68c13c41fc821b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 10e9e7bd598f9a66a11a22514c68c13c41fc821b Gitweb: http://git.kernel.org/tip/10e9e7bd598f9a66a11a22514c68c13c41fc821b Author: Kan Liang AuthorDate: Thu, 11 Aug 2016 07:30:20 -0700 Committer: Ingo Molnar CommitDate: Fri, 12 Aug 2016 08:35:04 +0200 perf/x86/intel/uncore: Fix uncore num_counters Some uncore boxes' num_counters value for Haswell server and Broadwell server are not correct (too large, off by one). This issue was found by comparing the code with the document. Although there is no bug report from users yet, accessing non-existent counters is dangerous and the behavior is undefined: it may cause miscounting or even crashes. This patch makes them consistent with the uncore document. Reported-by: Lukasz Odzioba Signed-off-by: Kan Liang Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: Link: http://lkml.kernel.org/r/1470925820-59847-1-git-send-email-kan.liang@intel.com Signed-off-by: Ingo Molnar --- arch/x86/events/intel/uncore_snbep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 824e540..8aee83b 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -2626,7 +2626,7 @@ void hswep_uncore_cpu_init(void) static struct intel_uncore_type hswep_uncore_ha = { .name = "ha", - .num_counters = 5, + .num_counters = 4, .num_boxes = 2, .perf_ctr_bits = 48, SNBEP_UNCORE_PCI_COMMON_INIT(), @@ -2645,7 +2645,7 @@ static struct uncore_event_desc hswep_uncore_imc_events[] = { static struct intel_uncore_type hswep_uncore_imc = { .name = "imc", - .num_counters = 5, + .num_counters = 4, .num_boxes = 8, .perf_ctr_bits = 48, .fixed_ctr_bits = 48, @@ -2691,7 +2691,7 @@ static struct intel_uncore_type hswep_uncore_irp = { static struct intel_uncore_type hswep_uncore_qpi = { .name = "qpi", - .num_counters = 5, + .num_counters = 4, .num_boxes = 3, .perf_ctr_bits = 48, .perf_ctr = SNBEP_PCI_PMON_CTR0, @@ -2773,7 +2773,7 @@ static struct event_constraint hswep_uncore_r3qpi_constraints[] = { static struct intel_uncore_type hswep_uncore_r3qpi = { .name = "r3qpi", - .num_counters = 4, + .num_counters = 3, .num_boxes = 3, .perf_ctr_bits = 44, .constraints = hswep_uncore_r3qpi_constraints, @@ -2972,7 +2972,7 @@ static struct intel_uncore_type bdx_uncore_ha = { static struct intel_uncore_type bdx_uncore_imc = { .name = "imc", - .num_counters = 5, + .num_counters = 4, .num_boxes = 8, .perf_ctr_bits = 48, .fixed_ctr_bits = 48,