Re: [PATCH] x86/ftrace: Mark ftrace_modify_code_direct() __ref

From: Steven Rostedt
Date: Mon Nov 18 2019 - 12:52:51 EST


On Mon, 18 Nov 2019 18:35:10 +0100
Borislav Petkov <bp@xxxxxxxxx> wrote:


> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index 2a179fb35cd1..108ee96f8b66 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -99,7 +99,12 @@ static int ftrace_verify_code(unsigned long ip, const char *old_code)
> return 0;
> }
>
> -static int
> +/*
> + * Marked __ref because it calls text_poke_early() which is .init.text. That is
> + * ok because that call will happen early, during boot, when .init sections are
> + * still present.
> + */
> +static int __ref

Acked-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

-- Steve

> ftrace_modify_code_direct(unsigned long ip, const char *old_code,
> const char *new_code)
> {