aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/kprobes-arm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 8e4b7185f9fb..2b43d056fff5 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -894,6 +894,35 @@ prep_emulate_rdhi16rdlo12rs8rm0_wflags(kprobe_opcode_t insn,
894} 894}
895 895
896static void __kprobes 896static void __kprobes
897emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs)
898{
899 kprobe_opcode_t insn = p->opcode;
900 unsigned long pc = (unsigned long)p->addr + 8;
901 int rt = (insn >> 12) & 0xf;
902 int rn = (insn >> 16) & 0xf;
903 int rm = insn & 0xf;
904
905 register unsigned long rtv asm("r0") = regs->uregs[rt];
906 register unsigned long rt2v asm("r1") = regs->uregs[rt+1];
907 register unsigned long rnv asm("r2") = (rn == 15) ? pc
908 : regs->uregs[rn];
909 register unsigned long rmv asm("r3") = regs->uregs[rm];
910
911 __asm__ __volatile__ (
912 BLX("%[fn]")
913 : "=r" (rtv), "=r" (rt2v), "=r" (rnv)
914 : "0" (rtv), "1" (rt2v), "2" (rnv), "r" (rmv),
915 [fn] "r" (p->ainsn.insn_fn)
916 : "lr", "memory", "cc"
917 );
918
919 regs->uregs[rt] = rtv;
920 regs->uregs[rt+1] = rt2v;
921 if (is_writeback(insn))
922 regs->uregs[rn] = rnv;
923}
924
925static void __kprobes
897emulate_rd12rn16rm0rs8_rwflags(struct kprobe *p, struct pt_regs *regs) 926emulate_rd12rn16rm0rs8_rwflags(struct kprobe *p, struct pt_regs *regs)
898{ 927{
899 kprobe_opcode_t insn = p->opcode; 928 kprobe_opcode_t insn = p->opcode;