linux/arch/x86
Frederic Weisbecker 44234adcdc hw-breakpoints: Modify breakpoints without unregistering them
Currently, when ptrace needs to modify a breakpoint, like disabling
it, changing its address, type or len, it calls
modify_user_hw_breakpoint(). This latter will perform the heavy and
racy task of unregistering the old breakpoint and registering a new
one.

This is racy as someone else might steal the reserved breakpoint
slot under us, which is undesired as the breakpoint is only
supposed to be modified, sometimes in the middle of a debugging
workflow. We don't want our slot to be stolen in the middle.

So instead of unregistering/registering the breakpoint, just
disable it while we modify its breakpoint fields and re-enable it
after if necessary.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1260347148-5519-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-09 09:48:20 +01:00
..
boot
configs
crypto
ia32
include/asm Merge branch 'perf/mce' into perf/core 2009-12-03 20:11:06 +01:00
kernel hw-breakpoints: Modify breakpoints without unregistering them 2009-12-09 09:48:20 +01:00
kvm Merge branch 'tracing/hw-breakpoints' into perf/core 2009-11-21 14:07:23 +01:00
lguest
lib x86 insn: Delete empty or incomplete inat-tables.c 2009-12-07 18:33:19 +01:00
math-emu
mm Merge branch 'tracing/hw-breakpoints' into perf/core 2009-11-21 14:07:23 +01:00
oprofile
pci
power hw-breakpoints: Rewrite the hw-breakpoints layer on top of perf events 2009-11-08 15:34:42 +01:00
tools x86, perf probe: Fix warning in test_get_len() 2009-12-06 12:53:40 +01:00
vdso
video
xen xen: mask extended topology info in cpuid 2009-11-03 11:09:12 -08:00
Kbuild
Kconfig Merge branch 'tracing/hw-breakpoints' into perf/core 2009-11-21 14:07:23 +01:00
Kconfig.cpu
Kconfig.debug x86: Compile insn.c and inat.c only for KPROBES 2009-12-07 08:31:28 +01:00
Makefile Merge branch 'perf/core' into perf/probes 2009-11-17 10:17:47 +01:00
Makefile_32.cpu