aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/kprobes-thumb.c
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-07-03 09:52:18 -0400
committerTixy <tixy@medhuaa1.miniserver.com>2011-07-13 13:32:46 -0400
commitb06f3ee34d8b817d566d15d25a21f8320b3f7c57 (patch)
treea25e558b98ff6088680dcb4e207d74e9589cd06e /arch/arm/kernel/kprobes-thumb.c
parent7848786a7a198dd5e097330ad0cbfdf155a25499 (diff)
ARM: kprobes: Decode 32-bit miscellaneous control instructions
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel/kprobes-thumb.c')
-rw-r--r--arch/arm/kernel/kprobes-thumb.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/kernel/kprobes-thumb.c b/arch/arm/kernel/kprobes-thumb.c
index 1fbeba8093f1..c07c2470ccaa 100644
--- a/arch/arm/kernel/kprobes-thumb.c
+++ b/arch/arm/kernel/kprobes-thumb.c
@@ -57,6 +57,15 @@ t32_simulate_table_branch(struct kprobe *p, struct pt_regs *regs)
57 regs->ARM_pc = pc + 2 * halfwords; 57 regs->ARM_pc = pc + 2 * halfwords;
58} 58}
59 59
60static void __kprobes
61t32_simulate_mrs(struct kprobe *p, struct pt_regs *regs)
62{
63 kprobe_opcode_t insn = p->opcode;
64 int rd = (insn >> 8) & 0xf;
65 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
66 regs->uregs[rd] = regs->ARM_cpsr & mask;
67}
68
60static enum kprobe_insn __kprobes 69static enum kprobe_insn __kprobes
61t32_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi) 70t32_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
62{ 71{
@@ -394,6 +403,28 @@ static const union decode_item t32_table_1111_0xxx___1[] = {
394 /* WFI 1111 0011 1010 xxxx 10x0 x000 0000 0011 */ 403 /* WFI 1111 0011 1010 xxxx 10x0 x000 0000 0011 */
395 DECODE_SIMULATE (0xfff0d7fc, 0xf3a08000, kprobe_simulate_nop), 404 DECODE_SIMULATE (0xfff0d7fc, 0xf3a08000, kprobe_simulate_nop),
396 405
406 /* MRS Rd, CPSR 1111 0011 1110 xxxx 10x0 xxxx xxxx xxxx */
407 DECODE_SIMULATEX(0xfff0d000, 0xf3e08000, t32_simulate_mrs,
408 REGS(0, 0, NOSPPC, 0, 0)),
409
410 /*
411 * Unsupported instructions
412 * 1111 0x11 1xxx xxxx 10x0 xxxx xxxx xxxx
413 *
414 * MSR 1111 0011 100x xxxx 10x0 xxxx xxxx xxxx
415 * DBG hint 1111 0011 1010 xxxx 10x0 x000 1111 xxxx
416 * Unallocated hints 1111 0011 1010 xxxx 10x0 x000 xxxx xxxx
417 * CPS 1111 0011 1010 xxxx 10x0 xxxx xxxx xxxx
418 * CLREX/DSB/DMB/ISB 1111 0011 1011 xxxx 10x0 xxxx xxxx xxxx
419 * BXJ 1111 0011 1100 xxxx 10x0 xxxx xxxx xxxx
420 * SUBS PC,LR,#<imm8> 1111 0011 1101 xxxx 10x0 xxxx xxxx xxxx
421 * MRS Rd, SPSR 1111 0011 1111 xxxx 10x0 xxxx xxxx xxxx
422 * SMC 1111 0111 1111 xxxx 1000 xxxx xxxx xxxx
423 * UNDEFINED 1111 0111 1111 xxxx 1010 xxxx xxxx xxxx
424 * ??? 1111 0111 1xxx xxxx 1010 xxxx xxxx xxxx
425 */
426 DECODE_REJECT (0xfb80d000, 0xf3808000),
427
397 DECODE_END 428 DECODE_END
398}; 429};
399 430