[PATCH RFC v2 riscv/for-next 4/5] riscv: ftrace: do not use stop_machine to update code

Andy Chiu andy.chiu at sifive.com
Tue Sep 13 02:42:51 PDT 2022


Now it is safe to remove dependency from stop_machine() to patch code in
ftrace.

Signed-off-by: Andy Chiu <andy.chiu at sifive.com>
Reviewed-by: Greentime Hu <greentime.hu at sifive.com>
Reviewed-by: Zong Li <zong.li at sifive.com>
Acked-by: Steven Rostedt (Google) <rostedt at goodmis.org>
---
 arch/riscv/kernel/ftrace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c
index 84b9e280dd1f..53db2ff83751 100644
--- a/arch/riscv/kernel/ftrace.c
+++ b/arch/riscv/kernel/ftrace.c
@@ -12,6 +12,12 @@
 #include <asm/patch.h>
 
 #ifdef CONFIG_DYNAMIC_FTRACE
+
+void arch_ftrace_update_code(int command)
+{
+	ftrace_modify_all_code(command);
+}
+
 void ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
 {
 	mutex_lock(&text_mutex);
-- 
2.36.0




More information about the linux-riscv mailing list