diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-03-25 09:51:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-26 06:33:55 -0400 |
commit | faa4602e47690fb11221e00f9b9697c8dc0d4b19 (patch) | |
tree | af667d1cdff7dc63b6893ee3f27a1f2503229ed1 /arch/x86/kernel/step.c | |
parent | 7c5ecaf7666617889f337296c610815b519abfa9 (diff) |
x86, perf, bts, mm: Delete the never used BTS-ptrace code
Support for the PMU's BTS features has been upstreamed in
v2.6.32, but we still have the old and disabled ptrace-BTS,
as Linus noticed it not so long ago.
It's buggy: TIF_DEBUGCTLMSR is trampling all over that MSR without
regard for other uses (perf) and doesn't provide the flexibility
needed for perf either.
Its users are ptrace-block-step and ptrace-bts, since ptrace-bts
was never used and ptrace-block-step can be implemented using a
much simpler approach.
So axe all 3000 lines of it. That includes the *locked_memory*()
APIs in mm/mlock.c as well.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Markus Metzger <markus.t.metzger@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <20100325135413.938004390@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/step.c')
-rw-r--r-- | arch/x86/kernel/step.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c index 3149032ff107..7beba0769a8c 100644 --- a/arch/x86/kernel/step.c +++ b/arch/x86/kernel/step.c | |||
@@ -158,22 +158,6 @@ static int enable_single_step(struct task_struct *child) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | /* | 160 | /* |
161 | * Install this value in MSR_IA32_DEBUGCTLMSR whenever child is running. | ||
162 | */ | ||
163 | static void write_debugctlmsr(struct task_struct *child, unsigned long val) | ||
164 | { | ||
165 | if (child->thread.debugctlmsr == val) | ||
166 | return; | ||
167 | |||
168 | child->thread.debugctlmsr = val; | ||
169 | |||
170 | if (child != current) | ||
171 | return; | ||
172 | |||
173 | update_debugctlmsr(val); | ||
174 | } | ||
175 | |||
176 | /* | ||
177 | * Enable single or block step. | 161 | * Enable single or block step. |
178 | */ | 162 | */ |
179 | static void enable_step(struct task_struct *child, bool block) | 163 | static void enable_step(struct task_struct *child, bool block) |
@@ -185,17 +169,9 @@ static void enable_step(struct task_struct *child, bool block) | |||
185 | * So noone should try to use debugger block stepping in a program | 169 | * So noone should try to use debugger block stepping in a program |
186 | * that uses user-mode single stepping itself. | 170 | * that uses user-mode single stepping itself. |
187 | */ | 171 | */ |
188 | if (enable_single_step(child) && block) { | 172 | if (!enable_single_step(child)) |
189 | set_tsk_thread_flag(child, TIF_DEBUGCTLMSR); | 173 | return; |
190 | write_debugctlmsr(child, | 174 | /* XXX */ |
191 | child->thread.debugctlmsr | DEBUGCTLMSR_BTF); | ||
192 | } else { | ||
193 | write_debugctlmsr(child, | ||
194 | child->thread.debugctlmsr & ~DEBUGCTLMSR_BTF); | ||
195 | |||
196 | if (!child->thread.debugctlmsr) | ||
197 | clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR); | ||
198 | } | ||
199 | } | 175 | } |
200 | 176 | ||
201 | void user_enable_single_step(struct task_struct *child) | 177 | void user_enable_single_step(struct task_struct *child) |
@@ -213,11 +189,7 @@ void user_disable_single_step(struct task_struct *child) | |||
213 | /* | 189 | /* |
214 | * Make sure block stepping (BTF) is disabled. | 190 | * Make sure block stepping (BTF) is disabled. |
215 | */ | 191 | */ |
216 | write_debugctlmsr(child, | 192 | /* XXX */ |
217 | child->thread.debugctlmsr & ~DEBUGCTLMSR_BTF); | ||
218 | |||
219 | if (!child->thread.debugctlmsr) | ||
220 | clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR); | ||
221 | 193 | ||
222 | /* Always clear TIF_SINGLESTEP... */ | 194 | /* Always clear TIF_SINGLESTEP... */ |
223 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | 195 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); |