ARM: kprobes: Fix emulation of LDRD and STRD instructions
authorJon Medhurst <tixy@yxit.co.uk>
Fri, 8 Apr 2011 14:32:56 +0000 (15:32 +0100)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Fri, 29 Apr 2011 03:40:57 +0000 (23:40 -0400)
commit5c6b76fc7d8220e8f00e7a49fb56ca852d7fb661
tree3e43c40877512fde3921351e59c38446ae70e400
parent54823accfcfc715e9e757a621afb40dabc01d033
ARM: kprobes: Fix emulation of LDRD and STRD instructions

The decoding of these instructions got the register indexed and
immediate indexed forms the wrong way around, causing incorrect
emulation.

Instructions like "LDRD Rx, [Rx]" were corrupting Rx because the base
register writeback was being performed unconditionally, overwriting the
value just loaded from memory. The fix is to only writeback the base
register when that form of the instruction is used. Note, now that we
reject probing writeback with PC the emulation code doesn't need the
check rn!=15.

Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
arch/arm/kernel/kprobes-decode.c