diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-11-08 18:29:25 +0000 |
---|---|---|
committer | Taras Kondratiuk <taras@ti.com> | 2014-04-01 16:45:19 +0300 |
commit | 888be25402021a425da3e85e2d5a954d7509286e (patch) | |
tree | 5f6a556112fe3098370272c57e482501956d8f6c /arch/arm/kernel/kprobes-common.c | |
parent | c7edc9e326d53ca5ef9bed82de0740c6b107d55b (diff) | |
download | linux-stable-888be25402021a425da3e85e2d5a954d7509286e.tar.gz linux-stable-888be25402021a425da3e85e2d5a954d7509286e.tar.bz2 linux-stable-888be25402021a425da3e85e2d5a954d7509286e.zip |
ARM: probes: fix instruction fetch order with <asm/opcodes.h>
If we are running BE8, the data and instruction endianness do not
match, so use <asm/opcodes.h> to correctly translate memory accesses
into ARM instructions.
Acked-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
[taras.kondratiuk@linaro.org: fixed Thumb instruction fetch order]
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Diffstat (limited to 'arch/arm/kernel/kprobes-common.c')
-rw-r--r-- | arch/arm/kernel/kprobes-common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c index c311ed94ff1c..0bf5d64eba1d 100644 --- a/arch/arm/kernel/kprobes-common.c +++ b/arch/arm/kernel/kprobes-common.c @@ -13,6 +13,7 @@ #include <linux/kernel.h> #include <linux/kprobes.h> +#include <asm/opcodes.h> #include "kprobes.h" @@ -153,7 +154,8 @@ kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi, if (handler) { /* We can emulate the instruction in (possibly) modified form */ - asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist; + asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) | + (rn << 16) | reglist); asi->insn_handler = handler; return INSN_GOOD; } |