Skip to content

Commit 38ebd8d

Browse files
suryasaimadhuIngo Molnar
authored andcommitted
x86/ftrace: Mark ftrace_modify_code_direct() __ref
... because it calls the .init.text function text_poke_early(). That is ok because it does call that function early, during boot. Fixes: 9706f7c ("x86/ftrace: Use text_poke()") Suggested-by: Peter Zijlstra <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 4531ef6 commit 38ebd8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/x86/kernel/ftrace.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ static int ftrace_verify_code(unsigned long ip, const char *old_code)
9999
return 0;
100100
}
101101

102-
static int
102+
/*
103+
* Marked __ref because it calls text_poke_early() which is .init.text. That is
104+
* ok because that call will happen early, during boot, when .init sections are
105+
* still present.
106+
*/
107+
static int __ref
103108
ftrace_modify_code_direct(unsigned long ip, const char *old_code,
104109
const char *new_code)
105110
{

0 commit comments

Comments
 (0)