lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH -tip v4 12/27] sparc64: kprobes: Remove jprobe implementation
    Date
    Remove arch dependent setjump/longjump functions
    and unused fields in kprobe_ctlblk for jprobes
    from arch/sparc.

    Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
    ---
    arch/sparc/include/asm/kprobes.h | 1 -
    arch/sparc/kernel/kprobes.c | 47 --------------------------------------
    2 files changed, 48 deletions(-)

    diff --git a/arch/sparc/include/asm/kprobes.h b/arch/sparc/include/asm/kprobes.h
    index 3704490b4488..bfcaa6326c20 100644
    --- a/arch/sparc/include/asm/kprobes.h
    +++ b/arch/sparc/include/asm/kprobes.h
    @@ -44,7 +44,6 @@ struct kprobe_ctlblk {
    unsigned long kprobe_status;
    unsigned long kprobe_orig_tnpc;
    unsigned long kprobe_orig_tstate_pil;
    - struct pt_regs jprobe_saved_regs;
    struct prev_kprobe prev_kprobe;
    };

    diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c
    index ab4ba4347941..f555711da8f1 100644
    --- a/arch/sparc/kernel/kprobes.c
    +++ b/arch/sparc/kernel/kprobes.c
    @@ -441,53 +441,6 @@ asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
    exception_exit(prev_state);
    }

    -/* Jprobes support. */
    -int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
    -{
    - struct jprobe *jp = container_of(p, struct jprobe, kp);
    - struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
    -
    - memcpy(&(kcb->jprobe_saved_regs), regs, sizeof(*regs));
    -
    - regs->tpc = (unsigned long) jp->entry;
    - regs->tnpc = ((unsigned long) jp->entry) + 0x4UL;
    - regs->tstate |= TSTATE_PIL;
    -
    - return 1;
    -}
    -
    -void __kprobes jprobe_return(void)
    -{
    - struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
    - register unsigned long orig_fp asm("g1");
    -
    - orig_fp = kcb->jprobe_saved_regs.u_regs[UREG_FP];
    - __asm__ __volatile__("\n"
    -"1: cmp %%sp, %0\n\t"
    - "blu,a,pt %%xcc, 1b\n\t"
    - " restore\n\t"
    - ".globl jprobe_return_trap_instruction\n"
    -"jprobe_return_trap_instruction:\n\t"
    - "ta 0x70"
    - : /* no outputs */
    - : "r" (orig_fp));
    -}
    -
    -extern void jprobe_return_trap_instruction(void);
    -
    -int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
    -{
    - u32 *addr = (u32 *) regs->tpc;
    - struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
    -
    - if (addr == (u32 *) jprobe_return_trap_instruction) {
    - memcpy(regs, &(kcb->jprobe_saved_regs), sizeof(*regs));
    - preempt_enable_no_resched();
    - return 1;
    - }
    - return 0;
    -}
    -
    /* The value stored in the return address register is actually 2
    * instructions before where the callee will return to.
    * Sequences usually look something like this
    \
     
     \ /
      Last update: 2018-05-28 09:06    [W:2.320 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site