The quilt patch titled Subject: watchdog/perf: add a weak function for an arch to detect if perf can use NMIs has been removed from the -mm tree. Its filename was watchdog-perf-add-a-weak-function-for-an-arch-to-detect-if-perf-can-use-nmis.patch This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Douglas Anderson <dianders@xxxxxxxxxxxx> Subject: watchdog/perf: add a weak function for an arch to detect if perf can use NMIs Date: Fri, 19 May 2023 10:18:39 -0700 On arm64, NMI support needs to be detected at runtime. Add a weak function to the perf hardlockup detector so that an architecture can implement it to detect whether NMIs are available. Link: https://lkml.kernel.org/r/20230519101840.v5.15.Ic55cb6f90ef5967d8aaa2b503a4e67c753f64d3a@changeid Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Chen-Yu Tsai <wens@xxxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Cc: Colin Cross <ccross@xxxxxxxxxxx> Cc: Daniel Thompson <daniel.thompson@xxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> Cc: Guenter Roeck <groeck@xxxxxxxxxxxx> Cc: Ian Rogers <irogers@xxxxxxxxxx> Cc: Lecopzer Chen <lecopzer.chen@xxxxxxxxxxxx> Cc: Marc Zyngier <maz@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Masayoshi Mizuma <msys.mizuma@xxxxxxxxx> Cc: Matthias Kaehlcke <mka@xxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Nicholas Piggin <npiggin@xxxxxxxxx> Cc: Petr Mladek <pmladek@xxxxxxxx> Cc: Pingfan Liu <kernelfans@xxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: "Ravi V. Shankar" <ravi.v.shankar@xxxxxxxxx> Cc: Ricardo Neri <ricardo.neri@xxxxxxxxx> Cc: Stephane Eranian <eranian@xxxxxxxxxx> Cc: Stephen Boyd <swboyd@xxxxxxxxxxxx> Cc: Sumit Garg <sumit.garg@xxxxxxxxxx> Cc: Tzung-Bi Shih <tzungbi@xxxxxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/nmi.h | 1 + kernel/watchdog_perf.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) --- a/include/linux/nmi.h~watchdog-perf-add-a-weak-function-for-an-arch-to-detect-if-perf-can-use-nmis +++ a/include/linux/nmi.h @@ -208,6 +208,7 @@ static inline bool trigger_single_cpu_ba #ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF u64 hw_nmi_get_sample_period(int watchdog_thresh); +bool arch_perf_nmi_is_available(void); #endif #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP) && \ --- a/kernel/watchdog_perf.c~watchdog-perf-add-a-weak-function-for-an-arch-to-detect-if-perf-can-use-nmis +++ a/kernel/watchdog_perf.c @@ -234,12 +234,22 @@ void __init hardlockup_detector_perf_res } } +bool __weak __init arch_perf_nmi_is_available(void) +{ + return true; +} + /** * watchdog_hardlockup_probe - Probe whether NMI event is available at all */ int __init watchdog_hardlockup_probe(void) { - int ret = hardlockup_detector_event_create(); + int ret; + + if (!arch_perf_nmi_is_available()) + return -ENODEV; + + ret = hardlockup_detector_event_create(); if (ret) { pr_info("Perf NMI watchdog permanently disabled\n"); _ Patches currently in -mm which might be from dianders@xxxxxxxxxxxx are arm64-enable-perf-events-based-hard-lockup-detector.patch