android_kernel_xiaomi_sm8350/arch/arm
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
..
boot [ARM] 4710/1: Fix coprocessor 14 usage for debug messages via ICEDCC 2007-12-17 17:16:13 +00:00
common Merge branch 'pxa-fixes' 2007-12-08 14:41:29 +00:00
configs [ARM] 4636/1: pxa: add default configuration for zylonite 2007-10-31 15:21:48 +00:00
kernel ARM kprobes: instruction single-stepping support 2008-01-26 15:25:16 +00:00
lib
mach-aaec2000
mach-at91 [ARM] 4691/1: add missing i2c_board_info struct for at91rm9200 2008-01-06 20:25:13 +00:00
mach-clps711x
mach-clps7500 [ARM] cleanup struct irqaction initializers 2007-10-12 23:43:20 +01:00
mach-davinci
mach-ebsa110
mach-ep93xx [ARM] 4572/1: ep93xx: add cirrus logic edb9307 support 2007-10-12 23:43:44 +01:00
mach-footbridge Remove magic macros for screen_info structure members 2007-10-16 22:57:17 -07:00
mach-h720x
mach-imx [ARM] 4648/1: i.MX/MX1 ensure more complete AITC initialization 2007-11-26 19:43:37 +00:00
mach-integrator Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-iop13xx
mach-iop32x hwmon: (f75375s) On n2100 systems, set fans to full speed on boot 2007-11-08 08:42:46 -05:00
mach-iop33x
mach-ixp4xx [ARM] 4694/1: IXP4xx: Update clockevent support for shutdown and resume 2007-12-17 17:18:01 +00:00
mach-ixp23xx
mach-ixp2000 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
mach-ks8695
mach-l7200
mach-lh7a40x
mach-mx3
mach-netx [ARM] 4641/2: netX: fix kobject_name type 2007-11-05 17:19:14 +00:00
mach-ns9xxx [ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32 2007-10-12 23:43:41 +01:00
mach-omap1 driver core: make /sys/power a kobject 2008-01-24 20:40:25 -08:00
mach-omap2 [ARM] Fix assignment instead of condition in arm/mach-omap2/clock.c 2007-10-31 15:21:43 +00:00
mach-pnx4008 PM: Rename struct pm_ops and related things 2007-10-18 14:37:18 -07:00
mach-pxa Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-realview
mach-rpc
mach-s3c2400
mach-s3c2410 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-s3c2412 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-s3c2440 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-s3c2442
mach-s3c2443 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-sa1100 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-shark
mach-versatile
mm [ARM] remove useless setting of VM_RESERVED 2007-11-11 10:55:25 +00:00
nwfpe Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
oprofile Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
plat-iop
plat-mxc
plat-omap Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
plat-s3c
plat-s3c24xx Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
tools
vfp [ARM] vfp: fix fuitod/fsitod instructions 2008-01-10 17:07:08 +00:00
Kconfig [ARM] 4748/1: dca: source drivers/dca/Kconfig in arch/arm/Kconfig to fix warning 2008-01-20 10:10:41 +00:00
Kconfig-nommu [ARM] 4532/1: allow configuration of processor ID 2007-10-12 23:43:02 +01:00
Kconfig.debug
Kconfig.instrumentation Fix ARM profiling/instrumentation configuration 2008-01-15 09:23:51 -08:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-10-16 11:23:06 -07:00