Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1170831imu; Tue, 20 Nov 2018 12:55:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSeuTEciwy4XarOzevSoj+ReOsBti58mUsG6KN1Mfv9lXbLsKOy4DjlH5f1kMmVwcVnXCu X-Received: by 2002:a63:6445:: with SMTP id y66mr3436557pgb.250.1542747318195; Tue, 20 Nov 2018 12:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542747318; cv=none; d=google.com; s=arc-20160816; b=jYDguPMGV8FW7JZrbwP3BUjNQ64uVdxd95P1BMsaHEA2MJuc2m3zcuGzbz3Fl5XAFW aZA0AdxfhD3sgKZm3gVV7f6NVCx4+ETK9rHk7xJY9mNoE2F1QR7+DbI+CbnQ/iQKKbrC qkW7gJx39LJmUdirf16io1RrAFYhSni2O2fUodc8zcX1qNRvR+rtEyTHAH55OejC5kGT T4l4HtIl7KIa5Up55lgnCCCrKkdl3WRQoLA8WxkcacdQdZYnw5G0mXxDf/BJamiRyJl0 dMMfESSDeI9uhV+CJHhL+9wTYqsOtMuCGcQeKzGGy1g2ilFLeiJOoCPiSkv32Jhu2Lnc Y4bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=vUuDcghp5MIpPyCjphQKzXqeEA0OYjsLu9tVnO9fJuk=; b=A+x2NcnZMFq/oAjTRomXUN6167s5mneFA9mGdGC6MuUhajfB8UkijTAli4qH0Q9kD5 XC5K042s7rnpa8upTOZyRL2jRJXlufqZvRnyLc8NtbGsLoWHCieJtWDcHtT/iCUpJU9F 9oG8UkFJb2LVToikvGCrFMb9Cup9/+gSyU2IzNLeRHY+EuUBHGV7Ds28dLqCJ+XUaxI4 +bPaxzrq965aBB/3cxZxo1eisVtfRV52DWPpenyLnC5GEQzj7QmBb6BqULoDc5AURjct xMFoS3ic0+zHUZqGrgQNCFKc4S2jawBgfbRNgIO6M6GomLHY3gdXPn19JYfWbWTII4we hyig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8si1103710pfc.248.2018.11.20.12.55.03; Tue, 20 Nov 2018 12:55:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbeKUEbY (ORCPT + 99 others); Tue, 20 Nov 2018 23:31:24 -0500 Received: from terminus.zytor.com ([198.137.202.136]:42167 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeKUEbY (ORCPT ); Tue, 20 Nov 2018 23:31:24 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wAKHxGXr3060315 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Nov 2018 09:59:16 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wAKHxAtE3060293; Tue, 20 Nov 2018 09:59:10 -0800 Date: Tue, 20 Nov 2018 09:59:10 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Peter Zijlstra Message-ID: Cc: alexander.shishkin@linux.intel.com, vincent.weaver@maine.edu, mingo@kernel.org, torvalds@linux-foundation.org, eranian@google.com, linux-kernel@vger.kernel.org, robert@ocallahan.org, kan.liang@linux.intel.com, acme@redhat.com, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, jolsa@redhat.com, me@kylehuey.com Reply-To: hpa@zytor.com, peterz@infradead.org, acme@redhat.com, linux-kernel@vger.kernel.org, robert@ocallahan.org, kan.liang@linux.intel.com, jolsa@redhat.com, me@kylehuey.com, tglx@linutronix.de, torvalds@linux-foundation.org, eranian@google.com, vincent.weaver@maine.edu, alexander.shishkin@linux.intel.com, mingo@kernel.org In-Reply-To: <20181120170842.GZ2131@hirez.programming.kicks-ass.net> References: <20181120170842.GZ2131@hirez.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/x86/intel: Fix regression by default disabling perfmon v4 interrupt handling Git-Commit-ID: 2a5bf23d5b795d5df33dc284e8f5cf8b6a5b4042 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 2a5bf23d5b795d5df33dc284e8f5cf8b6a5b4042 Gitweb: https://git.kernel.org/tip/2a5bf23d5b795d5df33dc284e8f5cf8b6a5b4042 Author: Peter Zijlstra AuthorDate: Tue, 20 Nov 2018 18:08:42 +0100 Committer: Ingo Molnar CommitDate: Tue, 20 Nov 2018 18:57:48 +0100 perf/x86/intel: Fix regression by default disabling perfmon v4 interrupt handling Kyle Huey reported that 'rr', a replay debugger, broke due to the following commit: af3bdb991a5c ("perf/x86/intel: Add a separate Arch Perfmon v4 PMI handler") Rework the 'disable_counter_freezing' __setup() parameter such that we can explicitly enable/disable it and switch to default disabled. To this purpose, rename the parameter to "perf_v4_pmi=" which is a much better description and allows requiring a bool argument. [ mingo: Improved the changelog some more. ] Reported-by: Kyle Huey Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Kan Liang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Robert O'Callahan Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: acme@kernel.org Link: http://lkml.kernel.org/r/20181120170842.GZ2131@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar --- Documentation/admin-guide/kernel-parameters.txt | 3 ++- arch/x86/events/intel/core.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 81d1d5a74728..5463d5a4d85c 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -856,7 +856,8 @@ causing system reset or hang due to sending INIT from AP to BSP. - disable_counter_freezing [HW] + perf_v4_pmi= [X86,INTEL] + Format: Disable Intel PMU counter freezing feature. The feature only exists starting from Arch Perfmon v4 (Skylake and newer). diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 273c62e81546..af8bea9d4006 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -2306,14 +2306,18 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status) return handled; } -static bool disable_counter_freezing; +static bool disable_counter_freezing = true; static int __init intel_perf_counter_freezing_setup(char *s) { - disable_counter_freezing = true; - pr_info("Intel PMU Counter freezing feature disabled\n"); + bool res; + + if (kstrtobool(s, &res)) + return -EINVAL; + + disable_counter_freezing = !res; return 1; } -__setup("disable_counter_freezing", intel_perf_counter_freezing_setup); +__setup("perf_v4_pmi=", intel_perf_counter_freezing_setup); /* * Simplified handler for Arch Perfmon v4: