diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-11 17:37:24 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-11 17:37:24 -0700 |
commit | b2464ab2023f20aea23ef8df1cb45b338c859ea5 (patch) | |
tree | f19c0b09cfb79559274e499e21ca7c29a8a3fdba /arch | |
parent | 788885ae7a298dec73ba999c2fc5d46d42072ddf (diff) | |
parent | 829e92458532b1dbfeb972435d45bb060cdbf5a3 (diff) | |
download | linux-stable-b2464ab2023f20aea23ef8df1cb45b338c859ea5.tar.gz linux-stable-b2464ab2023f20aea23ef8df1cb45b338c859ea5.tar.bz2 linux-stable-b2464ab2023f20aea23ef8df1cb45b338c859ea5.zip |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
kprobes/x86: Fix removed int3 checking order
perf: Fix static strings treated like dynamic ones
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/kprobes.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index b43bbaebe2c0..1658efdfb4e5 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c @@ -534,20 +534,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) struct kprobe_ctlblk *kcb; addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t)); - if (*addr != BREAKPOINT_INSTRUCTION) { - /* - * The breakpoint instruction was removed right - * after we hit it. Another cpu has removed - * either a probepoint or a debugger breakpoint - * at this address. In either case, no further - * handling of this interrupt is appropriate. - * Back up over the (now missing) int3 and run - * the original instruction. - */ - regs->ip = (unsigned long)addr; - return 1; - } - /* * We don't want to be preempted for the entire * duration of kprobe processing. We conditionally @@ -579,6 +565,19 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) setup_singlestep(p, regs, kcb, 0); return 1; } + } else if (*addr != BREAKPOINT_INSTRUCTION) { + /* + * The breakpoint instruction was removed right + * after we hit it. Another cpu has removed + * either a probepoint or a debugger breakpoint + * at this address. In either case, no further + * handling of this interrupt is appropriate. + * Back up over the (now missing) int3 and run + * the original instruction. + */ + regs->ip = (unsigned long)addr; + preempt_enable_no_resched(); + return 1; } else if (kprobe_running()) { p = __get_cpu_var(current_kprobe); if (p->break_handler && p->break_handler(p, regs)) { |