Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1828846imm; Mon, 3 Sep 2018 10:29:46 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda9v4f8tBk66KuWOS5yyEKrcFaYagV3l88+1vq9ajXJumyNG6uGOoRY066FVyceUmUAFyP2 X-Received: by 2002:a62:9bc9:: with SMTP id e70-v6mr29891148pfk.95.1535995786803; Mon, 03 Sep 2018 10:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995786; cv=none; d=google.com; s=arc-20160816; b=q/QigPZcQOSH8nCwa4QCUhi2a47tYkiFcGzEE9X7g/8od7EjbOC9bfSMflojfky/nx VuFP9rmmjJiIkcpgzk7RtpldUMeoxvQCOQW2VniExjv6zmTD6RhQrLIkoDTBTuAfA3yw u5ok6nBlWogBGONFIhxHeQCkHUfflPdQG9haBo6dVPz3zKxPf401HKHiDLmPhENqFiaW CjEWQSfErmyT5Z2HLkYwdAYa4ovqoVOjvXrJDYMfMPqUvXqLulPi2Zz9eNJ8M+E06Z/t Vg4uVvMAtb+SEm8QN3tuKXLnTA7LKlRGIrmCaHgf/vh0ZoSQA7f0mkNibrFV7LUUZoRe MT1g== 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=HmT8p5endr3+VBfKytl/wurb5wOf6SA006yUqiK2JjQ=; b=p9LhVQPr+gcK+oKNRuX130PscfEdP9sfyBljO9q9C00EXgj6Lu5hJ3nSnOwtPyoVjX OriqAp8frMxV0D+TqnWqxUz+qfXEDxVbuuAYvxAYSJdkac9z9CFMIgtPTxvqt10P2rQh L8xc4Dw+MbmTgP37PbYU1E86jz8HZgdQ/Pe0GBaTGE/2Fg1wEwj3gq0w1GJ9e1T0q8UN fpJL8kEmqVraOU2DzqYIMspeYQkJ7LRf9PWzr47fP15sGhexj4oIm1h1W5jW2ylrfIEG zZpgMOkoom01Qepp2VWCTdzCfV4o0zphqDYAwgZVx5jnQRjw9Q/B64He5WlXoDUoF0U+ hyeA== 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 k185-v6si18428307pgd.523.2018.09.03.10.29.31; Mon, 03 Sep 2018 10:29:46 -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 S1731133AbeICVt1 (ORCPT + 99 others); Mon, 3 Sep 2018 17:49:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46408 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbeICVt0 (ORCPT ); Mon, 3 Sep 2018 17:49:26 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EC3B6CF4; Mon, 3 Sep 2018 17:28:18 +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.14 162/165] watchdog: Mark watchdog touch functions as notrace Date: Mon, 3 Sep 2018 18:57:28 +0200 Message-Id: <20180903165705.221472971@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@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.14-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 @@ -265,7 +265,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 @@ -274,7 +274,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 @@ -5484,7 +5484,7 @@ static void wq_watchdog_timer_fn(unsigne 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;