From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbdINKqv (ORCPT ); Thu, 14 Sep 2017 06:46:51 -0400 Received: from terminus.zytor.com ([65.50.211.136]:49461 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbdINKqs (ORCPT ); Thu, 14 Sep 2017 06:46:48 -0400 Date: Thu, 14 Sep 2017 03:40:23 -0700 From: tip-bot for Peter Zijlstra Message-ID: Cc: peterz@infradead.org, uobergfe@redhat.com, cmetcalf@mellanox.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, tglx@linutronix.de, dzickus@redhat.com, bigeasy@linutronix.de, bp@alien8.de, hpa@zytor.com Reply-To: hpa@zytor.com, bigeasy@linutronix.de, bp@alien8.de, dzickus@redhat.com, npiggin@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, cmetcalf@mellanox.com, uobergfe@redhat.com, peterz@infradead.org In-Reply-To: <20170912194146.247141871@linutronix.de> References: <20170912194146.247141871@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] perf/x86/intel, watchdog/core: Sanitize PMU HT bug workaround Git-Commit-ID: 2406e3b166eee42777a6b0b38f52f924454474d7 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: 2406e3b166eee42777a6b0b38f52f924454474d7 Gitweb: http://git.kernel.org/tip/2406e3b166eee42777a6b0b38f52f924454474d7 Author: Peter Zijlstra AuthorDate: Tue, 12 Sep 2017 21:36:56 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:03 +0200 perf/x86/intel, watchdog/core: Sanitize PMU HT bug workaround The lockup_detector_suspend/resume() interface is broken in several ways especially as it results in recursive locking of the CPU hotplug lock. Use the new stop/restart interface in the perf NMI watchdog to temporarily disable and reenable the already active watchdog events. That's enough to handle it. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Reviewed-by: Don Zickus Cc: Andrew Morton Cc: Borislav Petkov Cc: Chris Metcalf Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Sebastian Siewior Cc: Ulrich Obergfell Link: http://lkml.kernel.org/r/20170912194146.247141871@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/events/intel/core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 829e89c..9fb9a1f 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4409,10 +4409,9 @@ static __init int fixup_ht_bug(void) return 0; } - if (lockup_detector_suspend() != 0) { - pr_debug("failed to disable PMU erratum BJ122, BV98, HSD29 workaround\n"); - return 0; - } + cpus_read_lock(); + + hardlockup_detector_perf_stop(); x86_pmu.flags &= ~(PMU_FL_EXCL_CNTRS | PMU_FL_EXCL_ENABLED); @@ -4420,9 +4419,7 @@ static __init int fixup_ht_bug(void) x86_pmu.commit_scheduling = NULL; x86_pmu.stop_scheduling = NULL; - lockup_detector_resume(); - - cpus_read_lock(); + hardlockup_detector_perf_restart(); for_each_online_cpu(c) free_excl_cntrs(c);