From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752170AbbEGW5g (ORCPT ); Thu, 7 May 2015 18:57:36 -0400 Received: from mga01.intel.com ([192.55.52.88]:5442 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbbEGW4n (ORCPT ); Thu, 7 May 2015 18:56:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,386,1427785200"; d="scan'208";a="725611295" From: Andi Kleen To: peterz@infradead.org Cc: kan.liang@intel.com, eranian@google.com, acme@infradead.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 7/9] perf, x86: Handle new status bits Date: Thu, 7 May 2015 15:56:30 -0700 Message-Id: <1431039392-12589-8-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1431039392-12589-1-git-send-email-andi@firstfloor.org> References: <1431039392-12589-1-git-send-email-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen ArchPerfmon v4 has some new status bits in GLOBAL_STATUS. These need to be ignored when deciding whether a NMI was a NMI to avoid eating all NMIs when they stay set (see b292d7a104) This patch ignores the new ASIF bit, which indicates that SGX interfered with the PMU, and also the new LBR freezing bits, which are set when the LBRs get frozen. Signed-off-by: Andi Kleen --- arch/x86/kernel/cpu/perf_event_intel.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 39fcd07..2c8a268 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c @@ -1821,13 +1821,14 @@ again: intel_pmu_lbr_read(); /* - * CondChgd bit 63 doesn't mean any overflow status. Ignore - * and clear the bit. + * Ignore a range of extra bits in status that do not indicate + * overflow by themselves. */ - if (__test_and_clear_bit(63, (unsigned long *)&status)) { - if (!status) - goto done; - } + status &= ~(GLOBAL_STATUS_COND_CHG | + GLOBAL_STATUS_ASIF | + GLOBAL_STATUS_LBRS_FROZEN); + if (!status) + goto done; /* * PEBS overflow sets bit 62 in the global status register -- 1.9.3