aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-09-20 08:43:54 -0400
committerIngo Molnar <mingo@kernel.org>2012-09-20 08:48:16 -0400
commit50a011f6409e888d5f41343024d24885281f048c (patch)
tree53bee4c687336223bcba7916c73b3072bd60c8fa
parent1e6dd8adc78d4a153db253d051fd4ef6c49c9019 (diff)
kprobes/x86: Move skip_singlestep up
I get this warning: arch/x86/kernel/kprobes.c:544:23: warning: ‘skip_singlestep’ declared ‘static’ but never defined on tip/auto-latest. Put the skip_singlestep function declaration up, in KPROBES_CAN_USE_FTRACE and drop the superfluous forward declaration. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1348145034-16603-1-git-send-email-bp@amd64.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/kprobes.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index b7c2a85d1926..57916c0d3cf6 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -541,8 +541,23 @@ reenter_kprobe(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb
541 return 1; 541 return 1;
542} 542}
543 543
544#ifdef KPROBES_CAN_USE_FTRACE
544static void __kprobes skip_singlestep(struct kprobe *p, struct pt_regs *regs, 545static void __kprobes skip_singlestep(struct kprobe *p, struct pt_regs *regs,
545 struct kprobe_ctlblk *kcb); 546 struct kprobe_ctlblk *kcb)
547{
548 /*
549 * Emulate singlestep (and also recover regs->ip)
550 * as if there is a 5byte nop
551 */
552 regs->ip = (unsigned long)p->addr + MCOUNT_INSN_SIZE;
553 if (unlikely(p->post_handler)) {
554 kcb->kprobe_status = KPROBE_HIT_SSDONE;
555 p->post_handler(p, regs, 0);
556 }
557 __this_cpu_write(current_kprobe, NULL);
558}
559#endif
560
546/* 561/*
547 * Interrupts are disabled on entry as trap3 is an interrupt gate and they 562 * Interrupts are disabled on entry as trap3 is an interrupt gate and they
548 * remain disabled throughout this function. 563 * remain disabled throughout this function.
@@ -1061,21 +1076,6 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
1061} 1076}
1062 1077
1063#ifdef KPROBES_CAN_USE_FTRACE 1078#ifdef KPROBES_CAN_USE_FTRACE
1064static void __kprobes skip_singlestep(struct kprobe *p, struct pt_regs *regs,
1065 struct kprobe_ctlblk *kcb)
1066{
1067 /*
1068 * Emulate singlestep (and also recover regs->ip)
1069 * as if there is a 5byte nop
1070 */
1071 regs->ip = (unsigned long)p->addr + MCOUNT_INSN_SIZE;
1072 if (unlikely(p->post_handler)) {
1073 kcb->kprobe_status = KPROBE_HIT_SSDONE;
1074 p->post_handler(p, regs, 0);
1075 }
1076 __this_cpu_write(current_kprobe, NULL);
1077}
1078
1079/* Ftrace callback handler for kprobes */ 1079/* Ftrace callback handler for kprobes */
1080void __kprobes kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, 1080void __kprobes kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
1081 struct ftrace_ops *ops, struct pt_regs *regs) 1081 struct ftrace_ops *ops, struct pt_regs *regs)