mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Zong Li" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Zong Li <zong.li@sifive.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Atish Patra <atish.patra@wdc.com>,
	Colin Ian King <colin.king@canonical.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	stable@vger.kernel.org, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: smp/urgent] stop_machine, rcu: Mark functions as notrace
Date: Mon, 26 Oct 2020 11:17:22 -0000	[thread overview]
Message-ID: <160371104269.397.18106018255287440015.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201021073839.43935-1-zong.li@sifive.com>

The following commit has been merged into the smp/urgent branch of tip:

Commit-ID:     4230e2deaa484b385aa01d598b2aea8e7f2660a6
Gitweb:        https://git.kernel.org/tip/4230e2deaa484b385aa01d598b2aea8e7f2660a6
Author:        Zong Li <zong.li@sifive.com>
AuthorDate:    Wed, 21 Oct 2020 15:38:39 +08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 26 Oct 2020 12:12:27 +01:00

stop_machine, rcu: Mark functions as notrace

Some architectures assume that the stopped CPUs don't make function calls
to traceable functions when they are in the stopped state. See also commit
cb9d7fd51d9f ("watchdog: Mark watchdog touch functions as notrace").

Violating this assumption causes kernel crashes when switching tracer on
RISC-V.

Mark rcu_momentary_dyntick_idle() and stop_machine_yield() notrace to
prevent this.

Fixes: 4ecf0a43e729 ("processor: get rid of cpu_relax_yield")
Fixes: 366237e7b083 ("stop_machine: Provide RCU quiescent state in multi_cpu_stop()")
Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201021073839.43935-1-zong.li@sifive.com
---
 kernel/rcu/tree.c     | 2 +-
 kernel/stop_machine.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 06895ef..2a52f42 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -409,7 +409,7 @@ bool rcu_eqs_special_set(int cpu)
  *
  * The caller must have disabled interrupts and must not be idle.
  */
-void rcu_momentary_dyntick_idle(void)
+notrace void rcu_momentary_dyntick_idle(void)
 {
 	int special;
 
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 865bb02..890b79c 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -178,7 +178,7 @@ static void ack_state(struct multi_stop_data *msdata)
 		set_state(msdata, msdata->state + 1);
 }
 
-void __weak stop_machine_yield(const struct cpumask *cpumask)
+notrace void __weak stop_machine_yield(const struct cpumask *cpumask)
 {
 	cpu_relax();
 }

  parent reply	other threads:[~2020-10-26 11:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  7:38 [PATCH] stop_machine: " Zong Li
2020-10-21 14:12 ` Steven Rostedt
2020-10-21 14:15   ` Steven Rostedt
2020-10-21 15:44     ` Paul E. McKenney
2020-10-21 15:54       ` Steven Rostedt
2020-10-21 16:16         ` Paul E. McKenney
2020-10-22  0:58 ` Atish Patra
2020-10-23 19:29 ` Colin Ian King
2020-10-26  2:56   ` Zong Li
2020-10-26 11:17 ` tip-bot2 for Zong Li [this message]
2020-10-28 15:44 ` Guo Ren
2020-10-29  0:23   ` Atish Patra
2020-10-29  2:34     ` Zong Li
2020-10-29 16:06       ` Guo Ren
2020-10-29 18:46         ` Atish Patra
2020-10-30  3:28           ` Guo Ren
2020-10-30 21:47             ` Atish Patra
2020-10-31  0:28               ` Steven Rostedt
2020-10-31  7:42                 ` Guo Ren
2020-11-03 15:33                   ` Atish Patra
2020-11-06  2:44                     ` Guo Ren
2020-10-29 16:01     ` Guo Ren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160371104269.397.18106018255287440015.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=atish.patra@wdc.com \
    --cc=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zong.li@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®