diff options
author | Jon Medhurst <tixy@yxit.co.uk> | 2011-06-06 10:07:42 -0400 |
---|---|---|
committer | Tixy <tixy@medhuaa1.miniserver.com> | 2011-07-13 13:32:49 -0400 |
commit | 6c8a192929af0383f4b0f14646af85208e9c3f00 (patch) | |
tree | 47125c9551b0122ff4f55b14f6efc7276a5e9895 /arch/arm/kernel | |
parent | 8723942f7b4501c87a95b7446786e6f4ba3779cf (diff) |
ARM: kprobes: Migrate ARM LDRD and STRD to decoding tables
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/kprobes-arm.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c index 2b43d056fff5..e590ff6603c2 100644 --- a/arch/arm/kernel/kprobes-arm.c +++ b/arch/arm/kernel/kprobes-arm.c | |||
@@ -997,6 +997,23 @@ static const union decode_item arm_1111_table[] = { | |||
997 | DECODE_END | 997 | DECODE_END |
998 | }; | 998 | }; |
999 | 999 | ||
1000 | static const union decode_item arm_cccc_000x_____1xx1_table[] = { | ||
1001 | /* LDRD/STRD lr,pc,{... cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */ | ||
1002 | DECODE_REJECT (0x0e10e0d0, 0x0000e0d0), | ||
1003 | |||
1004 | /* LDRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */ | ||
1005 | /* STRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */ | ||
1006 | DECODE_EMULATEX (0x0e5000d0, 0x000000d0, emulate_ldrdstrd, | ||
1007 | REGS(NOPCWB, NOPCX, 0, 0, NOPC)), | ||
1008 | |||
1009 | /* LDRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */ | ||
1010 | /* STRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */ | ||
1011 | DECODE_EMULATEX (0x0e5000d0, 0x004000d0, emulate_ldrdstrd, | ||
1012 | REGS(NOPCWB, NOPCX, 0, 0, 0)), | ||
1013 | |||
1014 | DECODE_END | ||
1015 | }; | ||
1016 | |||
1000 | static const union decode_item arm_cccc_000x_table[] = { | 1017 | static const union decode_item arm_cccc_000x_table[] = { |
1001 | /* Data-processing (register) */ | 1018 | /* Data-processing (register) */ |
1002 | 1019 | ||
@@ -1192,23 +1209,9 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
1192 | } | 1209 | } |
1193 | 1210 | ||
1194 | } else if ((insn & 0x0e1000d0) == 0x00000d0) { | 1211 | } else if ((insn & 0x0e1000d0) == 0x00000d0) { |
1195 | /* STRD/LDRD */ | 1212 | |
1196 | if ((insn & 0x0000e000) == 0x0000e000) | 1213 | return kprobe_decode_insn(insn, asi, arm_cccc_000x_____1xx1_table, |
1197 | return INSN_REJECTED; /* Rd is LR or PC */ | 1214 | false); |
1198 | if (is_writeback(insn) && is_r15(insn, 16)) | ||
1199 | return INSN_REJECTED; /* Writeback to PC */ | ||
1200 | |||
1201 | insn &= 0xfff00fff; | ||
1202 | insn |= 0x00002000; /* Rn = r0, Rd = r2 */ | ||
1203 | if (!(insn & (1 << 22))) { | ||
1204 | /* Register index */ | ||
1205 | insn &= ~0xf; | ||
1206 | insn |= 1; /* Rm = r1 */ | ||
1207 | } | ||
1208 | asi->insn[0] = insn; | ||
1209 | asi->insn_handler = | ||
1210 | (insn & (1 << 5)) ? emulate_strd : emulate_ldrd; | ||
1211 | return INSN_GOOD; | ||
1212 | } | 1215 | } |
1213 | 1216 | ||
1214 | /* LDRH/STRH/LDRSB/LDRSH */ | 1217 | /* LDRH/STRH/LDRSB/LDRSH */ |