diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-10-28 11:55:36 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2012-11-03 12:15:12 -0400 |
commit | 65b2c8f0e53347583168423de0f32227d8baf01b (patch) | |
tree | 87b1e9fb5dcbc3e2a5a59192c27b959dc6cc0323 | |
parent | f57d56dd29003435d1bfc0e675896c368180f8ec (diff) |
uprobes/powerpc: Do not use arch_uprobe_*_step() helpers
No functional changes.
powerpc is the only user of arch_uprobe_enable/disable_step() helpers,
but they should die. They can not be used correctly, every arch needs
its own implementation (like x86 does). And they do not really help
even as initial-and-almost-working code, arch_uprobe_*_xol() hooks can
easily use user_enable/disable_single_step() directly.
Change arch_uprobe_*_step() to do nothing, and convert powerpc to use
ptrace helpers. This is equally wrong, powerpc needs the arch-specific
fixes.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-rw-r--r-- | arch/powerpc/kernel/uprobes.c | 6 | ||||
-rw-r--r-- | kernel/events/uprobes.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/uprobes.c b/arch/powerpc/kernel/uprobes.c index d2d46d1014f8..bc77834dbf43 100644 --- a/arch/powerpc/kernel/uprobes.c +++ b/arch/powerpc/kernel/uprobes.c | |||
@@ -64,6 +64,8 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
64 | autask->saved_trap_nr = current->thread.trap_nr; | 64 | autask->saved_trap_nr = current->thread.trap_nr; |
65 | current->thread.trap_nr = UPROBE_TRAP_NR; | 65 | current->thread.trap_nr = UPROBE_TRAP_NR; |
66 | regs->nip = current->utask->xol_vaddr; | 66 | regs->nip = current->utask->xol_vaddr; |
67 | |||
68 | user_enable_single_step(current); | ||
67 | return 0; | 69 | return 0; |
68 | } | 70 | } |
69 | 71 | ||
@@ -119,6 +121,8 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
119 | * to be executed. | 121 | * to be executed. |
120 | */ | 122 | */ |
121 | regs->nip = utask->vaddr + MAX_UINSN_BYTES; | 123 | regs->nip = utask->vaddr + MAX_UINSN_BYTES; |
124 | |||
125 | user_disable_single_step(current); | ||
122 | return 0; | 126 | return 0; |
123 | } | 127 | } |
124 | 128 | ||
@@ -162,6 +166,8 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
162 | 166 | ||
163 | current->thread.trap_nr = utask->autask.saved_trap_nr; | 167 | current->thread.trap_nr = utask->autask.saved_trap_nr; |
164 | instruction_pointer_set(regs, utask->vaddr); | 168 | instruction_pointer_set(regs, utask->vaddr); |
169 | |||
170 | user_disable_single_step(current); | ||
165 | } | 171 | } |
166 | 172 | ||
167 | /* | 173 | /* |
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 5cc4e7e42e68..abbfd8440a6d 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -1432,12 +1432,10 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) | |||
1432 | 1432 | ||
1433 | void __weak arch_uprobe_enable_step(struct arch_uprobe *arch) | 1433 | void __weak arch_uprobe_enable_step(struct arch_uprobe *arch) |
1434 | { | 1434 | { |
1435 | user_enable_single_step(current); | ||
1436 | } | 1435 | } |
1437 | 1436 | ||
1438 | void __weak arch_uprobe_disable_step(struct arch_uprobe *arch) | 1437 | void __weak arch_uprobe_disable_step(struct arch_uprobe *arch) |
1439 | { | 1438 | { |
1440 | user_disable_single_step(current); | ||
1441 | } | 1439 | } |
1442 | 1440 | ||
1443 | /* | 1441 | /* |