s390/ftrace: use text_poke_sync_lock()
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 1 Oct 2021 12:21:43 +0000 (14:21 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 11 Oct 2021 18:55:58 +0000 (20:55 +0200)
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/ftrace.c

index 5d0c45c13b5faea7fdbdf6721a29ac7f85e84139..04a3e88c58d7500205c0104e9f3df064448830f4 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/kprobes.h>
 #include <trace/syscall.h>
 #include <asm/asm-offsets.h>
+#include <asm/text-patching.h>
 #include <asm/cacheflush.h>
 #include <asm/ftrace.lds.h>
 #include <asm/nospec-branch.h>
@@ -207,14 +208,13 @@ void arch_ftrace_update_code(int command)
        ftrace_modify_all_code(command);
 }
 
-static void __ftrace_sync(void *dummy)
-{
-}
-
 int ftrace_arch_code_modify_post_process(void)
 {
-       /* Send SIGP to the other CPUs, so they see the new code. */
-       smp_call_function(__ftrace_sync, NULL, 1);
+       /*
+        * Flush any pre-fetched instructions on all
+        * CPUs to make the new code visible.
+        */
+       text_poke_sync_lock();
        return 0;
 }