linux/arch
Quentin Barnes 35aa1df432 ARM kprobes: instruction single-stepping support
This is the code implementing instruction single-stepping for kprobes
on ARM.

To get around the limitation of no Next-PC and no hardware single-
stepping, all kprobe'd instructions are split into three camps:
simulation, emulation, and rejected. "Simulated" instructions are
those instructions which behavior is reproduced by straight C code.
"Emulated" instructions are ones that are copied, slightly altered
and executed directly in the instruction slot to reproduce their
behavior.  "Rejected" instructions are ones that could be simulated,
but work hasn't been put into simulating them. These instructions
should be very rare, if not unencountered, in the kernel. If ever
needed, code could be added to simulate them.

One might wonder why this and the ptrace singlestep facility are not
sharing some code.  Both approaches are fundamentally different because
the ptrace code regains control after the stepped instruction by installing
a breakpoint after the instruction itself, and possibly at the location
where the instruction might be branching to, instead of simulating or
emulating the target instruction.

The ptrace approach isn't suitable for kprobes because the breakpoints
would have to be moved back, and the icache flushed, everytime the
probe is hit to let normal code execution resume, which would have a
significant performance impact. It is also racy on SMP since another
CPU could, with the right timing, sail through the probe point without
being caught.  Because ptrace single-stepping always result in a
different process to be scheduled, the concern for performance is much
less significant.

On the other hand, the kprobes approach isn't (currently) suitable for
ptrace because it has no provision for proper user space memory
protection and translation, and even if that was implemented, the gain
wouldn't be worth the added complexity in the ptrace path compared to
the current approach.

So, until kprobes does support user space, both kprobes and ptrace are
best kept independent and separate.

Signed-off-by: Quentin Barnes <qbarnes@gmail.com>
Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
2008-01-26 15:25:16 +00:00
..
alpha alpha: fix conversion from denormal float to double 2008-01-17 15:38:59 -08:00
arm ARM kprobes: instruction single-stepping support 2008-01-26 15:25:16 +00:00
avr32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 2008-01-25 08:40:02 -08:00
blackfin Fix Blackfin HARDWARE_PM support 2008-01-15 12:32:30 -08:00
cris Kobject: the cris iop_fw_load.c code is broken 2008-01-24 20:40:30 -08:00
frv FRV: arrange things such that BRA can reach from the trap table 2007-11-29 09:24:54 -08:00
h8300 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
ia64 sched: remove printk_clock references from ia64 2008-01-25 21:07:59 +01:00
m32r m32r: Update sys_rt_sigsuspend 2007-11-28 01:24:04 +09:00
m68k m68k: export atari_keyb_init 2007-11-26 19:15:31 -08:00
m68knommu m68knommu: mark mem init functions as __init 2007-10-23 20:45:44 -07:00
mips cpu-hotplug: replace lock_cpu_hotplug() with get_online_cpus() 2008-01-25 21:08:02 +01:00
parisc [PARISC] print more than one character at a time for pdc console 2007-12-06 09:32:15 -08:00
powerpc cpu-hotplug: replace lock_cpu_hotplug() with get_online_cpus() 2008-01-25 21:08:02 +01:00
ppc Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2008-01-25 08:38:25 -08:00
sh Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
sh64 sh64: Kill off duplicate includes. 2007-11-05 12:18:17 +09:00
sparc [SPARC]: Constify function pointer tables. 2008-01-22 18:29:20 -08:00
sparc64 [SPARC64]: Partially revert "Constify function pointer tables." 2008-01-23 21:32:04 -08:00
um uml: user of helper_wait() got missed when it got extra arguments 2007-12-23 12:54:37 -08:00
v850 spelling fixes: arch/v850/ 2007-10-20 01:24:05 +02:00
x86 sched: latencytop support 2008-01-25 21:08:34 +01:00
xtensa [XTENSA]: Fix use of skb after netif_rx 2007-12-11 02:45:28 -08:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00