Skip to content

Commit 4230e2d

Browse files
zongboxKAGA-KOKO
authored andcommitted
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 cb9d7fd ("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: 4ecf0a4 ("processor: get rid of cpu_relax_yield") Fixes: 366237e ("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
1 parent 3650b22 commit 4230e2d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ bool rcu_eqs_special_set(int cpu)
409409
*
410410
* The caller must have disabled interrupts and must not be idle.
411411
*/
412-
void rcu_momentary_dyntick_idle(void)
412+
notrace void rcu_momentary_dyntick_idle(void)
413413
{
414414
int special;
415415

kernel/stop_machine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static void ack_state(struct multi_stop_data *msdata)
178178
set_state(msdata, msdata->state + 1);
179179
}
180180

181-
void __weak stop_machine_yield(const struct cpumask *cpumask)
181+
notrace void __weak stop_machine_yield(const struct cpumask *cpumask)
182182
{
183183
cpu_relax();
184184
}

0 commit comments

Comments
 (0)