]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit577d8069050026ffe56c2fed1255df2adf54e6f7
tree3e43c40877512fde3921351e59c38446ae70e400
parent0fbc09e7d067ade15ad8c85e8e2dfe73f54e2f03
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