Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1949036img; Wed, 27 Feb 2019 08:08:53 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaiaqg2tg6lDl9zNKGx8QcEuY0UmR7G2TatJVIcLEhueJd/LcGDBXO8yJJdYASRg5fo4bk5 X-Received: by 2002:a62:11c6:: with SMTP id 67mr2394770pfr.68.1551283733500; Wed, 27 Feb 2019 08:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551283733; cv=none; d=google.com; s=arc-20160816; b=RhIFQ/Cu20F1AhOLn4jcnHHsPwkQYcP02EgyuU2rT3N0S8meAHQ/ORMrs9QL3OJis7 9nDNrYtN4LO1k1/z6GpLTkoRPTBRQFbzSXyyRTe8XA4KKoSSUn4wpSofF6Pt92YcRPgx BXlK1+E+h17tS4nfeQA0/yxPOBy+Z4iTjqt8+atusvtKCHfqjW+1IUGMMRrwxanPC71q TlJU5PVcqwvXG+ltCzUe1M0qfZtb+K0pFVoOQJ+6dJsOCBIHr51ztVgpDp31WQ5iqTXb Y8Z4k7Mc5z8kmt8PyQDTVFyWdmJF1XD+Q3NxQHleXpnf+yEv50bQ7wST5n8l3yovMlqh bZrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=uvGHYMxIf4sd6nDxGN33D/a7UInenAJ6i+A9iK9lQ3g=; b=W1/f3agpBrw/erRGALbBOrIi2jR6TbgEQhloOwGN5nQ4+avv75SAT5gd+PoU0yDv7w Y+qyOXCoksTVsowoOfOp8RntPBwx5lAQfNObH3oy0faCllBfkJOBFnDHybAmW25X1eMW CI98XjW5yHWo8LiBvfxzT2ijLPdv6o9DuGZnNz4g7z8iFJa44sy+HVKt+XQgIgy6wz+N y0oeT+c3SbCCA4759b+ylB6QSffKrnowZE/+Av6WKYFIvZRRzeri0MdomKJMUR+MO9Sg QJ47gzbMAutj0VWWSoyYK/lmGq/zPT1KIq6CSWXEEp8lvX8i1JpoTvsO7NG0ww1dpqsL pUew== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si15773080pld.290.2019.02.27.08.08.38; Wed, 27 Feb 2019 08:08:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730213AbfB0QGc (ORCPT + 99 others); Wed, 27 Feb 2019 11:06:32 -0500 Received: from mga02.intel.com ([134.134.136.20]:24141 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729896AbfB0QFw (ORCPT ); Wed, 27 Feb 2019 11:05:52 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 08:05:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,420,1544515200"; d="scan'208";a="303011701" Received: from unknown (HELO luv-build.sc.intel.com) ([172.25.110.25]) by orsmga005.jf.intel.com with ESMTP; 27 Feb 2019 08:05:50 -0800 From: Ricardo Neri To: Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: Ashok Raj , Andi Kleen , Peter Zijlstra , "Ravi V. Shankar" , x86@kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , Ricardo Neri , "H. Peter Anvin" , Tony Luck , "Rafael J. Wysocki" , Don Zickus , Nicholas Piggin , Michael Ellerman , Frederic Weisbecker , Alexei Starovoitov , Babu Moger , "David S. Miller" , Benjamin Herrenschmidt , Paul Mackerras , Mathieu Desnoyers , Masami Hiramatsu , Andrew Morton , Philippe Ombredanne , Colin Ian King , Byungchul Park , "Paul E. McKenney" , "Luis R. Rodriguez" , Waiman Long , Josh Poimboeuf , Randy Dunlap , Davidlohr Bueso , Christoffer Dall , Marc Zyngier , Kai-Heng Feng , Konrad Rzeszutek Wilk , David Rientjes , sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH v2 09/14] watchdog/hardlockup: Make arch_touch_nmi_watchdog() to hpet-based implementation Date: Wed, 27 Feb 2019 08:05:13 -0800 Message-Id: <1551283518-18922-10-git-send-email-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551283518-18922-1-git-send-email-ricardo.neri-calderon@linux.intel.com> References: <1551283518-18922-1-git-send-email-ricardo.neri-calderon@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CPU architectures that have an NMI watchdog use arch_touch_nmi_watchdog() to briefly ignore the hardlockup detector. If the architecture does not have an NMI watchdog, one can be constructed using a source of non- maskable interrupts. In this case, arch_touch_nmi_watchdog() is common to any underlying hardware resource used to drive the detector and needs to be available to other kernel subsystems if hardware different from perf drives the detector. There exists perf-based and HPET-based implementations. Make it available to the latter. For clarity, wrap this function in a separate preprocessor conditional from functions which are truly specific to the perf-based implementation. Cc: "H. Peter Anvin" Cc: Ashok Raj Cc: Andi Kleen Cc: Tony Luck Cc: "Rafael J. Wysocki" Cc: Don Zickus Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Frederic Weisbecker Cc: Alexei Starovoitov Cc: Babu Moger Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Andrew Morton Cc: Philippe Ombredanne Cc: Colin Ian King Cc: Byungchul Park Cc: "Paul E. McKenney" Cc: "Luis R. Rodriguez" Cc: Waiman Long Cc: Josh Poimboeuf Cc: Randy Dunlap Cc: Davidlohr Bueso Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kai-Heng Feng Cc: Konrad Rzeszutek Wilk Cc: David Rientjes Cc: "Ravi V. Shankar" Cc: x86@kernel.org Cc: sparclinux@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ricardo Neri --- include/linux/nmi.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 5a8b19749769..bf5ebcfdd590 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -94,8 +94,16 @@ static inline void hardlockup_detector_disable(void) {} # define NMI_WATCHDOG_SYSCTL_PERM 0444 #endif -#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) +#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) || \ + defined(CONFIG_X86_HARDLOCKUP_DETECTOR_HPET) extern void arch_touch_nmi_watchdog(void); +#else +# if !defined(CONFIG_HAVE_NMI_WATCHDOG) +static inline void arch_touch_nmi_watchdog(void) {} +# endif +#endif + +#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) extern void hardlockup_detector_perf_stop(void); extern void hardlockup_detector_perf_restart(void); extern void hardlockup_detector_perf_disable(void); -- 2.17.1