aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/kprobes.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/kprobes.c')
-rw-r--r--arch/arm/kernel/kprobes.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 8795f9f819d5..6d644202c8dc 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -26,6 +26,7 @@
26#include <linux/stop_machine.h> 26#include <linux/stop_machine.h>
27#include <linux/stringify.h> 27#include <linux/stringify.h>
28#include <asm/traps.h> 28#include <asm/traps.h>
29#include <asm/opcodes.h>
29#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
30#include <linux/percpu.h> 31#include <linux/percpu.h>
31#include <linux/bug.h> 32#include <linux/bug.h>
@@ -67,10 +68,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
67#ifdef CONFIG_THUMB2_KERNEL 68#ifdef CONFIG_THUMB2_KERNEL
68 thumb = true; 69 thumb = true;
69 addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */ 70 addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */
70 insn = ((u16 *)addr)[0]; 71 insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
71 if (is_wide_instruction(insn)) { 72 if (is_wide_instruction(insn)) {
72 insn <<= 16; 73 u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
73 insn |= ((u16 *)addr)[1]; 74 insn = __opcode_thumb32_compose(insn, inst2);
74 decode_insn = thumb32_probes_decode_insn; 75 decode_insn = thumb32_probes_decode_insn;
75 actions = kprobes_t32_actions; 76 actions = kprobes_t32_actions;
76 } else { 77 } else {
@@ -81,7 +82,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
81 thumb = false; 82 thumb = false;
82 if (addr & 0x3) 83 if (addr & 0x3)
83 return -EINVAL; 84 return -EINVAL;
84 insn = *p->addr; 85 insn = __mem_to_opcode_arm(*p->addr);
85 decode_insn = arm_probes_decode_insn; 86 decode_insn = arm_probes_decode_insn;
86 actions = kprobes_arm_actions; 87 actions = kprobes_arm_actions;
87#endif 88#endif