lkml.org 
[lkml]   [2020]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3 v6] livepatch: Use the default ftrace_ops instead of REGS when ARGS is available
> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index e00fe88146e0..7c9474d52060 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -54,6 +54,9 @@ arch_ftrace_get_regs(struct ftrace_regs *fregs)
> return NULL;
> return &fregs->regs;
> }
> +
> +#define ftrace_instruction_pointer_set(fregs, ip) \
> + do { (fregs)->regs.ip = (_ip); } while (0)
> #endif
>
> #ifdef CONFIG_DYNAMIC_FTRACE
> diff --git a/arch/x86/include/asm/livepatch.h b/arch/x86/include/asm/livepatch.h
> index 1fde1ab6559e..59a08d5c6f1d 100644
> --- a/arch/x86/include/asm/livepatch.h
> +++ b/arch/x86/include/asm/livepatch.h
> @@ -12,9 +12,9 @@
> #include <asm/setup.h>
> #include <linux/ftrace.h>
>
> -static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
> +static inline void klp_arch_set_pc(struct ftrace_regs *fregs, unsigned long ip)
> {
> - regs->ip = ip;
> + ftrace_regs_set_ip(fregs, ip);

You forgot to update the call site :)

Miroslav

\
 
 \ /
  Last update: 2020-11-13 12:33    [W:0.061 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site