Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757499Ab2JQRCg (ORCPT ); Wed, 17 Oct 2012 13:02:36 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:41195 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756475Ab2JQRCf (ORCPT ); Wed, 17 Oct 2012 13:02:35 -0400 Date: Wed, 17 Oct 2012 13:03:21 -0400 (EDT) From: Vince Weaver To: linux-kernel@vger.kernel.org cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , eranian@gmail.com, "Meadows, Lawrence F" Subject: [PATCH 1/3] Make KNC use full 40-bit width of counters In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1532 Lines: 37 Early versions of KNC chips have a bug where bits above 32 were not properly set. We worked around this by only using the bottom 32 bits (out of 40 that should be available). It turns out this workaround breaks overflow handling. The buggy silicon will in theory never be used in production systems, so remove this workaround so we get proper overflow support. Signed-off-by: Vince Weaver diff -ur linux-3.7-rc1.orig/arch/x86/kernel/cpu/perf_event_knc.c linux-3.7-rc1/arch/x86/kernel/cpu/perf_event_knc.c --- linux-3.7-rc1.orig/arch/x86/kernel/cpu/perf_event_knc.c 2012-10-14 17:41:04.000000000 -0400 +++ linux-3.7-rc1/arch/x86/kernel/cpu/perf_event_knc.c 2012-10-17 11:50:08.688394147 -0400 @@ -226,12 +226,11 @@ .event_map = knc_pmu_event_map, .max_events = ARRAY_SIZE(knc_perfmon_event_map), .apic = 1, - .max_period = (1ULL << 31) - 1, + .max_period = (1ULL << 39) - 1, .version = 0, .num_counters = 2, - /* in theory 40 bits, early silicon is buggy though */ - .cntval_bits = 32, - .cntval_mask = (1ULL << 32) - 1, + .cntval_bits = 40, + .cntval_mask = (1ULL << 40) - 1, .get_event_constraints = x86_get_event_constraints, .event_constraints = knc_event_constraints, .format_attrs = intel_knc_formats_attr, -- 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/