android_kernel_xiaomi_sdm845/arch/arm/kernel
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
..
armksyms.c [ARM] use __used attribute 2007-05-30 13:15:06 +01:00
arthur.c [PATCH] fix missing includes 2005-10-30 17:37:32 -08:00
asm-offsets.c [ARM] ARMv6: add CPU_HAS_ASID configuration 2007-05-17 10:19:23 +01:00
bios32.c [ARM] 4577/1: ITE 8152 PCI bridge support 2007-10-15 18:53:59 +01:00
calls.S [ARM] Add fallocate syscall entry 2007-10-12 23:43:31 +01:00
compat.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
compat.h [ARM] 3365/1: [cleanup] header for compat.c exported functions 2006-03-15 23:17:30 +00:00
crunch-bits.S [ARM] 3370/2: ep93xx: add crunch support 2006-06-28 17:55:01 +01:00
crunch.c [ARM] 4121/1: ep93xx: move setting of HWCAP_CRUNCH 2007-02-08 14:48:13 +00:00
debug.S [ARM] 3838/1: ARM: DCC debug console support for ARM11 2006-09-25 10:36:09 +01:00
dma-isa.c [ARM] arch/arm/kernel/dma-isa.c: named initializers 2006-05-16 22:09:46 +01:00
dma.c [ARM] Export dma_channel_active() 2007-03-31 21:36:53 +01:00
ecard.c [ARM] ecard: add ecardm_iomap() / ecardm_iounmap() 2007-05-11 17:19:02 +01:00
ecard.h [ARM] ecard: Move private ecard junk out of asm/ecard.h 2007-05-03 14:16:56 +01:00
entry-armv.S [ARM] 4665/1: fix __und_usr wrt accessing the undefined insn in user space 2007-11-26 19:44:02 +00:00
entry-common.S remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
entry-header.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fiq.c [ARM] 3692/1: ARM: coswitch irq handling to the generic implementation 2006-07-01 22:30:09 +01:00
head-common.S [ARM] 4423/1: add ATAGS support 2007-07-12 11:13:33 +01:00
head-nommu.S [ARM] Ensure head text is always placed at the start of kernel 2007-05-08 15:15:45 +01:00
head.S [ARM] 4423/1: add ATAGS support 2007-07-12 11:13:33 +01:00
init_task.c [ARM] Shut up warning about init_thread_union 2007-05-08 12:39:37 +01:00
io.c [ARM] Fix compiler warnings for memcpy_toio/memcpy_fromio/memset_io 2005-09-24 10:42:06 +01:00
irq.c [ARM] Remove needless linux/ptrace.h includes 2007-04-21 20:34:47 +01:00
isa.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
iwmmxt.S [ARM] 3707/1: iwmmxt: use the generic thread notifier infrastructure 2006-07-01 19:56:48 +01:00
kprobes-decode.c ARM kprobes: instruction single-stepping support 2008-01-26 15:25:16 +00:00
machine_kexec.c [ARM] 4137/1: Add kexec support 2007-02-16 14:37:06 +00:00
Makefile ARM kprobes: instruction single-stepping support 2008-01-26 15:25:16 +00:00
module.c [ARM] Fix ARM branch relocation range 2007-05-08 22:05:25 +01:00
process.c Use helpers to obtain task pid in printks (arch code) 2007-10-19 11:53:43 -07:00
ptrace.c Use helpers to obtain task pid in printks (arch code) 2007-10-19 11:53:43 -07:00
ptrace.h [ARM] ptrace: clean up single stepping support 2007-04-21 20:34:58 +01:00
relocate_kernel.S [ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23) 2007-10-12 23:43:48 +01:00
semaphore.c [ARM] 3103/1: ARM EABI: stack pointer must be 64-bit aligned (part 2) 2006-01-14 16:18:09 +00:00
setup.c [ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23) 2007-10-12 23:43:48 +01:00
signal.c [ARM] ptrace: clean up single stepping support 2007-04-21 20:34:58 +01:00
signal.h [ARM] nommu: fixups for the exception vectors 2006-03-27 15:18:50 +01:00
smp.c Remove fs.h from mm.h 2007-07-29 17:09:29 -07:00
stacktrace.c [ARM] Fix stacktrace FP range checking 2007-05-30 13:15:12 +01:00
stacktrace.h [ARM] Add stacktrace support and make oprofile use it 2007-04-28 09:59:37 +01:00
sys_arm.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sys_oabi-compat.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
time.c sched: remove printk_clock() 2008-01-25 21:07:59 +01:00
traps.c [ARM] 4659/1: remove possibilities for spurious false negative with __kuser_cmpxchg 2007-11-26 19:43:58 +00:00
vmlinux.lds.S define new percpu interface for shared data 2007-07-19 10:04:44 -07:00
xscale-cp0.c [ARM] 3881/4: xscale: clean up cp0/cp1 handling 2006-12-03 17:52:22 +00:00