Skip to content

Commit 47e190f

Browse files
author
David A. Long
committed
ARM: Change the remaining shared kprobes/uprobes symbols to something generic
Any more ARM kprobes/uprobes symbols which have "kprobe" in the name must be changed to the more generic "probes" or other non-kprobes specific symbol. Signed-off-by: David A. Long <dave.long@linaro.org> Acked-by: Jon Medhurst <tixy@linaro.org>
1 parent 44a0a59 commit 47e190f

11 files changed

Lines changed: 69 additions & 73 deletions

File tree

‎arch/arm/include/asm/probes.h‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,25 @@
1919
#ifndef _ASM_PROBES_H
2020
#define _ASM_PROBES_H
2121

22-
struct kprobe;
2322
typedef u32 probes_opcode_t;
2423

2524
struct arch_specific_insn;
26-
typedef void (kprobe_insn_handler_t)(probes_opcode_t,
25+
typedef void (probes_insn_handler_t)(probes_opcode_t,
2726
struct arch_specific_insn *,
2827
struct pt_regs *);
2928
typedef unsigned long (probes_check_cc)(unsigned long);
30-
typedef void (kprobe_insn_singlestep_t)(probes_opcode_t,
29+
typedef void (probes_insn_singlestep_t)(probes_opcode_t,
3130
struct arch_specific_insn *,
3231
struct pt_regs *);
33-
typedef void (kprobe_insn_fn_t)(void);
32+
typedef void (probes_insn_fn_t)(void);
3433

3534
/* Architecture specific copy of original instruction. */
3635
struct arch_specific_insn {
3736
probes_opcode_t *insn;
38-
kprobe_insn_handler_t *insn_handler;
37+
probes_insn_handler_t *insn_handler;
3938
probes_check_cc *insn_check_cc;
40-
kprobe_insn_singlestep_t *insn_singlestep;
41-
kprobe_insn_fn_t *insn_fn;
39+
probes_insn_singlestep_t *insn_singlestep;
40+
probes_insn_fn_t *insn_fn;
4241
};
4342

4443
#endif

‎arch/arm/kernel/kprobes-common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ enum probes_insn __kprobes
127127
kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi,
128128
const struct decode_header *h)
129129
{
130-
kprobe_insn_handler_t *handler = 0;
130+
probes_insn_handler_t *handler = 0;
131131
unsigned reglist = insn & 0xffff;
132132
int is_ldm = insn & 0x100000;
133133
int rn = (insn >> 16) & 0xf;

‎arch/arm/kernel/kprobes-test.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@
207207
#include <asm/opcodes.h>
208208

209209
#include "kprobes.h"
210+
#include "probes-arm.h"
211+
#include "probes-thumb.h"
210212
#include "kprobes-test.h"
211213

212214

@@ -1610,7 +1612,7 @@ static int __init run_all_tests(void)
16101612
goto out;
16111613

16121614
pr_info("ARM instruction simulation\n");
1613-
ret = run_test_cases(kprobe_arm_test_cases, kprobe_decode_arm_table);
1615+
ret = run_test_cases(kprobe_arm_test_cases, probes_decode_arm_table);
16141616
if (ret)
16151617
goto out;
16161618

@@ -1633,13 +1635,13 @@ static int __init run_all_tests(void)
16331635

16341636
pr_info("16-bit Thumb instruction simulation\n");
16351637
ret = run_test_cases(kprobe_thumb16_test_cases,
1636-
kprobe_decode_thumb16_table);
1638+
probes_decode_thumb16_table);
16371639
if (ret)
16381640
goto out;
16391641

16401642
pr_info("32-bit Thumb instruction simulation\n");
16411643
ret = run_test_cases(kprobe_thumb32_test_cases,
1642-
kprobe_decode_thumb32_table);
1644+
probes_decode_thumb32_table);
16431645
if (ret)
16441646
goto out;
16451647
#endif

‎arch/arm/kernel/kprobes.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <linux/bug.h>
3232

3333
#include "kprobes.h"
34+
#include "probes-arm.h"
35+
#include "probes-thumb.h"
3436
#include "patch.h"
3537

