lkml.org 
[lkml]   [2021]   [Jul]   [7]   [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 Wed, 7 Jul 2021 10:20:41 +0200
    Peter Zijlstra <peterz@infradead.org> wrote:

    > > > Steve, can you clarify the ftrace side here? Afaict return_to_handler()
    > > > is similarly affected.
    > >
    > > I'm not exactly sure what the issue is. As Masami stated, kretprobe
    > > uses a ret to return to the calling function, but ftrace uses a jmp.
    >
    > I'll have to re-read the ftrace bits, but from the top of my head you
    > cannot do an indirect jump and preserve all registers at the same time,
    > so a return stub must use jump from stack aka. ret.
    >
    > > kretprobe return tracing is more complex than the function graph return
    > > tracing is (which is one of the issues I need to overcome to unify
    > > them),
    >
    > I'm not sure it is. IIRC the biggest pain point with kretprobe is that
    > 'silly' property that the kretprobe_instance are not the same between
    > kretprobes. Luckily, that's not actually used anywhere, so we can simply
    > rip that out.

    I actually don't want to keep this feature because no one use it.
    (only systemtap needs it?)

    Anyway, if we keep the idea-level compatibility (not code level),
    what we need is 'void *data' in the struct kretprobe_instance.
    User who needs it can allocate their own instance data for their
    kretprobes when initialising it and sets in their entry handler.

    Then we can have a simple kretprobe_instance.

    Thank you,



    --
    Masami Hiramatsu <mhiramat@kernel.org>

    \
     
     \ /
      Last update: 2021-07-07 12:16    [W:2.539 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site