linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stop_machine: Mark functions as notrace
@ 2020-10-21  7:38 Zong Li
  2020-10-21 14:12 ` Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Zong Li @ 2020-10-21  7:38 UTC (permalink / raw)
  To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai, joel,
	vincent.whitchurch, tglx, paul.walmsley, palmerdabbelt, guoren,
	atishp, mhiramat, greentime.hu, colin.king, rcu, linux-kernel,
	linux-riscv
  Cc: Zong Li

Like the commit cb9d7fd51d9f ("watchdog: Mark watchdog touch 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. For example, it causes unexpected kernel crashed when switching
tracer on RISC-V.

The following patches added calls to these two functions, fix it by
adding the notrace annotations.

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>
---
 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 06895ef85d69..2a52f42f64b6 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 865bb0228ab6..890b79cf0e7c 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();
 }
-- 
2.28.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-11-06  2:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  7:38 [PATCH] stop_machine: Mark functions as notrace 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-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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).