3638
#define MIN_STACK_SIZE(addr) \
@@ -69,18 +71,18 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
6971
if (is_wide_instruction(insn)) {
7072
insn <<= 16;
7173
insn |= ((u16 *)addr)[1];
72-
decode_insn = thumb32_kprobe_decode_insn;
74+
decode_insn = thumb32_probes_decode_insn;
7375
actions = kprobes_t32_actions;
7476
} else {
75-
decode_insn = thumb16_kprobe_decode_insn;
77+
decode_insn = thumb16_probes_decode_insn;
7678
actions = kprobes_t16_actions;
7779
}
7880
#else /* !CONFIG_THUMB2_KERNEL */
7981
thumb = false;
8082
if (addr & 0x3)
8183
return -EINVAL;
8284
insn = *p->addr;
83-
decode_insn = arm_kprobe_decode_insn;
85+
decode_insn = arm_probes_decode_insn;
8486
actions = kprobes_arm_actions;
8587
#endif
8688

@@ -99,7 +101,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
99101
p->ainsn.insn[is] = tmp_insn[is];
100102
flush_insns(p->ainsn.insn,
101103
sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE);
102-
p->ainsn.insn_fn = (kprobe_insn_fn_t *)
104+
p->ainsn.insn_fn = (probes_insn_fn_t *)
103105
((uintptr_t)p->ainsn.insn | thumb);
104106
break;
105107

‎arch/arm/kernel/kprobes.h‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef _ARM_KERNEL_KPROBES_H
2020
#define _ARM_KERNEL_KPROBES_H
2121

22+
#include "probes.h"
23+
2224
/*
2325
* These undefined instructions must be unique and
2426
* reserved solely for kprobes' use.
@@ -27,30 +29,23 @@
2729
#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
2830
#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018
2931

30-
struct decode_header;
31-
union decode_action;
32+
enum probes_insn __kprobes
33+
kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi,
34+
const struct decode_header *h);
3235

3336
typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
3437
struct arch_specific_insn *,
3538
const union decode_action *);
3639

3740
#ifdef CONFIG_THUMB2_KERNEL
3841

39-
enum probes_insn thumb16_kprobe_decode_insn(probes_opcode_t,
40-
struct arch_specific_insn *,
41-
const union decode_action *);
42-
enum probes_insn thumb32_kprobe_decode_insn(probes_opcode_t,
43-
struct arch_specific_insn *,
44-
const union decode_action *);
42+
extern const union decode_action kprobes_t32_actions[];
43+
extern const union decode_action kprobes_t16_actions[];
4544

4645
#else /* !CONFIG_THUMB2_KERNEL */
4746

48-
enum probes_insn arm_kprobe_decode_insn(probes_opcode_t,
49-
struct arch_specific_insn *,
50-
const union decode_action *);
47+
extern const union decode_action kprobes_arm_actions[];
5148

5249
#endif
5350

54-
#include "probes.h"
55-
5651
#endif /* _ARM_KERNEL_KPROBES_H */

‎arch/arm/kernel/probes-arm.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ static const union decode_item arm_cccc_100x_table[] = {
610610
DECODE_END
611611
};
612612

