Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1836344imm; Mon, 3 Sep 2018 10:41:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdar6r0OOs8t6MbND4yhGBKJYg4oV+zkn4Iw9PsW6BzZX7hL7xqJo6iaMDLlkM6n+sQYiSxJ X-Received: by 2002:a62:ea05:: with SMTP id t5-v6mr30898662pfh.228.1535996489790; Mon, 03 Sep 2018 10:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996489; cv=none; d=google.com; s=arc-20160816; b=Y6wXahle6o4Uq9pxaPkdT2U+VAJt2SKPwbM/5V5k7NU++DgKp1pmvW6rvo5ADxeB9m +zlEZwk6kW+Z0Hw3juUZGnGlvK2dF3QbHnV6ahJJFtEw2l/58sQ4wwUhW12gWpTsTHu1 /ujSV8/1QAe3mhfzt/FH3OB8DBo4Prv7GtHYjqFekD8CZ/l1LRc02kL94snvTb/FCBEs 3fNpXrxEVzpC6euvQfUv6dA/alm/hdyQCpfHBDjxNb/RSrauRVxQq7wnZY/AsoFoGss/ f+3TlSrcsg5BIRnFt9sfGIM8E3jIytIyoxvezK1t9a0lW4gdqniK0JTuSYJSHw49WMFB fDqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=phc0QgDhZadZs/Ze/nthEpaerSxwtiAsoPAAZbPHhnA=; b=yDYXrCasJochW0W7akxfHZ66z2ToXst5Kai2q9Qs8GJ0b0bYcwNLm/9aWxcoEvQx7n Ih5mRugwEm5GItrKoWc+t+hQ01mZ7V0eEWaxguVdwuEpBCkdTxXKQQ7nYut2oIslkslz xE9fv/wTEn/XSgv8VMJAyEGfPTLQGJ7rpe33XVyXDwxQEbT4kSxykn4JBF2MG5Mn21pC GPc71kpGXxkfuik/jMBV7+Xy1ghfaYOgKaDXNa5coJBk80nTl4xHx6x4XScPWPctkh5Z hifrUzn2PjcSft2413kIHUf2RQaFob1OfqQT9VqM1PszLf9QQHnGl+6FqNvG7dn4IxSL GWsw== 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 m86-v6si20015378pfj.48.2018.09.03.10.41.15; Mon, 03 Sep 2018 10:41:29 -0700 (PDT) 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 S1731977AbeICWA7 (ORCPT + 99 others); Mon, 3 Sep 2018 18:00:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49308 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729170AbeICWA6 (ORCPT ); Mon, 3 Sep 2018 18:00:58 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B2345A95; Mon, 3 Sep 2018 17:39:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Whitchurch , Thomas Gleixner , Peter Zijlstra , oleg@redhat.com, tj@kernel.org Subject: [PATCH 4.18 120/123] watchdog: Mark watchdog touch functions as notrace Date: Mon, 3 Sep 2018 18:57:44 +0200 Message-Id: <20180903165724.569740429@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vincent Whitchurch commit cb9d7fd51d9fbb329d182423bd7b92d0f8cb0e01 upstream. Some architectures need to use stop_machine() to patch functions for ftrace, and the assumption is that the stopped CPUs do not make function calls to traceable functions when they are in the stopped state. Commit ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") added calls to the watchdog touch functions from the stopped CPUs and those functions lack notrace annotations. This leads to crashes when enabling/disabling ftrace on ARM kernels built with the Thumb-2 instruction set. Fix it by adding the necessary notrace annotations. Fixes: ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") Signed-off-by: Vincent Whitchurch Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: oleg@redhat.com Cc: tj@kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180821152507.18313-1-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman --- kernel/watchdog.c | 4 ++-- kernel/watchdog_hld.c | 2 +- kernel/workqueue.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -266,7 +266,7 @@ static void __touch_watchdog(void) * entering idle state. This should only be used for scheduler events. * Use touch_softlockup_watchdog() for everything else. */ -void touch_softlockup_watchdog_sched(void) +notrace void touch_softlockup_watchdog_sched(void) { /* * Preemption can be enabled. It doesn't matter which CPU's timestamp @@ -275,7 +275,7 @@ void touch_softlockup_watchdog_sched(voi raw_cpu_write(watchdog_touch_ts, 0); } -void touch_softlockup_watchdog(void) +notrace void touch_softlockup_watchdog(void) { touch_softlockup_watchdog_sched(); wq_watchdog_touch(raw_smp_processor_id()); --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -29,7 +29,7 @@ static struct cpumask dead_events_mask; static unsigned long hardlockup_allcpu_dumped; static atomic_t watchdog_cpus = ATOMIC_INIT(0); -void arch_touch_nmi_watchdog(void) +notrace void arch_touch_nmi_watchdog(void) { /* * Using __raw here because some code paths have --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5559,7 +5559,7 @@ static void wq_watchdog_timer_fn(struct mod_timer(&wq_watchdog_timer, jiffies + thresh); } -void wq_watchdog_touch(int cpu) +notrace void wq_watchdog_touch(int cpu) { if (cpu >= 0) per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;