Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757814AbcCCVnO (ORCPT ); Thu, 3 Mar 2016 16:43:14 -0500 Received: from mga03.intel.com ([134.134.136.65]:55907 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752787AbcCCVnN (ORCPT ); Thu, 3 Mar 2016 16:43:13 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,533,1449561600"; d="scan'208";a="757708157" Date: Thu, 3 Mar 2016 13:43:12 -0800 From: Andi Kleen To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, acme@redhat.com, peterz@infradead.org, mingo@elte.hu, kan.liang@intel.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com Subject: Re: [PATCH 2/3] perf/x86/pebs: add workaround for broken OVFL status on HSW Message-ID: <20160303214312.GI23621@tassilo.jf.intel.com> References: <1457034642-21837-1-git-send-email-eranian@google.com> <1457034642-21837-3-git-send-email-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457034642-21837-3-git-send-email-eranian@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 787 Lines: 20 > + /* > + * There are cases where, even though, the PEBS ovfl bit is set in > + * GLOBAL_OVF_STATUS, the PEBS events may also have their overflow bits > + * set for their counters. We must clear them here because they have > + * been processed as exact samples in the drain_pebs() routine. They > + * must not be processed again in the for_each_bit_set() loop for > + * regular samples below. > + */ > + status &= ~cpuc->pebs_enabled; > + status &= x86_pmu.intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI; If you just clear the bits here they will not be acked and stay around forever in GLOBAL_STATUS, which causes other problems. You need a separate ack_status variable that contains all bits and is always acked. -Andi -- ak@linux.intel.com -- Speaking for myself only