diff options
author | David A. Long <dave.long@linaro.org> | 2014-03-06 18:12:07 -0500 |
---|---|---|
committer | David A. Long <dave.long@linaro.org> | 2014-03-18 16:39:39 -0400 |
commit | 47e190fafde49ff8ca732fa137e39cb2b8baba8c (patch) | |
tree | bcfb54b117e8ac1ea0c06c22dd1546edc2c39aed | |
parent | 44a0a59c535004eac9f18210cb2ce10b23861630 (diff) |
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>
-rw-r--r-- | arch/arm/include/asm/probes.h | 13 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes-common.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes-test.c | 8 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes.c | 10 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes.h | 21 | ||||
-rw-r--r-- | arch/arm/kernel/probes-arm.c | 8 | ||||
-rw-r--r-- | arch/arm/kernel/probes-arm.h | 6 | ||||
-rw-r--r-- | arch/arm/kernel/probes-thumb.c | 18 | ||||
-rw-r--r-- | arch/arm/kernel/probes-thumb.h | 10 | ||||
-rw-r--r-- | arch/arm/kernel/probes.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/probes.h | 42 |
11 files changed, 69 insertions, 73 deletions
diff --git a/arch/arm/include/asm/probes.h b/arch/arm/include/asm/probes.h index c4acf6c8a2d4..c37252c73ee5 100644 --- a/arch/arm/include/asm/probes.h +++ b/arch/arm/include/asm/probes.h | |||
@@ -19,26 +19,25 @@ | |||
19 | #ifndef _ASM_PROBES_H | 19 | #ifndef _ASM_PROBES_H |
20 | #define _ASM_PROBES_H | 20 | #define _ASM_PROBES_H |
21 | 21 | ||
22 | struct kprobe; | ||
23 | typedef u32 probes_opcode_t; | 22 | typedef u32 probes_opcode_t; |
24 | 23 | ||
25 | struct arch_specific_insn; | 24 | struct arch_specific_insn; |
26 | typedef void (kprobe_insn_handler_t)(probes_opcode_t, | 25 | typedef void (probes_insn_handler_t)(probes_opcode_t, |
27 | struct arch_specific_insn *, | 26 | struct arch_specific_insn *, |
28 | struct pt_regs *); | 27 | struct pt_regs *); |
29 | typedef unsigned long (probes_check_cc)(unsigned long); | 28 | 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, |
31 | struct arch_specific_insn *, | 30 | struct arch_specific_insn *, |
32 | struct pt_regs *); | 31 | struct pt_regs *); |
33 | typedef void (kprobe_insn_fn_t)(void); | 32 | typedef void (probes_insn_fn_t)(void); |
34 | 33 | ||
35 | /* Architecture specific copy of original instruction. */ | 34 | /* Architecture specific copy of original instruction. */ |
36 | struct arch_specific_insn { | 35 | struct arch_specific_insn { |
37 | probes_opcode_t *insn; | 36 | probes_opcode_t *insn; |
38 | kprobe_insn_handler_t *insn_handler; | 37 | probes_insn_handler_t *insn_handler; |
39 | probes_check_cc *insn_check_cc; | 38 | probes_check_cc *insn_check_cc; |
40 | kprobe_insn_singlestep_t *insn_singlestep; | 39 | probes_insn_singlestep_t *insn_singlestep; |
41 | kprobe_insn_fn_t *insn_fn; | 40 | probes_insn_fn_t *insn_fn; |
42 | }; | 41 | }; |
43 | 42 | ||
44 | #endif | 43 | #endif |
diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c index f151e15f566a..6159725597a1 100644 --- a/arch/arm/kernel/kprobes-common.c +++ b/arch/arm/kernel/kprobes-common.c | |||
@@ -127,7 +127,7 @@ 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_specific_insn *asi, |
128 | const struct decode_header *h) | 128 | const struct decode_header *h) |
129 | { | 129 | { |
130 | kprobe_insn_handler_t *handler = 0; | 130 | probes_insn_handler_t *handler = 0; |
131 | unsigned reglist = insn & 0xffff; | 131 | unsigned reglist = insn & 0xffff; |
132 | int is_ldm = insn & 0x100000; | 132 | int is_ldm = insn & 0x100000; |
133 | int rn = (insn >> 16) & 0xf; | 133 | int rn = (insn >> 16) & 0xf; |
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index 4a774d40c946..c2fd06b4c389 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c | |||
@@ -207,6 +207,8 @@ | |||
207 | #include <asm/opcodes.h> | 207 | #include <asm/opcodes.h> |
208 | 208 | ||
209 | #include "kprobes.h" | 209 | #include "kprobes.h" |
210 | #include "probes-arm.h" | ||
211 | #include "probes-thumb.h" | ||
210 | #include "kprobes-test.h" | 212 | #include "kprobes-test.h" |
211 | 213 | ||
212 | 214 | ||
@@ -1610,7 +1612,7 @@ static int __init run_all_tests(void) | |||
1610 | goto out; | 1612 | goto out; |
1611 | 1613 | ||
1612 | pr_info("ARM instruction simulation\n"); | 1614 | 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); |
1614 | if (ret) | 1616 | if (ret) |
1615 | goto out; | 1617 | goto out; |
1616 | 1618 | ||
@@ -1633,13 +1635,13 @@ static int __init run_all_tests(void) | |||
1633 | 1635 | ||
1634 | pr_info("16-bit Thumb instruction simulation\n"); | 1636 | pr_info("16-bit Thumb instruction simulation\n"); |
1635 | ret = run_test_cases(kprobe_thumb16_test_cases, | 1637 | ret = run_test_cases(kprobe_thumb16_test_cases, |
1636 | kprobe_decode_thumb16_table); | 1638 | probes_decode_thumb16_table); |
1637 | if (ret) | 1639 | if (ret) |
1638 | goto out; | 1640 | goto out; |
1639 | 1641 | ||
1640 | pr_info("32-bit Thumb instruction simulation\n"); | 1642 | pr_info("32-bit Thumb instruction simulation\n"); |
1641 | ret = run_test_cases(kprobe_thumb32_test_cases, | 1643 | ret = run_test_cases(kprobe_thumb32_test_cases, |
1642 | kprobe_decode_thumb32_table); | 1644 | probes_decode_thumb32_table); |
1643 | if (ret) | 1645 | if (ret) |
1644 | goto out; | 1646 | goto out; |
1645 | #endif | 1647 | #endif |
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c index bfd7b8161c58..468d4a980c6c 100644 --- a/arch/arm/kernel/kprobes.c +++ b/arch/arm/kernel/kprobes.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/bug.h> | 31 | #include <linux/bug.h> |
32 | 32 | ||
33 | #include "kprobes.h" | 33 | #include "kprobes.h" |
34 | #include "probes-arm.h" | ||
35 | #include "probes-thumb.h" | ||
34 | #include "patch.h" | 36 | #include "patch.h" |
35 | 37 | ||
36 | #define MIN_STACK_SIZE(addr) \ | 38 | #define MIN_STACK_SIZE(addr) \ |
@@ -69,10 +71,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
69 | if (is_wide_instruction(insn)) { | 71 | if (is_wide_instruction(insn)) { |
70 | insn <<= 16; | 72 | insn <<= 16; |
71 | insn |= ((u16 *)addr)[1]; | 73 | insn |= ((u16 *)addr)[1]; |
72 | decode_insn = thumb32_kprobe_decode_insn; | 74 | decode_insn = thumb32_probes_decode_insn; |
73 | actions = kprobes_t32_actions; | 75 | actions = kprobes_t32_actions; |
74 | } else { | 76 | } else { |
75 | decode_insn = thumb16_kprobe_decode_insn; | 77 | decode_insn = thumb16_probes_decode_insn; |
76 | actions = kprobes_t16_actions; | 78 | actions = kprobes_t16_actions; |
77 | } | 79 | } |
78 | #else /* !CONFIG_THUMB2_KERNEL */ | 80 | #else /* !CONFIG_THUMB2_KERNEL */ |
@@ -80,7 +82,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
80 | if (addr & 0x3) | 82 | if (addr & 0x3) |
81 | return -EINVAL; | 83 | return -EINVAL; |
82 | insn = *p->addr; | 84 | insn = *p->addr; |
83 | decode_insn = arm_kprobe_decode_insn; | 85 | decode_insn = arm_probes_decode_insn; |
84 | actions = kprobes_arm_actions; | 86 | actions = kprobes_arm_actions; |
85 | #endif | 87 | #endif |
86 | 88 | ||
@@ -99,7 +101,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
99 | p->ainsn.insn[is] = tmp_insn[is]; | 101 | p->ainsn.insn[is] = tmp_insn[is]; |
100 | flush_insns(p->ainsn.insn, | 102 | flush_insns(p->ainsn.insn, |
101 | sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE); | 103 | 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 *) |
103 | ((uintptr_t)p->ainsn.insn | thumb); | 105 | ((uintptr_t)p->ainsn.insn | thumb); |
104 | break; | 106 | break; |
105 | 107 | ||
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h index 3684fc9e27cc..eee8089b1b93 100644 --- a/arch/arm/kernel/kprobes.h +++ b/arch/arm/kernel/kprobes.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef _ARM_KERNEL_KPROBES_H | 19 | #ifndef _ARM_KERNEL_KPROBES_H |
20 | #define _ARM_KERNEL_KPROBES_H | 20 | #define _ARM_KERNEL_KPROBES_H |
21 | 21 | ||
22 | #include "probes.h" | ||
23 | |||
22 | /* | 24 | /* |
23 | * These undefined instructions must be unique and | 25 | * These undefined instructions must be unique and |
24 | * reserved solely for kprobes' use. | 26 | * reserved solely for kprobes' use. |
@@ -27,8 +29,9 @@ | |||
27 | #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18 | 29 | #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18 |
28 | #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 | 30 | #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 |
29 | 31 | ||
30 | struct decode_header; | 32 | enum probes_insn __kprobes |
31 | union decode_action; | 33 | kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi, |
34 | const struct decode_header *h); | ||
32 | 35 | ||
33 | typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t, | 36 | typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t, |
34 | struct arch_specific_insn *, | 37 | struct arch_specific_insn *, |
@@ -36,21 +39,13 @@ typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t, | |||
36 | 39 | ||
37 | #ifdef CONFIG_THUMB2_KERNEL | 40 | #ifdef CONFIG_THUMB2_KERNEL |
38 | 41 | ||
39 | enum probes_insn thumb16_kprobe_decode_insn(probes_opcode_t, | 42 | extern const union decode_action kprobes_t32_actions[]; |
40 | struct arch_specific_insn *, | 43 | extern const union decode_action kprobes_t16_actions[]; |
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 *); | ||
45 | 44 | ||
46 | #else /* !CONFIG_THUMB2_KERNEL */ | 45 | #else /* !CONFIG_THUMB2_KERNEL */ |
47 | 46 | ||
48 | enum probes_insn arm_kprobe_decode_insn(probes_opcode_t, | 47 | extern const union decode_action kprobes_arm_actions[]; |
49 | struct arch_specific_insn *, | ||
50 | const union decode_action *); | ||
51 | 48 | ||
52 | #endif | 49 | #endif |
53 | 50 | ||
54 | #include "probes.h" | ||
55 | |||
56 | #endif /* _ARM_KERNEL_KPROBES_H */ | 51 | #endif /* _ARM_KERNEL_KPROBES_H */ |
diff --git a/arch/arm/kernel/probes-arm.c b/arch/arm/kernel/probes-arm.c index a9439e607ac0..738e5fc58928 100644 --- a/arch/arm/kernel/probes-arm.c +++ b/arch/arm/kernel/probes-arm.c | |||
@@ -610,7 +610,7 @@ static const union decode_item arm_cccc_100x_table[] = { | |||
610 | DECODE_END | 610 | DECODE_END |
611 | }; | 611 | }; |
612 | 612 | ||
613 | const union decode_item kprobe_decode_arm_table[] = { | 613 | const union decode_item probes_decode_arm_table[] = { |
614 | /* | 614 | /* |
615 | * Unconditional instructions | 615 | * Unconditional instructions |
616 | * 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx | 616 | * 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
@@ -701,7 +701,7 @@ const union decode_item kprobe_decode_arm_table[] = { | |||
701 | DECODE_END | 701 | DECODE_END |
702 | }; | 702 | }; |
703 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE | 703 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE |
704 | EXPORT_SYMBOL_GPL(kprobe_decode_arm_table); | 704 | 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, |
@@ -724,11 +724,11 @@ 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_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, |
728 | const union decode_action *actions) | 728 | const union decode_action *actions) |
729 | { | 729 | { |
730 | asi->insn_singlestep = arm_singlestep; | 730 | asi->insn_singlestep = arm_singlestep; |
731 | asi->insn_check_cc = probes_condition_checks[insn>>28]; | 731 | 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, |
733 | actions); | 733 | actions); |
734 | } | 734 | } |
diff --git a/arch/arm/kernel/probes-arm.h b/arch/arm/kernel/probes-arm.h index 9a9d379dbf33..7a5cce497a9b 100644 --- a/arch/arm/kernel/probes-arm.h +++ b/arch/arm/kernel/probes-arm.h | |||
@@ -64,4 +64,10 @@ void __kprobes simulate_mrs(probes_opcode_t opcode, | |||
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_specific_insn *asi, struct pt_regs *regs); |
66 | 66 | ||
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 | |||
67 | #endif | 73 | #endif |
diff --git a/arch/arm/kernel/probes-thumb.c b/arch/arm/kernel/probes-thumb.c index d23ef009fe63..eab440f6b2d4 100644 --- a/arch/arm/kernel/probes-thumb.c +++ b/arch/arm/kernel/probes-thumb.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/kernel/kprobes-thumb.c | 2 | * arch/arm/kernel/probes-thumb.c |
3 | * | 3 | * |
4 | * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>. | 4 | * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>. |
5 | * | 5 | * |
@@ -552,7 +552,7 @@ static const union decode_item t32_table_1111_1011_1[] = { | |||
552 | DECODE_END | 552 | DECODE_END |
553 | }; | 553 | }; |
554 | 554 | ||
555 | const union decode_item kprobe_decode_thumb32_table[] = { | 555 | const union decode_item probes_decode_thumb32_table[] = { |
556 | 556 | ||
557 | /* | 557 | /* |
558 | * Load/store multiple instructions | 558 | * Load/store multiple instructions |
@@ -641,7 +641,7 @@ const union decode_item kprobe_decode_thumb32_table[] = { | |||
641 | DECODE_END | 641 | DECODE_END |
642 | }; | 642 | }; |
643 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE | 643 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE |
644 | EXPORT_SYMBOL_GPL(kprobe_decode_thumb32_table); | 644 | EXPORT_SYMBOL_GPL(probes_decode_thumb32_table); |
645 | #endif | 645 | #endif |
646 | 646 | ||
647 | static const union decode_item t16_table_1011[] = { | 647 | static const union decode_item t16_table_1011[] = { |
@@ -696,7 +696,7 @@ static const union decode_item t16_table_1011[] = { | |||
696 | DECODE_END | 696 | DECODE_END |
697 | }; | 697 | }; |
698 | 698 | ||
699 | const union decode_item kprobe_decode_thumb16_table[] = { | 699 | const union decode_item probes_decode_thumb16_table[] = { |
700 | 700 | ||
701 | /* | 701 | /* |
702 | * Shift (immediate), add, subtract, move, and compare | 702 | * Shift (immediate), add, subtract, move, and compare |
@@ -833,7 +833,7 @@ const union decode_item kprobe_decode_thumb16_table[] = { | |||
833 | DECODE_END | 833 | DECODE_END |
834 | }; | 834 | }; |
835 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE | 835 | #ifdef CONFIG_ARM_KPROBES_TEST_MODULE |
836 | EXPORT_SYMBOL_GPL(kprobe_decode_thumb16_table); | 836 | EXPORT_SYMBOL_GPL(probes_decode_thumb16_table); |
837 | #endif | 837 | #endif |
838 | 838 | ||
839 | static unsigned long __kprobes thumb_check_cc(unsigned long cpsr) | 839 | static unsigned long __kprobes thumb_check_cc(unsigned long cpsr) |
@@ -862,21 +862,21 @@ 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_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, |
866 | const union decode_action *actions) | 866 | const union decode_action *actions) |
867 | { | 867 | { |
868 | asi->insn_singlestep = thumb16_singlestep; | 868 | asi->insn_singlestep = thumb16_singlestep; |
869 | asi->insn_check_cc = thumb_check_cc; | 869 | 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, |
871 | actions); | 871 | actions); |
872 | } | 872 | } |
873 | 873 | ||
874 | enum probes_insn __kprobes | 874 | 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, |
876 | const union decode_action *actions) | 876 | const union decode_action *actions) |
877 | { | 877 | { |
878 | asi->insn_singlestep = thumb32_singlestep; | 878 | asi->insn_singlestep = thumb32_singlestep; |
879 | asi->insn_check_cc = thumb_check_cc; | 879 | 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, |
881 | actions); | 881 | actions); |
882 | } | 882 | } |
diff --git a/arch/arm/kernel/probes-thumb.h b/arch/arm/kernel/probes-thumb.h index 8d6b4eefa706..d6f67c1df7af 100644 --- a/arch/arm/kernel/probes-thumb.h +++ b/arch/arm/kernel/probes-thumb.h | |||
@@ -84,4 +84,14 @@ enum probes_t16_action { | |||
84 | NUM_PROBES_T16_ACTIONS | 84 | NUM_PROBES_T16_ACTIONS |
85 | }; | 85 | }; |
86 | 86 | ||
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 | |||
87 | #endif | 97 | #endif |
diff --git a/arch/arm/kernel/probes.c b/arch/arm/kernel/probes.c index 92d359a22843..b6d9b855273c 100644 --- a/arch/arm/kernel/probes.c +++ b/arch/arm/kernel/probes.c | |||
@@ -340,7 +340,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = { | |||
340 | }; | 340 | }; |
341 | 341 | ||
342 | /* | 342 | /* |
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 |
344 | * architecture instruction onto which a kprobe has been placed. | 344 | * architecture instruction onto which a kprobe has been placed. |
345 | * | 345 | * |
346 | * These instruction decoding tables are a concatenation of entries each | 346 | * These instruction decoding tables are a concatenation of entries each |
@@ -383,7 +383,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = { | |||
383 | * | 383 | * |
384 | */ | 384 | */ |
385 | int __kprobes | 385 | 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, |
387 | const union decode_item *table, bool thumb, | 387 | const union decode_item *table, bool thumb, |
388 | const union decode_action *actions) | 388 | const union decode_action *actions) |
389 | { | 389 | { |
diff --git a/arch/arm/kernel/probes.h b/arch/arm/kernel/probes.h index 870282a39261..0c72e544175d 100644 --- a/arch/arm/kernel/probes.h +++ b/arch/arm/kernel/probes.h | |||
@@ -21,11 +21,12 @@ | |||
21 | 21 | ||
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | #include <linux/stddef.h> | 23 | #include <linux/stddef.h> |
24 | #include <linux/kprobes.h> | 24 | #include <asm/probes.h> |
25 | #include "kprobes.h" | ||
26 | 25 | ||
27 | void __init arm_probes_decode_init(void); | 26 | void __init arm_probes_decode_init(void); |
28 | 27 | ||
28 | extern probes_check_cc * const probes_condition_checks[16]; | ||
29 | |||
29 | #if __LINUX_ARM_ARCH__ >= 7 | 30 | #if __LINUX_ARM_ARCH__ >= 7 |
30 | 31 | ||
31 | /* str_pc_offset is architecturally defined from ARMv7 onwards */ | 32 | /* str_pc_offset is architecturally defined from ARMv7 onwards */ |
@@ -40,7 +41,6 @@ void __init find_str_pc_offset(void); | |||
40 | 41 | ||
41 | #endif | 42 | #endif |
42 | 43 | ||
43 | struct decode_header; | ||
44 | 44 | ||
45 | /* | 45 | /* |
46 | * Update ITSTATE after normal execution of an IT block instruction. | 46 | * Update ITSTATE after normal execution of an IT block instruction. |
@@ -133,15 +133,6 @@ static inline void __kprobes alu_write_pc(long pcv, struct pt_regs *regs) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | void __kprobes probes_simulate_nop(probes_opcode_t, struct arch_specific_insn *, | ||
137 | struct pt_regs *regs); | ||
138 | void __kprobes probes_emulate_none(probes_opcode_t, struct arch_specific_insn *, | ||
139 | struct pt_regs *regs); | ||
140 | |||
141 | enum probes_insn __kprobes | ||
142 | kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi, | ||
143 | const struct decode_header *h); | ||
144 | |||
145 | /* | 136 | /* |
146 | * Test if load/store instructions writeback the address register. | 137 | * Test if load/store instructions writeback the address register. |
147 | * if P (bit 24) == 0 or W (bit 21) == 1 | 138 | * if P (bit 24) == 0 or W (bit 21) == 1 |
@@ -150,7 +141,7 @@ kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi, | |||
150 | 141 | ||
151 | /* | 142 | /* |
152 | * The following definitions and macros are used to build instruction | 143 | * The following definitions and macros are used to build instruction |
153 | * decoding tables for use by kprobe_decode_insn. | 144 | * decoding tables for use by probes_decode_insn. |
154 | * | 145 | * |
155 | * These tables are a concatenation of entries each of which consist of one of | 146 | * These tables are a concatenation of entries each of which consist of one of |
156 | * the decode_* structs. All of the fields in every type of decode structure | 147 | * the decode_* structs. All of the fields in every type of decode structure |
@@ -313,12 +304,13 @@ union decode_item { | |||
313 | int action; | 304 | int action; |
314 | }; | 305 | }; |
315 | 306 | ||
307 | struct decode_header; | ||
316 | typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t, | 308 | typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t, |
317 | struct arch_specific_insn *, | 309 | struct arch_specific_insn *, |
318 | const struct decode_header *); | 310 | const struct decode_header *); |
319 | 311 | ||
320 | union decode_action { | 312 | union decode_action { |
321 | kprobe_insn_handler_t *handler; | 313 | probes_insn_handler_t *handler; |
322 | probes_custom_decode_t *decoder; | 314 | probes_custom_decode_t *decoder; |
323 | }; | 315 | }; |
324 | 316 | ||
@@ -404,22 +396,12 @@ struct decode_reject { | |||
404 | #define DECODE_REJECT(_mask, _value) \ | 396 | #define DECODE_REJECT(_mask, _value) \ |
405 | DECODE_HEADER(DECODE_TYPE_REJECT, _mask, _value, 0) | 397 | DECODE_HEADER(DECODE_TYPE_REJECT, _mask, _value, 0) |
406 | 398 | ||
399 | probes_insn_handler_t probes_simulate_nop; | ||
400 | probes_insn_handler_t probes_emulate_none; | ||
407 | 401 | ||
408 | #ifdef CONFIG_THUMB2_KERNEL | 402 | int __kprobes |
409 | extern const union decode_item kprobe_decode_thumb16_table[]; | 403 | probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, |
410 | extern const union decode_item kprobe_decode_thumb32_table[]; | 404 | const union decode_item *table, bool thumb, |
411 | extern const union decode_action kprobes_t32_actions[]; | 405 | const union decode_action *actions); |
412 | extern const union decode_action kprobes_t16_actions[]; | ||
413 | #else | ||
414 | extern const union decode_item kprobe_decode_arm_table[]; | ||
415 | extern const union decode_action kprobes_arm_actions[]; | ||
416 | #endif | ||
417 | |||
418 | extern probes_check_cc * const probes_condition_checks[16]; | ||
419 | |||
420 | |||
421 | int kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, | ||
422 | const union decode_item *table, bool thumb16, | ||
423 | const union decode_action *actions); | ||
424 | 406 | ||
425 | #endif | 407 | #endif |