lkml.org 
[lkml]   [2019]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH] ftrace/x86: Emulate call function while updating in breakpoint handler
    On Wed, May 01, 2019 at 02:58:24PM -0400, Steven Rostedt wrote:
    > > + if (ftrace_location(ip)) {
    > > + int3_emulate_call(regs, ftrace_update_func_call);
    >
    > Should be:
    >
    > int3_emulate_call(regs, (unsigned long)ftrace_regs_caller);

    Ah, I lost the plot a little there.

    > > + return 1;
    > > + } else if (is_ftrace_caller(ip)) {
    > > + if (!ftrace_update_func_call) {
    > > + int3_emulate_jmp(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE);
    >
    > I see what you did here, but I think:
    >
    > int3_emulate_jmp(regs, ip + CALL_INSN_SIZE);
    >
    > looks better. But that said, we could in the beginning do:
    >
    > ip = regs->ip - INT3_INSN_SIZE;
    >
    > instead of
    >
    > ip = regs->ip - 1;
    >
    > I made these updates and posted them to Linus.

    I was actually considering:

    static inline void int3_emulate_nop(struct pt_regs *regs, unsigned long size)
    {
    int3_emulate_jmp(regs, regs->ip - INT3_INSN_SIZE + size);
    }

    And then the above becomes:

    int3_emulate_nop(regs, CALL_INSN_SIZE);

    Hmm?

    \
     
     \ /
      Last update: 2019-05-01 21:05    [W:4.290 / U:0.208 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site