aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/kprobes-decode.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index e5bc576ba3fb..4ab83f4c47cf 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -451,6 +451,14 @@ static void __kprobes simulate_blx2bx(struct kprobe *p, struct pt_regs *regs)
451 regs->ARM_cpsr |= PSR_T_BIT; 451 regs->ARM_cpsr |= PSR_T_BIT;
452} 452}
453 453
454static void __kprobes simulate_mrs(struct kprobe *p, struct pt_regs *regs)
455{
456 kprobe_opcode_t insn = p->opcode;
457 int rd = (insn >> 12) & 0xf;
458 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
459 regs->uregs[rd] = regs->ARM_cpsr & mask;
460}
461
454static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs) 462static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
455{ 463{
456 kprobe_opcode_t insn = p->opcode; 464 kprobe_opcode_t insn = p->opcode;
@@ -896,15 +904,6 @@ prep_emulate_rd12rm0(kprobe_opcode_t insn, struct arch_specific_insn *asi)
896} 904}
897 905
898static enum kprobe_insn __kprobes 906static enum kprobe_insn __kprobes
899prep_emulate_rd12(kprobe_opcode_t insn, struct arch_specific_insn *asi)
900{
901 insn &= 0xffff0fff; /* Rd = r0 */
902 asi->insn[0] = insn;
903 asi->insn_handler = emulate_rd12;
904 return INSN_GOOD;
905}
906
907static enum kprobe_insn __kprobes
908prep_emulate_rd12rn16rm0_wflags(kprobe_opcode_t insn, 907prep_emulate_rd12rn16rm0_wflags(kprobe_opcode_t insn,
909 struct arch_specific_insn *asi) 908 struct arch_specific_insn *asi)
910{ 909{
@@ -1035,8 +1034,10 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1035 return INSN_REJECTED; 1034 return INSN_REJECTED;
1036 1035
1037 /* MRS cpsr : cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */ 1036 /* MRS cpsr : cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
1038 if ((insn & 0x0ff000f0) == 0x01000000) 1037 if ((insn & 0x0ff000f0) == 0x01000000) {
1039 return prep_emulate_rd12(insn, asi); 1038 asi->insn_handler = simulate_mrs;
1039 return INSN_GOOD_NO_SLOT;
1040 }
1040 1041
1041 /* SMLALxy : cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */ 1042 /* SMLALxy : cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
1042 if ((insn & 0x0ff00090) == 0x01400080) 1043 if ((insn & 0x0ff00090) == 0x01400080)