diff options
| -rw-r--r-- | arch/arm/include/asm/kprobes.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/probes.h | 8 | ||||
| -rw-r--r-- | arch/arm/kernel/kprobes-arm.c | 16 | ||||
| -rw-r--r-- | arch/arm/kernel/kprobes-common.c | 14 | ||||
| -rw-r--r-- | arch/arm/kernel/kprobes-thumb.c | 70 | ||||
| -rw-r--r-- | arch/arm/kernel/kprobes.h | 4 | ||||
| -rw-r--r-- | arch/arm/kernel/probes-arm.c | 14 | ||||
| -rw-r--r-- | arch/arm/kernel/probes-arm.h | 12 | ||||
| -rw-r--r-- | arch/arm/kernel/probes-thumb.c | 8 | ||||
| -rw-r--r-- | arch/arm/kernel/probes-thumb.h | 4 | ||||
| -rw-r--r-- | arch/arm/kernel/probes.c | 10 | ||||
| -rw-r--r-- | arch/arm/kernel/probes.h | 4 |
12 files changed, 84 insertions, 82 deletions
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h index 6e1046661f07..49fa0dfaad33 100644 --- a/arch/arm/include/asm/kprobes.h +++ b/arch/arm/include/asm/kprobes.h | |||
| @@ -31,6 +31,8 @@ typedef u32 kprobe_opcode_t; | |||
| 31 | struct kprobe; | 31 | struct kprobe; |
| 32 | #include <asm/probes.h> | 32 | #include <asm/probes.h> |
| 33 | 33 | ||
| 34 | #define arch_specific_insn arch_probes_insn | ||
| 35 | |||
| 34 | struct prev_kprobe { | 36 | struct prev_kprobe { |
| 35 | struct kprobe *kp; | 37 | struct kprobe *kp; |
| 36 | unsigned int status; | 38 | unsigned int status; |
diff --git a/arch/arm/include/asm/probes.h b/arch/arm/include/asm/probes.h index c37252c73ee5..806cfe622a9e 100644 --- a/arch/arm/include/asm/probes.h +++ b/arch/arm/include/asm/probes.h | |||
| @@ -21,18 +21,18 @@ | |||
| 21 | 21 | ||
| 22 | typedef u32 probes_opcode_t; | 22 | typedef u32 probes_opcode_t; |
| 23 | 23 | ||
| 24 | struct arch_specific_insn; | 24 | struct arch_probes_insn; |
| 25 | typedef void (probes_insn_handler_t)(probes_opcode_t, | 25 | typedef void (probes_insn_handler_t)(probes_opcode_t, |
| 26 | struct arch_specific_insn *, | 26 | struct arch_probes_insn *, |
| 27 | struct pt_regs *); | 27 | struct pt_regs *); |
| 28 | typedef unsigned long (probes_check_cc)(unsigned long); | 28 | typedef unsigned long (probes_check_cc)(unsigned long); |
| 29 | typedef void (probes_insn_singlestep_t)(probes_opcode_t, | 29 | typedef void (probes_insn_singlestep_t)(probes_opcode_t, |
| 30 | struct arch_specific_insn *, | 30 | struct arch_probes_insn *, |
| 31 | struct pt_regs *); | 31 | struct pt_regs *); |
| 32 | typedef void (probes_insn_fn_t)(void); | 32 | typedef void (probes_insn_fn_t)(void); |
| 33 | 33 | ||
| 34 | /* Architecture specific copy of original instruction. */ | 34 | /* Architecture specific copy of original instruction. */ |
| 35 | struct arch_specific_insn { | 35 | struct arch_probes_insn { |
| 36 | probes_opcode_t *insn; | 36 | probes_opcode_t *insn; |
| 37 | probes_insn_handler_t *insn_handler; | 37 | probes_insn_handler_t *insn_handler; |
| 38 | probes_check_cc *insn_check_cc; | 38 | probes_check_cc *insn_check_cc; |
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c index d01d9f56f583..ac300c60d656 100644 --- a/arch/arm/kernel/kprobes-arm.c +++ b/arch/arm/kernel/kprobes-arm.c | |||
| @@ -74,7 +74,7 @@ | |||
| 74 | 74 | ||
| 75 | static void __kprobes | 75 | static void __kprobes |
| 76 | emulate_ldrdstrd(probes_opcode_t insn, | 76 | emulate_ldrdstrd(probes_opcode_t insn, |
| 77 | struct arch_specific_insn *asi, struct pt_regs *regs) | 77 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 78 | { | 78 | { |
| 79 | unsigned long pc = regs->ARM_pc + 4; | 79 | unsigned long pc = regs->ARM_pc + 4; |
| 80 | int rt = (insn >> 12) & 0xf; | 80 | int rt = (insn >> 12) & 0xf; |
| @@ -103,7 +103,7 @@ emulate_ldrdstrd(probes_opcode_t insn, | |||
| 103 | 103 | ||
| 104 | static void __kprobes | 104 | static void __kprobes |
| 105 | emulate_ldr(probes_opcode_t insn, | 105 | emulate_ldr(probes_opcode_t insn, |
| 106 | struct arch_specific_insn *asi, struct pt_regs *regs) | 106 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 107 | { | 107 | { |
| 108 | unsigned long pc = regs->ARM_pc + 4; | 108 | unsigned long pc = regs->ARM_pc + 4; |
| 109 | int rt = (insn >> 12) & 0xf; | 109 | int rt = (insn >> 12) & 0xf; |
| @@ -133,7 +133,7 @@ emulate_ldr(probes_opcode_t insn, | |||
| 133 | 133 | ||
| 134 | static void __kprobes | 134 | static void __kprobes |
| 135 | emulate_str(probes_opcode_t insn, | 135 | emulate_str(probes_opcode_t insn, |
| 136 | struct arch_specific_insn *asi, struct pt_regs *regs) | 136 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 137 | { | 137 | { |
| 138 | unsigned long rtpc = regs->ARM_pc - 4 + str_pc_offset; | 138 | unsigned long rtpc = regs->ARM_pc - 4 + str_pc_offset; |
| 139 | unsigned long rnpc = regs->ARM_pc + 4; | 139 | unsigned long rnpc = regs->ARM_pc + 4; |
| @@ -160,7 +160,7 @@ emulate_str(probes_opcode_t insn, | |||
| 160 | 160 | ||
| 161 | static void __kprobes | 161 | static void __kprobes |
| 162 | emulate_rd12rn16rm0rs8_rwflags(probes_opcode_t insn, | 162 | emulate_rd12rn16rm0rs8_rwflags(probes_opcode_t insn, |
| 163 | struct arch_specific_insn *asi, struct pt_regs *regs) | 163 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 164 | { | 164 | { |
| 165 | unsigned long pc = regs->ARM_pc + 4; | 165 | unsigned long pc = regs->ARM_pc + 4; |
| 166 | int rd = (insn >> 12) & 0xf; | 166 | int rd = (insn >> 12) & 0xf; |
| @@ -195,7 +195,7 @@ emulate_rd12rn16rm0rs8_rwflags(probes_opcode_t insn, | |||
| 195 | 195 | ||
| 196 | static void __kprobes | 196 | static void __kprobes |
| 197 | emulate_rd12rn16rm0_rwflags_nopc(probes_opcode_t insn, | 197 | emulate_rd12rn16rm0_rwflags_nopc(probes_opcode_t insn, |
| 198 | struct arch_specific_insn *asi, struct pt_regs *regs) | 198 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 199 | { | 199 | { |
| 200 | int rd = (insn >> 12) & 0xf; | 200 | int rd = (insn >> 12) & 0xf; |
| 201 | int rn = (insn >> 16) & 0xf; | 201 | int rn = (insn >> 16) & 0xf; |
| @@ -222,7 +222,7 @@ emulate_rd12rn16rm0_rwflags_nopc(probes_opcode_t insn, | |||
| 222 | 222 | ||
| 223 | static void __kprobes | 223 | static void __kprobes |
| 224 | emulate_rd16rn12rm0rs8_rwflags_nopc(probes_opcode_t insn, | 224 | emulate_rd16rn12rm0rs8_rwflags_nopc(probes_opcode_t insn, |
| 225 | struct arch_specific_insn *asi, | 225 | struct arch_probes_insn *asi, |
| 226 | struct pt_regs *regs) | 226 | struct pt_regs *regs) |
| 227 | { | 227 | { |
| 228 | int rd = (insn >> 16) & 0xf; | 228 | int rd = (insn >> 16) & 0xf; |
| @@ -252,7 +252,7 @@ emulate_rd16rn12rm0rs8_rwflags_nopc(probes_opcode_t insn, | |||
| 252 | 252 | ||
| 253 | static void __kprobes | 253 | static void __kprobes |
| 254 | emulate_rd12rm0_noflags_nopc(probes_opcode_t insn, | 254 | emulate_rd12rm0_noflags_nopc(probes_opcode_t insn, |
| 255 | struct arch_specific_insn *asi, struct pt_regs *regs) | 255 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 256 | { | 256 | { |
| 257 | int rd = (insn >> 12) & 0xf; | 257 | int rd = (insn >> 12) & 0xf; |
| 258 | int rm = insn & 0xf; | 258 | int rm = insn & 0xf; |
| @@ -272,7 +272,7 @@ emulate_rd12rm0_noflags_nopc(probes_opcode_t insn, | |||
| 272 | 272 | ||
| 273 | static void __kprobes | 273 | static void __kprobes |
| 274 | emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn, | 274 | emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn, |
| 275 | struct arch_specific_insn *asi, | 275 | struct arch_probes_insn *asi, |
| 276 | struct pt_regs *regs) | 276 | struct pt_regs *regs) |
| 277 | { | 277 | { |
| 278 | int rdlo = (insn >> 12) & 0xf; | 278 | int rdlo = (insn >> 12) & 0xf; |
diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c index 6159725597a1..c311ed94ff1c 100644 --- a/arch/arm/kernel/kprobes-common.c +++ b/arch/arm/kernel/kprobes-common.c | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | static void __kprobes simulate_ldm1stm1(probes_opcode_t insn, | 20 | static void __kprobes simulate_ldm1stm1(probes_opcode_t insn, |
| 21 | struct arch_specific_insn *asi, | 21 | struct arch_probes_insn *asi, |
| 22 | struct pt_regs *regs) | 22 | struct pt_regs *regs) |
| 23 | { | 23 | { |
| 24 | int rn = (insn >> 16) & 0xf; | 24 | int rn = (insn >> 16) & 0xf; |
| @@ -60,7 +60,7 @@ static void __kprobes simulate_ldm1stm1(probes_opcode_t insn, | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static void __kprobes simulate_stm1_pc(probes_opcode_t insn, | 62 | static void __kprobes simulate_stm1_pc(probes_opcode_t insn, |
| 63 | struct arch_specific_insn *asi, | 63 | struct arch_probes_insn *asi, |
| 64 | struct pt_regs *regs) | 64 | struct pt_regs *regs) |
| 65 | { | 65 | { |
| 66 | unsigned long addr = regs->ARM_pc - 4; | 66 | unsigned long addr = regs->ARM_pc - 4; |
| @@ -71,7 +71,7 @@ static void __kprobes simulate_stm1_pc(probes_opcode_t insn, | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | static void __kprobes simulate_ldm1_pc(probes_opcode_t insn, | 73 | static void __kprobes simulate_ldm1_pc(probes_opcode_t insn, |
| 74 | struct arch_specific_insn *asi, | 74 | struct arch_probes_insn *asi, |
| 75 | struct pt_regs *regs) | 75 | struct pt_regs *regs) |
| 76 | { | 76 | { |
| 77 | simulate_ldm1stm1(insn, asi, regs); | 77 | simulate_ldm1stm1(insn, asi, regs); |
| @@ -80,7 +80,7 @@ static void __kprobes simulate_ldm1_pc(probes_opcode_t insn, | |||
| 80 | 80 | ||
| 81 | static void __kprobes | 81 | static void __kprobes |
| 82 | emulate_generic_r0_12_noflags(probes_opcode_t insn, | 82 | emulate_generic_r0_12_noflags(probes_opcode_t insn, |
| 83 | struct arch_specific_insn *asi, struct pt_regs *regs) | 83 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 84 | { | 84 | { |
| 85 | register void *rregs asm("r1") = regs; | 85 | register void *rregs asm("r1") = regs; |
| 86 | register void *rfn asm("lr") = asi->insn_fn; | 86 | register void *rfn asm("lr") = asi->insn_fn; |
| @@ -108,7 +108,7 @@ emulate_generic_r0_12_noflags(probes_opcode_t insn, | |||
| 108 | 108 | ||
| 109 | static void __kprobes | 109 | static void __kprobes |
| 110 | emulate_generic_r2_14_noflags(probes_opcode_t insn, | 110 | emulate_generic_r2_14_noflags(probes_opcode_t insn, |
| 111 | struct arch_specific_insn *asi, struct pt_regs *regs) | 111 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 112 | { | 112 | { |
| 113 | emulate_generic_r0_12_noflags(insn, asi, | 113 | emulate_generic_r0_12_noflags(insn, asi, |
| 114 | (struct pt_regs *)(regs->uregs+2)); | 114 | (struct pt_regs *)(regs->uregs+2)); |
| @@ -116,7 +116,7 @@ emulate_generic_r2_14_noflags(probes_opcode_t insn, | |||
| 116 | 116 | ||
| 117 | static void __kprobes | 117 | static void __kprobes |
| 118 | emulate_ldm_r3_15(probes_opcode_t insn, | 118 | emulate_ldm_r3_15(probes_opcode_t insn, |
| 119 | struct arch_specific_insn *asi, struct pt_regs *regs) | 119 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 120 | { | 120 | { |
| 121 | emulate_generic_r0_12_noflags(insn, asi, | 121 | emulate_generic_r0_12_noflags(insn, asi, |
| 122 | (struct pt_regs *)(regs->uregs+3)); | 122 | (struct pt_regs *)(regs->uregs+3)); |
| @@ -124,7 +124,7 @@ emulate_ldm_r3_15(probes_opcode_t insn, | |||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | enum probes_insn __kprobes | 126 | enum probes_insn __kprobes |
| 127 | kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi, | 127 | kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 128 | const struct decode_header *h) | 128 | const struct decode_header *h) |
| 129 | { | 129 | { |
| 130 | probes_insn_handler_t *handler = 0; | 130 | probes_insn_handler_t *handler = 0; |
diff --git a/arch/arm/kernel/kprobes-thumb.c b/arch/arm/kernel/kprobes-thumb.c index c271d5d2810c..6619188619ae 100644 --- a/arch/arm/kernel/kprobes-thumb.c +++ b/arch/arm/kernel/kprobes-thumb.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | static void __kprobes | 25 | static void __kprobes |
| 26 | t32_simulate_table_branch(probes_opcode_t insn, | 26 | t32_simulate_table_branch(probes_opcode_t insn, |
| 27 | struct arch_specific_insn *asi, struct pt_regs *regs) | 27 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 28 | { | 28 | { |
| 29 | unsigned long pc = regs->ARM_pc; | 29 | unsigned long pc = regs->ARM_pc; |
| 30 | int rn = (insn >> 16) & 0xf; | 30 | int rn = (insn >> 16) & 0xf; |
| @@ -44,7 +44,7 @@ t32_simulate_table_branch(probes_opcode_t insn, | |||
| 44 | 44 | ||
| 45 | static void __kprobes | 45 | static void __kprobes |
| 46 | t32_simulate_mrs(probes_opcode_t insn, | 46 | t32_simulate_mrs(probes_opcode_t insn, |
| 47 | struct arch_specific_insn *asi, struct pt_regs *regs) | 47 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 48 | { | 48 | { |
| 49 | int rd = (insn >> 8) & 0xf; | 49 | int rd = (insn >> 8) & 0xf; |
| 50 | unsigned long mask = 0xf8ff03df; /* Mask out execution state */ | 50 | unsigned long mask = 0xf8ff03df; /* Mask out execution state */ |
| @@ -53,7 +53,7 @@ t32_simulate_mrs(probes_opcode_t insn, | |||
| 53 | 53 | ||
| 54 | static void __kprobes | 54 | static void __kprobes |
| 55 | t32_simulate_cond_branch(probes_opcode_t insn, | 55 | t32_simulate_cond_branch(probes_opcode_t insn, |
| 56 | struct arch_specific_insn *asi, struct pt_regs *regs) | 56 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 57 | { | 57 | { |
| 58 | unsigned long pc = regs->ARM_pc; | 58 | unsigned long pc = regs->ARM_pc; |
| 59 | 59 | ||
| @@ -67,7 +67,7 @@ t32_simulate_cond_branch(probes_opcode_t insn, | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static enum probes_insn __kprobes | 69 | static enum probes_insn __kprobes |
| 70 | t32_decode_cond_branch(probes_opcode_t insn, struct arch_specific_insn *asi, | 70 | t32_decode_cond_branch(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 71 | const struct decode_header *d) | 71 | const struct decode_header *d) |
| 72 | { | 72 | { |
| 73 | int cc = (insn >> 22) & 0xf; | 73 | int cc = (insn >> 22) & 0xf; |
| @@ -78,7 +78,7 @@ t32_decode_cond_branch(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 78 | 78 | ||
| 79 | static void __kprobes | 79 | static void __kprobes |
| 80 | t32_simulate_branch(probes_opcode_t insn, | 80 | t32_simulate_branch(probes_opcode_t insn, |
| 81 | struct arch_specific_insn *asi, struct pt_regs *regs) | 81 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 82 | { | 82 | { |
| 83 | unsigned long pc = regs->ARM_pc; | 83 | unsigned long pc = regs->ARM_pc; |
| 84 | 84 | ||
| @@ -106,7 +106,7 @@ t32_simulate_branch(probes_opcode_t insn, | |||
| 106 | 106 | ||
| 107 | static void __kprobes | 107 | static void __kprobes |
| 108 | t32_simulate_ldr_literal(probes_opcode_t insn, | 108 | t32_simulate_ldr_literal(probes_opcode_t insn, |
| 109 | struct arch_specific_insn *asi, struct pt_regs *regs) | 109 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 110 | { | 110 | { |
| 111 | unsigned long addr = regs->ARM_pc & ~3; | 111 | unsigned long addr = regs->ARM_pc & ~3; |
| 112 | int rt = (insn >> 12) & 0xf; | 112 | int rt = (insn >> 12) & 0xf; |
| @@ -143,7 +143,7 @@ t32_simulate_ldr_literal(probes_opcode_t insn, | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | static enum probes_insn __kprobes | 145 | static enum probes_insn __kprobes |
| 146 | t32_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi, | 146 | t32_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 147 | const struct decode_header *d) | 147 | const struct decode_header *d) |
| 148 | { | 148 | { |
| 149 | enum probes_insn ret = kprobe_decode_ldmstm(insn, asi, d); | 149 | enum probes_insn ret = kprobe_decode_ldmstm(insn, asi, d); |
| @@ -158,7 +158,7 @@ t32_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 158 | 158 | ||
| 159 | static void __kprobes | 159 | static void __kprobes |
| 160 | t32_emulate_ldrdstrd(probes_opcode_t insn, | 160 | t32_emulate_ldrdstrd(probes_opcode_t insn, |
| 161 | struct arch_specific_insn *asi, struct pt_regs *regs) | 161 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 162 | { | 162 | { |
| 163 | unsigned long pc = regs->ARM_pc & ~3; | 163 | unsigned long pc = regs->ARM_pc & ~3; |
| 164 | int rt1 = (insn >> 12) & 0xf; | 164 | int rt1 = (insn >> 12) & 0xf; |
| @@ -185,7 +185,7 @@ t32_emulate_ldrdstrd(probes_opcode_t insn, | |||
| 185 | 185 | ||
| 186 | static void __kprobes | 186 | static void __kprobes |
| 187 | t32_emulate_ldrstr(probes_opcode_t insn, | 187 | t32_emulate_ldrstr(probes_opcode_t insn, |
| 188 | struct arch_specific_insn *asi, struct pt_regs *regs) | 188 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 189 | { | 189 | { |
| 190 | int rt = (insn >> 12) & 0xf; | 190 | int rt = (insn >> 12) & 0xf; |
| 191 | int rn = (insn >> 16) & 0xf; | 191 | int rn = (insn >> 16) & 0xf; |
| @@ -211,7 +211,7 @@ t32_emulate_ldrstr(probes_opcode_t insn, | |||
| 211 | 211 | ||
| 212 | static void __kprobes | 212 | static void __kprobes |
| 213 | t32_emulate_rd8rn16rm0_rwflags(probes_opcode_t insn, | 213 | t32_emulate_rd8rn16rm0_rwflags(probes_opcode_t insn, |
| 214 | struct arch_specific_insn *asi, struct pt_regs *regs) | 214 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 215 | { | 215 | { |
| 216 | int rd = (insn >> 8) & 0xf; | 216 | int rd = (insn >> 8) & 0xf; |
| 217 | int rn = (insn >> 16) & 0xf; | 217 | int rn = (insn >> 16) & 0xf; |
| @@ -238,7 +238,7 @@ t32_emulate_rd8rn16rm0_rwflags(probes_opcode_t insn, | |||
| 238 | 238 | ||
| 239 | static void __kprobes | 239 | static void __kprobes |
| 240 | t32_emulate_rd8pc16_noflags(probes_opcode_t insn, | 240 | t32_emulate_rd8pc16_noflags(probes_opcode_t insn, |
| 241 | struct arch_specific_insn *asi, struct pt_regs *regs) | 241 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 242 | { | 242 | { |
| 243 | unsigned long pc = regs->ARM_pc; | 243 | unsigned long pc = regs->ARM_pc; |
| 244 | int rd = (insn >> 8) & 0xf; | 244 | int rd = (insn >> 8) & 0xf; |
| @@ -258,7 +258,7 @@ t32_emulate_rd8pc16_noflags(probes_opcode_t insn, | |||
| 258 | 258 | ||
| 259 | static void __kprobes | 259 | static void __kprobes |
| 260 | t32_emulate_rd8rn16_noflags(probes_opcode_t insn, | 260 | t32_emulate_rd8rn16_noflags(probes_opcode_t insn, |
| 261 | struct arch_specific_insn *asi, struct pt_regs *regs) | 261 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 262 | { | 262 | { |
| 263 | int rd = (insn >> 8) & 0xf; | 263 | int rd = (insn >> 8) & 0xf; |
| 264 | int rn = (insn >> 16) & 0xf; | 264 | int rn = (insn >> 16) & 0xf; |
| @@ -278,7 +278,7 @@ t32_emulate_rd8rn16_noflags(probes_opcode_t insn, | |||
| 278 | 278 | ||
| 279 | static void __kprobes | 279 | static void __kprobes |
| 280 | t32_emulate_rdlo12rdhi8rn16rm0_noflags(probes_opcode_t insn, | 280 | t32_emulate_rdlo12rdhi8rn16rm0_noflags(probes_opcode_t insn, |
| 281 | struct arch_specific_insn *asi, | 281 | struct arch_probes_insn *asi, |
| 282 | struct pt_regs *regs) | 282 | struct pt_regs *regs) |
| 283 | { | 283 | { |
| 284 | int rdlo = (insn >> 12) & 0xf; | 284 | int rdlo = (insn >> 12) & 0xf; |
| @@ -306,7 +306,7 @@ t32_emulate_rdlo12rdhi8rn16rm0_noflags(probes_opcode_t insn, | |||
| 306 | 306 | ||
| 307 | static void __kprobes | 307 | static void __kprobes |
| 308 | t16_simulate_bxblx(probes_opcode_t insn, | 308 | t16_simulate_bxblx(probes_opcode_t insn, |
| 309 | struct arch_specific_insn *asi, struct pt_regs *regs) | 309 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 310 | { | 310 | { |
| 311 | unsigned long pc = regs->ARM_pc + 2; | 311 | unsigned long pc = regs->ARM_pc + 2; |
| 312 | int rm = (insn >> 3) & 0xf; | 312 | int rm = (insn >> 3) & 0xf; |
| @@ -320,7 +320,7 @@ t16_simulate_bxblx(probes_opcode_t insn, | |||
| 320 | 320 | ||
| 321 | static void __kprobes | 321 | static void __kprobes |
| 322 | t16_simulate_ldr_literal(probes_opcode_t insn, | 322 | t16_simulate_ldr_literal(probes_opcode_t insn, |
| 323 | struct arch_specific_insn *asi, struct pt_regs *regs) | 323 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 324 | { | 324 | { |
| 325 | unsigned long *base = (unsigned long *)((regs->ARM_pc + 2) & ~3); | 325 | unsigned long *base = (unsigned long *)((regs->ARM_pc + 2) & ~3); |
| 326 | long index = insn & 0xff; | 326 | long index = insn & 0xff; |
| @@ -330,7 +330,7 @@ t16_simulate_ldr_literal(probes_opcode_t insn, | |||
| 330 | 330 | ||
| 331 | static void __kprobes | 331 | static void __kprobes |
| 332 | t16_simulate_ldrstr_sp_relative(probes_opcode_t insn, | 332 | t16_simulate_ldrstr_sp_relative(probes_opcode_t insn, |
| 333 | struct arch_specific_insn *asi, struct pt_regs *regs) | 333 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 334 | { | 334 | { |
| 335 | unsigned long* base = (unsigned long *)regs->ARM_sp; | 335 | unsigned long* base = (unsigned long *)regs->ARM_sp; |
| 336 | long index = insn & 0xff; | 336 | long index = insn & 0xff; |
| @@ -343,7 +343,7 @@ t16_simulate_ldrstr_sp_relative(probes_opcode_t insn, | |||
| 343 | 343 | ||
| 344 | static void __kprobes | 344 | static void __kprobes |
| 345 | t16_simulate_reladr(probes_opcode_t insn, | 345 | t16_simulate_reladr(probes_opcode_t insn, |
| 346 | struct arch_specific_insn *asi, struct pt_regs *regs) | 346 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 347 | { | 347 | { |
| 348 | unsigned long base = (insn & 0x800) ? regs->ARM_sp | 348 | unsigned long base = (insn & 0x800) ? regs->ARM_sp |
| 349 | : ((regs->ARM_pc + 2) & ~3); | 349 | : ((regs->ARM_pc + 2) & ~3); |
| @@ -354,7 +354,7 @@ t16_simulate_reladr(probes_opcode_t insn, | |||
| 354 | 354 | ||
| 355 | static void __kprobes | 355 | static void __kprobes |
| 356 | t16_simulate_add_sp_imm(probes_opcode_t insn, | 356 | t16_simulate_add_sp_imm(probes_opcode_t insn, |
| 357 | struct arch_specific_insn *asi, struct pt_regs *regs) | 357 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 358 | { | 358 | { |
| 359 | long imm = insn & 0x7f; | 359 | long imm = insn & 0x7f; |
| 360 | if (insn & 0x80) /* SUB */ | 360 | if (insn & 0x80) /* SUB */ |
| @@ -365,7 +365,7 @@ t16_simulate_add_sp_imm(probes_opcode_t insn, | |||
| 365 | 365 | ||
| 366 | static void __kprobes | 366 | static void __kprobes |
| 367 | t16_simulate_cbz(probes_opcode_t insn, | 367 | t16_simulate_cbz(probes_opcode_t insn, |
| 368 | struct arch_specific_insn *asi, struct pt_regs *regs) | 368 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 369 | { | 369 | { |
| 370 | int rn = insn & 0x7; | 370 | int rn = insn & 0x7; |
| 371 | probes_opcode_t nonzero = regs->uregs[rn] ? insn : ~insn; | 371 | probes_opcode_t nonzero = regs->uregs[rn] ? insn : ~insn; |
| @@ -379,7 +379,7 @@ t16_simulate_cbz(probes_opcode_t insn, | |||
| 379 | 379 | ||
| 380 | static void __kprobes | 380 | static void __kprobes |
| 381 | t16_simulate_it(probes_opcode_t insn, | 381 | t16_simulate_it(probes_opcode_t insn, |
| 382 | struct arch_specific_insn *asi, struct pt_regs *regs) | 382 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 383 | { | 383 | { |
| 384 | /* | 384 | /* |
| 385 | * The 8 IT state bits are split into two parts in CPSR: | 385 | * The 8 IT state bits are split into two parts in CPSR: |
| @@ -396,14 +396,14 @@ t16_simulate_it(probes_opcode_t insn, | |||
| 396 | 396 | ||
| 397 | static void __kprobes | 397 | static void __kprobes |
| 398 | t16_singlestep_it(probes_opcode_t insn, | 398 | t16_singlestep_it(probes_opcode_t insn, |
| 399 | struct arch_specific_insn *asi, struct pt_regs *regs) | 399 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 400 | { | 400 | { |
| 401 | regs->ARM_pc += 2; | 401 | regs->ARM_pc += 2; |
| 402 | t16_simulate_it(insn, asi, regs); | 402 | t16_simulate_it(insn, asi, regs); |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | static enum probes_insn __kprobes | 405 | static enum probes_insn __kprobes |
| 406 | t16_decode_it(probes_opcode_t insn, struct arch_specific_insn *asi, | 406 | t16_decode_it(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 407 | const struct decode_header *d) | 407 | const struct decode_header *d) |
| 408 | { | 408 | { |
| 409 | asi->insn_singlestep = t16_singlestep_it; | 409 | asi->insn_singlestep = t16_singlestep_it; |
| @@ -412,7 +412,7 @@ t16_decode_it(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 412 | 412 | ||
| 413 | static void __kprobes | 413 | static void __kprobes |
| 414 | t16_simulate_cond_branch(probes_opcode_t insn, | 414 | t16_simulate_cond_branch(probes_opcode_t insn, |
| 415 | struct arch_specific_insn *asi, struct pt_regs *regs) | 415 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 416 | { | 416 | { |
| 417 | unsigned long pc = regs->ARM_pc + 2; | 417 | unsigned long pc = regs->ARM_pc + 2; |
| 418 | long offset = insn & 0x7f; | 418 | long offset = insn & 0x7f; |
| @@ -421,7 +421,7 @@ t16_simulate_cond_branch(probes_opcode_t insn, | |||
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | static enum probes_insn __kprobes | 423 | static enum probes_insn __kprobes |
| 424 | t16_decode_cond_branch(probes_opcode_t insn, struct arch_specific_insn *asi, | 424 | t16_decode_cond_branch(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 425 | const struct decode_header *d) | 425 | const struct decode_header *d) |
| 426 | { | 426 | { |
| 427 | int cc = (insn >> 8) & 0xf; | 427 | int cc = (insn >> 8) & 0xf; |
| @@ -432,7 +432,7 @@ t16_decode_cond_branch(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 432 | 432 | ||
| 433 | static void __kprobes | 433 | static void __kprobes |
| 434 | t16_simulate_branch(probes_opcode_t insn, | 434 | t16_simulate_branch(probes_opcode_t insn, |
| 435 | struct arch_specific_insn *asi, struct pt_regs *regs) | 435 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 436 | { | 436 | { |
| 437 | unsigned long pc = regs->ARM_pc + 2; | 437 | unsigned long pc = regs->ARM_pc + 2; |
| 438 | long offset = insn & 0x3ff; | 438 | long offset = insn & 0x3ff; |
| @@ -442,7 +442,7 @@ t16_simulate_branch(probes_opcode_t insn, | |||
| 442 | 442 | ||
| 443 | static unsigned long __kprobes | 443 | static unsigned long __kprobes |
| 444 | t16_emulate_loregs(probes_opcode_t insn, | 444 | t16_emulate_loregs(probes_opcode_t insn, |
| 445 | struct arch_specific_insn *asi, struct pt_regs *regs) | 445 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 446 | { | 446 | { |
| 447 | unsigned long oldcpsr = regs->ARM_cpsr; | 447 | unsigned long oldcpsr = regs->ARM_cpsr; |
| 448 | unsigned long newcpsr; | 448 | unsigned long newcpsr; |
| @@ -465,14 +465,14 @@ t16_emulate_loregs(probes_opcode_t insn, | |||
| 465 | 465 | ||
| 466 | static void __kprobes | 466 | static void __kprobes |
| 467 | t16_emulate_loregs_rwflags(probes_opcode_t insn, | 467 | t16_emulate_loregs_rwflags(probes_opcode_t insn, |
| 468 | struct arch_specific_insn *asi, struct pt_regs *regs) | 468 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 469 | { | 469 | { |
| 470 | regs->ARM_cpsr = t16_emulate_loregs(insn, asi, regs); | 470 | regs->ARM_cpsr = t16_emulate_loregs(insn, asi, regs); |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | static void __kprobes | 473 | static void __kprobes |
| 474 | t16_emulate_loregs_noitrwflags(probes_opcode_t insn, | 474 | t16_emulate_loregs_noitrwflags(probes_opcode_t insn, |
| 475 | struct arch_specific_insn *asi, struct pt_regs *regs) | 475 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 476 | { | 476 | { |
| 477 | unsigned long cpsr = t16_emulate_loregs(insn, asi, regs); | 477 | unsigned long cpsr = t16_emulate_loregs(insn, asi, regs); |
| 478 | if (!in_it_block(cpsr)) | 478 | if (!in_it_block(cpsr)) |
| @@ -481,7 +481,7 @@ t16_emulate_loregs_noitrwflags(probes_opcode_t insn, | |||
| 481 | 481 | ||
| 482 | static void __kprobes | 482 | static void __kprobes |
| 483 | t16_emulate_hiregs(probes_opcode_t insn, | 483 | t16_emulate_hiregs(probes_opcode_t insn, |
| 484 | struct arch_specific_insn *asi, struct pt_regs *regs) | 484 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 485 | { | 485 | { |
| 486 | unsigned long pc = regs->ARM_pc + 2; | 486 | unsigned long pc = regs->ARM_pc + 2; |
| 487 | int rdn = (insn & 0x7) | ((insn & 0x80) >> 4); | 487 | int rdn = (insn & 0x7) | ((insn & 0x80) >> 4); |
| @@ -511,7 +511,7 @@ t16_emulate_hiregs(probes_opcode_t insn, | |||
| 511 | } | 511 | } |
| 512 | 512 | ||
| 513 | static enum probes_insn __kprobes | 513 | static enum probes_insn __kprobes |
| 514 | t16_decode_hiregs(probes_opcode_t insn, struct arch_specific_insn *asi, | 514 | t16_decode_hiregs(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 515 | const struct decode_header *d) | 515 | const struct decode_header *d) |
| 516 | { | 516 | { |
| 517 | insn &= ~0x00ff; | 517 | insn &= ~0x00ff; |
| @@ -523,7 +523,7 @@ t16_decode_hiregs(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 523 | 523 | ||
| 524 | static void __kprobes | 524 | static void __kprobes |
| 525 | t16_emulate_push(probes_opcode_t insn, | 525 | t16_emulate_push(probes_opcode_t insn, |
| 526 | struct arch_specific_insn *asi, struct pt_regs *regs) | 526 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 527 | { | 527 | { |
| 528 | __asm__ __volatile__ ( | 528 | __asm__ __volatile__ ( |
| 529 | "ldr r9, [%[regs], #13*4] \n\t" | 529 | "ldr r9, [%[regs], #13*4] \n\t" |
| @@ -539,7 +539,7 @@ t16_emulate_push(probes_opcode_t insn, | |||
| 539 | } | 539 | } |
| 540 | 540 | ||
| 541 | static enum probes_insn __kprobes | 541 | static enum probes_insn __kprobes |
| 542 | t16_decode_push(probes_opcode_t insn, struct arch_specific_insn *asi, | 542 | t16_decode_push(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 543 | const struct decode_header *d) | 543 | const struct decode_header *d) |
| 544 | { | 544 | { |
| 545 | /* | 545 | /* |
| @@ -555,7 +555,7 @@ t16_decode_push(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 555 | 555 | ||
| 556 | static void __kprobes | 556 | static void __kprobes |
| 557 | t16_emulate_pop_nopc(probes_opcode_t insn, | 557 | t16_emulate_pop_nopc(probes_opcode_t insn, |
| 558 | struct arch_specific_insn *asi, struct pt_regs *regs) | 558 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 559 | { | 559 | { |
| 560 | __asm__ __volatile__ ( | 560 | __asm__ __volatile__ ( |
| 561 | "ldr r9, [%[regs], #13*4] \n\t" | 561 | "ldr r9, [%[regs], #13*4] \n\t" |
| @@ -572,7 +572,7 @@ t16_emulate_pop_nopc(probes_opcode_t insn, | |||
| 572 | 572 | ||
| 573 | static void __kprobes | 573 | static void __kprobes |
| 574 | t16_emulate_pop_pc(probes_opcode_t insn, | 574 | t16_emulate_pop_pc(probes_opcode_t insn, |
| 575 | struct arch_specific_insn *asi, struct pt_regs *regs) | 575 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 576 | { | 576 | { |
| 577 | register unsigned long pc asm("r8"); | 577 | register unsigned long pc asm("r8"); |
| 578 | 578 | ||
| @@ -592,7 +592,7 @@ t16_emulate_pop_pc(probes_opcode_t insn, | |||
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | static enum probes_insn __kprobes | 594 | static enum probes_insn __kprobes |
| 595 | t16_decode_pop(probes_opcode_t insn, struct arch_specific_insn *asi, | 595 | t16_decode_pop(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 596 | const struct decode_header *d) | 596 | const struct decode_header *d) |
| 597 | { | 597 | { |
| 598 | /* | 598 | /* |
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h index d0a24b73bcfa..9a2712ecefc3 100644 --- a/arch/arm/kernel/kprobes.h +++ b/arch/arm/kernel/kprobes.h | |||
| @@ -30,11 +30,11 @@ | |||
| 30 | #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 | 30 | #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 |
| 31 | 31 | ||
| 32 | enum probes_insn __kprobes | 32 | enum probes_insn __kprobes |
| 33 | kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi, | 33 | kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_probes_insn *asi, |
| 34 | const struct decode_header *h); | 34 | const struct decode_header *h); |
| 35 | 35 | ||
| 36 | typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t, | 36 | typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t, |
| 37 | struct arch_specific_insn *, | 37 | struct arch_probes_insn *, |
| 38 | bool, | 38 | bool, |
| 39 | const union decode_action *); | 39 | const union decode_action *); |
| 40 | 40 | ||
diff --git a/arch/arm/kernel/probes-arm.c b/arch/arm/kernel/probes-arm.c index 8e7fde876521..51a13a027989 100644 --- a/arch/arm/kernel/probes-arm.c +++ b/arch/arm/kernel/probes-arm.c | |||
| @@ -58,7 +58,7 @@ | |||
| 58 | */ | 58 | */ |
| 59 | 59 | ||
| 60 | void __kprobes simulate_bbl(probes_opcode_t insn, | 60 | void __kprobes simulate_bbl(probes_opcode_t insn, |
| 61 | struct arch_specific_insn *asi, struct pt_regs *regs) | 61 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 62 | { | 62 | { |
| 63 | long iaddr = (long) regs->ARM_pc - 4; | 63 | long iaddr = (long) regs->ARM_pc - 4; |
| 64 | int disp = branch_displacement(insn); | 64 | int disp = branch_displacement(insn); |
| @@ -70,7 +70,7 @@ void __kprobes simulate_bbl(probes_opcode_t insn, | |||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | void __kprobes simulate_blx1(probes_opcode_t insn, | 72 | void __kprobes simulate_blx1(probes_opcode_t insn, |
| 73 | struct arch_specific_insn *asi, struct pt_regs *regs) | 73 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 74 | { | 74 | { |
| 75 | long iaddr = (long) regs->ARM_pc - 4; | 75 | long iaddr = (long) regs->ARM_pc - 4; |
| 76 | int disp = branch_displacement(insn); | 76 | int disp = branch_displacement(insn); |
| @@ -81,7 +81,7 @@ void __kprobes simulate_blx1(probes_opcode_t insn, | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | void __kprobes simulate_blx2bx(probes_opcode_t insn, | 83 | void __kprobes simulate_blx2bx(probes_opcode_t insn, |
| 84 | struct arch_specific_insn *asi, struct pt_regs *regs) | 84 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 85 | { | 85 | { |
| 86 | int rm = insn & 0xf; | 86 | int rm = insn & 0xf; |
| 87 | long rmv = regs->uregs[rm]; | 87 | long rmv = regs->uregs[rm]; |
| @@ -96,7 +96,7 @@ void __kprobes simulate_blx2bx(probes_opcode_t insn, | |||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | void __kprobes simulate_mrs(probes_opcode_t insn, | 98 | void __kprobes simulate_mrs(probes_opcode_t insn, |
| 99 | struct arch_specific_insn *asi, struct pt_regs *regs) | 99 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 100 | { | 100 | { |
| 101 | int rd = (insn >> 12) & 0xf; | 101 | int rd = (insn >> 12) & 0xf; |
| 102 | unsigned long mask = 0xf8ff03df; /* Mask out execution state */ | 102 | unsigned long mask = 0xf8ff03df; /* Mask out execution state */ |
| @@ -104,7 +104,7 @@ void __kprobes simulate_mrs(probes_opcode_t insn, | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | void __kprobes simulate_mov_ipsp(probes_opcode_t insn, | 106 | void __kprobes simulate_mov_ipsp(probes_opcode_t insn, |
| 107 | struct arch_specific_insn *asi, struct pt_regs *regs) | 107 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 108 | { | 108 | { |
| 109 | regs->uregs[12] = regs->uregs[13]; | 109 | regs->uregs[12] = regs->uregs[13]; |
| 110 | } | 110 | } |
| @@ -705,7 +705,7 @@ EXPORT_SYMBOL_GPL(probes_decode_arm_table); | |||
| 705 | #endif | 705 | #endif |
| 706 | 706 | ||
| 707 | static void __kprobes arm_singlestep(probes_opcode_t insn, | 707 | static void __kprobes arm_singlestep(probes_opcode_t insn, |
| 708 | struct arch_specific_insn *asi, struct pt_regs *regs) | 708 | struct arch_probes_insn *asi, struct pt_regs *regs) |
| 709 | { | 709 | { |
| 710 | regs->ARM_pc += 4; | 710 | regs->ARM_pc += 4; |
| 711 | asi->insn_handler(insn, asi, regs); | 711 | asi->insn_handler(insn, asi, regs); |
| @@ -724,7 +724,7 @@ static void __kprobes arm_singlestep(probes_opcode_t insn, | |||
| 724 | * should also be very rare. | 724 | * should also be very rare. |
| 725 | */ | 725 | */ |
| 726 | enum probes_insn __kprobes | 726 | enum probes_insn __kprobes |
| 727 | arm_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 727 | arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 728 | bool emulate, const union decode_action *actions) | 728 | bool emulate, const union decode_action *actions) |
| 729 | { | 729 | { |
| 730 | asi->insn_singlestep = arm_singlestep; | 730 | asi->insn_singlestep = arm_singlestep; |
diff --git a/arch/arm/kernel/probes-arm.h b/arch/arm/kernel/probes-arm.h index ea614dc5aaa3..ace6572f6e26 100644 --- a/arch/arm/kernel/probes-arm.h +++ b/arch/arm/kernel/probes-arm.h | |||
| @@ -54,20 +54,20 @@ enum probes_arm_action { | |||
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | void __kprobes simulate_bbl(probes_opcode_t opcode, | 56 | void __kprobes simulate_bbl(probes_opcode_t opcode, |
| 57 | struct arch_specific_insn *asi, struct pt_regs *regs); | 57 | struct arch_probes_insn *asi, struct pt_regs *regs); |
| 58 | void __kprobes simulate_blx1(probes_opcode_t opcode, | 58 | void __kprobes simulate_blx1(probes_opcode_t opcode, |
| 59 | struct arch_specific_insn *asi, struct pt_regs *regs); | 59 | struct arch_probes_insn *asi, struct pt_regs *regs); |
| 60 | void __kprobes simulate_blx2bx(probes_opcode_t opcode, | 60 | void __kprobes simulate_blx2bx(probes_opcode_t opcode, |
| 61 | struct arch_specific_insn *asi, struct pt_regs *regs); | 61 | struct arch_probes_insn *asi, struct pt_regs *regs); |
| 62 | void __kprobes simulate_mrs(probes_opcode_t opcode, | 62 | void __kprobes simulate_mrs(probes_opcode_t opcode, |
| 63 | struct arch_specific_insn *asi, struct pt_regs *regs); | 63 | struct arch_probes_insn *asi, struct pt_regs *regs); |
| 64 | void __kprobes simulate_mov_ipsp(probes_opcode_t opcode, | 64 | void __kprobes simulate_mov_ipsp(probes_opcode_t opcode, |
| 65 | struct arch_specific_insn *asi, struct pt_regs *regs); | 65 | struct arch_probes_insn *asi, struct pt_regs *regs); |
| 66 | 66 | ||
| 67 | extern const union decode_item probes_decode_arm_table[]; | 67 | extern const union decode_item probes_decode_arm_table[]; |
| 68 | 68 | ||
| 69 | enum probes_insn arm_probes_decode_insn(probes_opcode_t, | 69 | enum probes_insn arm_probes_decode_insn(probes_opcode_t, |
| 70 | struct arch_specific_insn *, bool emulate, | 70 | struct arch_probes_insn *, bool emulate, |
| 71 | const union decode_action *actions); | 71 | const union decode_action *actions); |
| 72 | 72 | ||
| 73 | #endif | 73 | #endif |
diff --git a/arch/arm/kernel/probes-thumb.c b/arch/arm/kernel/probes-thumb.c index 23e2cbdb37cb..4131351e812f 100644 --- a/arch/arm/kernel/probes-thumb.c +++ b/arch/arm/kernel/probes-thumb.c | |||
| @@ -844,7 +844,7 @@ static unsigned long __kprobes thumb_check_cc(unsigned long cpsr) | |||
| 844 | } | 844 | } |
| 845 | 845 | ||
| 846 | static void __kprobes thumb16_singlestep(probes_opcode_t opcode, | 846 | static void __kprobes thumb16_singlestep(probes_opcode_t opcode, |
| 847 | struct arch_specific_insn *asi, | 847 | struct arch_probes_insn *asi, |
| 848 | struct pt_regs *regs) | 848 | struct pt_regs *regs) |
| 849 | { | 849 | { |
| 850 | regs->ARM_pc += 2; | 850 | regs->ARM_pc += 2; |
| @@ -853,7 +853,7 @@ static void __kprobes thumb16_singlestep(probes_opcode_t opcode, | |||
| 853 | } | 853 | } |
| 854 | 854 | ||
| 855 | static void __kprobes thumb32_singlestep(probes_opcode_t opcode, | 855 | static void __kprobes thumb32_singlestep(probes_opcode_t opcode, |
| 856 | struct arch_specific_insn *asi, | 856 | struct arch_probes_insn *asi, |
| 857 | struct pt_regs *regs) | 857 | struct pt_regs *regs) |
| 858 | { | 858 | { |
| 859 | regs->ARM_pc += 4; | 859 | regs->ARM_pc += 4; |
| @@ -862,7 +862,7 @@ static void __kprobes thumb32_singlestep(probes_opcode_t opcode, | |||
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | enum probes_insn __kprobes | 864 | enum probes_insn __kprobes |
| 865 | thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 865 | thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 866 | bool emulate, const union decode_action *actions) | 866 | bool emulate, const union decode_action *actions) |
| 867 | { | 867 | { |
| 868 | asi->insn_singlestep = thumb16_singlestep; | 868 | asi->insn_singlestep = thumb16_singlestep; |
| @@ -872,7 +872,7 @@ thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 872 | } | 872 | } |
| 873 | 873 | ||
| 874 | enum probes_insn __kprobes | 874 | enum probes_insn __kprobes |
| 875 | thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 875 | thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 876 | bool emulate, const union decode_action *actions) | 876 | bool emulate, const union decode_action *actions) |
| 877 | { | 877 | { |
| 878 | asi->insn_singlestep = thumb32_singlestep; | 878 | asi->insn_singlestep = thumb32_singlestep; |
diff --git a/arch/arm/kernel/probes-thumb.h b/arch/arm/kernel/probes-thumb.h index 65e4250e9b78..7c6f6ebe514f 100644 --- a/arch/arm/kernel/probes-thumb.h +++ b/arch/arm/kernel/probes-thumb.h | |||
| @@ -88,10 +88,10 @@ extern const union decode_item probes_decode_thumb32_table[]; | |||
| 88 | extern const union decode_item probes_decode_thumb16_table[]; | 88 | extern const union decode_item probes_decode_thumb16_table[]; |
| 89 | 89 | ||
| 90 | enum probes_insn __kprobes | 90 | enum probes_insn __kprobes |
| 91 | thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 91 | thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 92 | bool emulate, const union decode_action *actions); | 92 | bool emulate, const union decode_action *actions); |
| 93 | enum probes_insn __kprobes | 93 | enum probes_insn __kprobes |
| 94 | thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 94 | thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 95 | bool emulate, const union decode_action *actions); | 95 | bool emulate, const union decode_action *actions); |
| 96 | 96 | ||
| 97 | #endif | 97 | #endif |
diff --git a/arch/arm/kernel/probes.c b/arch/arm/kernel/probes.c index f9dff12cf85c..b41873f33e69 100644 --- a/arch/arm/kernel/probes.c +++ b/arch/arm/kernel/probes.c | |||
| @@ -176,13 +176,13 @@ probes_check_cc * const probes_condition_checks[16] = { | |||
| 176 | 176 | ||
| 177 | 177 | ||
| 178 | void __kprobes probes_simulate_nop(probes_opcode_t opcode, | 178 | void __kprobes probes_simulate_nop(probes_opcode_t opcode, |
| 179 | struct arch_specific_insn *asi, | 179 | struct arch_probes_insn *asi, |
| 180 | struct pt_regs *regs) | 180 | struct pt_regs *regs) |
| 181 | { | 181 | { |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | void __kprobes probes_emulate_none(probes_opcode_t opcode, | 184 | void __kprobes probes_emulate_none(probes_opcode_t opcode, |
| 185 | struct arch_specific_insn *asi, | 185 | struct arch_probes_insn *asi, |
| 186 | struct pt_regs *regs) | 186 | struct pt_regs *regs) |
| 187 | { | 187 | { |
| 188 | asi->insn_fn(); | 188 | asi->insn_fn(); |
| @@ -196,7 +196,7 @@ void __kprobes probes_emulate_none(probes_opcode_t opcode, | |||
| 196 | * emulation handler is called. | 196 | * emulation handler is called. |
| 197 | */ | 197 | */ |
| 198 | static probes_opcode_t __kprobes | 198 | static probes_opcode_t __kprobes |
| 199 | prepare_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 199 | prepare_emulated_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 200 | bool thumb) | 200 | bool thumb) |
| 201 | { | 201 | { |
| 202 | #ifdef CONFIG_THUMB2_KERNEL | 202 | #ifdef CONFIG_THUMB2_KERNEL |
| @@ -221,7 +221,7 @@ prepare_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
| 221 | * prepare_emulated_insn | 221 | * prepare_emulated_insn |
| 222 | */ | 222 | */ |
| 223 | static void __kprobes | 223 | static void __kprobes |
| 224 | set_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 224 | set_emulated_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 225 | bool thumb) | 225 | bool thumb) |
| 226 | { | 226 | { |
| 227 | #ifdef CONFIG_THUMB2_KERNEL | 227 | #ifdef CONFIG_THUMB2_KERNEL |
| @@ -385,7 +385,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = { | |||
| 385 | * | 385 | * |
| 386 | */ | 386 | */ |
| 387 | int __kprobes | 387 | int __kprobes |
| 388 | probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 388 | probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 389 | const union decode_item *table, bool thumb, | 389 | const union decode_item *table, bool thumb, |
| 390 | bool emulate, const union decode_action *actions) | 390 | bool emulate, const union decode_action *actions) |
| 391 | { | 391 | { |
diff --git a/arch/arm/kernel/probes.h b/arch/arm/kernel/probes.h index 33cc30c50cf5..dba9f2466a93 100644 --- a/arch/arm/kernel/probes.h +++ b/arch/arm/kernel/probes.h | |||
| @@ -306,7 +306,7 @@ union decode_item { | |||
| 306 | 306 | ||
| 307 | struct decode_header; | 307 | struct decode_header; |
| 308 | typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t, | 308 | typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t, |
| 309 | struct arch_specific_insn *, | 309 | struct arch_probes_insn *, |
| 310 | const struct decode_header *); | 310 | const struct decode_header *); |
| 311 | 311 | ||
| 312 | union decode_action { | 312 | union decode_action { |
| @@ -400,7 +400,7 @@ probes_insn_handler_t probes_simulate_nop; | |||
| 400 | probes_insn_handler_t probes_emulate_none; | 400 | probes_insn_handler_t probes_emulate_none; |
| 401 | 401 | ||
| 402 | int __kprobes | 402 | int __kprobes |
| 403 | probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | 403 | probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi, |
| 404 | const union decode_item *table, bool thumb, bool emulate, | 404 | const union decode_item *table, bool thumb, bool emulate, |
| 405 | const union decode_action *actions); | 405 | const union decode_action *actions); |
| 406 | 406 | ||