613-
const union decode_item kprobe_decode_arm_table[] = {
613+
const union decode_item probes_decode_arm_table[] = {
614614
/*
615615
* Unconditional instructions
616616
* 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
@@ -701,7 +701,7 @@ const union decode_item kprobe_decode_arm_table[] = {
701701
DECODE_END
702702
};
703703
#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
704-
EXPORT_SYMBOL_GPL(kprobe_decode_arm_table);
704+
EXPORT_SYMBOL_GPL(probes_decode_arm_table);
705705
#endif
706706

707707
static void __kprobes arm_singlestep(probes_opcode_t insn,
@@ -724,11 +724,11 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
724724
* should also be very rare.
725725
*/
726726
enum probes_insn __kprobes
727-
arm_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
727+
arm_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
728728
const union decode_action *actions)
729729
{
730730
asi->insn_singlestep = arm_singlestep;
731731
asi->insn_check_cc = probes_condition_checks[insn>>28];
732-
return kprobe_decode_insn(insn, asi, kprobe_decode_arm_table, false,
732+
return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
733733
actions);
734734
}

‎arch/arm/kernel/probes-arm.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,10 @@ void __kprobes simulate_mrs(probes_opcode_t opcode,
6464
void __kprobes simulate_mov_ipsp(probes_opcode_t opcode,
6565
struct arch_specific_insn *asi, struct pt_regs *regs);
6666

67+
extern const union decode_item probes_decode_arm_table[];
68+
69+
enum probes_insn arm_probes_decode_insn(probes_opcode_t,
70+
struct arch_specific_insn *,
71+
const union decode_action *actions);
72+
6773
#endif

‎arch/arm/kernel/probes-thumb.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* arch/arm/kernel/kprobes-thumb.c
2+
* arch/arm/kernel/probes-thumb.c
33
*
44
* Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
55
*
@@ -552,7 +552,7 @@ static const union decode_item t32_table_1111_1011_1[] = {
552552
DECODE_END
553553
};
554554

555-
const union decode_item kprobe_decode_thumb32_table[] = {
555+
const union decode_item probes_decode_thumb32_table[] = {
556556

557557
/*
558558
* Load/store multiple instructions
@@ -641,7 +641,7 @@ const union decode_item kprobe_decode_thumb32_table[] = {
641641
DECODE_END
642642
};
643643
#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
644-
EXPORT_SYMBOL_GPL(kprobe_decode_thumb32_table);
644+
EXPORT_SYMBOL_GPL(probes_decode_thumb32_table);
645645
#endif
646646

647647
static const union decode_item t16_table_1011[] = {
@@ -696,7 +696,7 @@ static const union decode_item t16_table_1011[] = {
696696
DECODE_END
697697
};
698698

699-
const union decode_item kprobe_decode_thumb16_table[] = {
699+
const union decode_item probes_decode_thumb16_table[] = {
700700

701701
/*
702702
* Shift (immediate), add, subtract, move, and compare
@@ -833,7 +833,7 @@ const union decode_item kprobe_decode_thumb16_table[] = {
833833
DECODE_END
834834
};
835835
#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
836-
EXPORT_SYMBOL_GPL(kprobe_decode_thumb16_table);
836+
EXPORT_SYMBOL_GPL(probes_decode_thumb16_table);
837837
#endif
838838

839839
static unsigned long __kprobes thumb_check_cc(unsigned long cpsr)
@@ -862,21 +862,21 @@ static void __kprobes thumb32_singlestep(probes_opcode_t opcode,
862862
}
863863

864864
enum probes_insn __kprobes
865-
thumb16_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
865+
thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
866866
const union decode_action *actions)
867867
{
868868
asi->insn_singlestep = thumb16_singlestep;
869869
asi->insn_check_cc = thumb_check_cc;
870-
return kprobe_decode_insn(insn, asi, kprobe_decode_thumb16_table, true,
870+
return probes_decode_insn(insn, asi, probes_decode_thumb16_table, true,
871871
actions);
872872
}
873873

874874
enum probes_insn __kprobes
875-
thumb32_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
875+
thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
876876
const union decode_action *actions)
877877
{
878878
asi->insn_singlestep = thumb32_singlestep;
879879
asi->insn_check_cc = thumb_check_cc;
880-
return kprobe_decode_insn(insn, asi, kprobe_decode_thumb32_table, true,
880+
return probes_decode_insn(insn, asi, probes_decode_thumb32_table, true,
881881
actions);
882882
}

‎arch/arm/kernel/probes-thumb.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,14 @@ enum probes_t16_action {
8484
NUM_PROBES_T16_ACTIONS
8585
};
8686

87+
extern const union decode_item probes_decode_thumb32_table[];
88+
extern const union decode_item probes_decode_thumb16_table[];
89+
90+
enum probes_insn __kprobes
91+
thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
92+
const union decode_action *actions);
93+
enum probes_insn __kprobes
94+
thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
95+
const union decode_action *actions);
96+
8797
#endif

‎arch/arm/kernel/probes.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
340340
};
341341

342342
/*
343-
* kprobe_decode_insn operates on data tables in order to decode an ARM
343+
* probes_decode_insn operates on data tables in order to decode an ARM
344344
* architecture instruction onto which a kprobe has been placed.
345345
*
346346
* These instruction decoding tables are a concatenation of entries each
@@ -383,7 +383,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
383383
*
384384
*/
385385
int __kprobes
386-
kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
386+
probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
387387
const union decode_item *table, bool thumb,
388388
const union decode_action *actions)
389389
{

0 commit comments

Comments
 (0)