lkml.org 
[lkml]   [2021]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip v8 11/13] x86/unwind: Recover kretprobe trampoline entry
On Fri, Jun 18, 2021 at 04:07:06PM +0900, Masami Hiramatsu wrote:
> @@ -549,7 +548,15 @@ bool unwind_next_frame(struct unwind_state *state)
> (void *)orig_ip);
> goto err;
> }
> -
> + /*
> + * There is a small chance to interrupt at the entry of
> + * kretprobe_trampoline where the ORC info doesn't exist.
> + * That point is right after the RET to kretprobe_trampoline
> + * which was modified return address. So the @addr_p must
> + * be right before the regs->sp.
> + */
> + state->ip = unwind_recover_kretprobe(state, state->ip,
> + (unsigned long *)(state->sp - sizeof(long)));
> state->regs = (struct pt_regs *)sp;
> state->prev_regs = NULL;
> state->full_regs = true;
> @@ -562,6 +569,9 @@ bool unwind_next_frame(struct unwind_state *state)
> (void *)orig_ip);
> goto err;
> }
> + /* See UNWIND_HINT_TYPE_REGS case comment. */
> + state->ip = unwind_recover_kretprobe(state, state->ip,
> + (unsigned long *)(state->sp - sizeof(long)));
>
> if (state->full_regs)
> state->prev_regs = state->regs;

Why doesn't the ftrace case have this? That is, why aren't both return
trampolines having the same general shape?

\
 
 \ /
  Last update: 2021-07-05 13:40    [W:0.286 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site