diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 6 | ||||
-rw-r--r-- | arch/arm/kernel/entry-common.S | 1 | ||||
-rw-r--r-- | arch/arm/kernel/stacktrace.c | 14 | ||||
-rw-r--r-- | arch/arm/kernel/traps.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/vmlinux-xip.lds.S | 6 | ||||
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 6 |
6 files changed, 12 insertions, 25 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index fbc707626b3e..1752033b0070 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -82,11 +82,7 @@ | |||
82 | #endif | 82 | #endif |
83 | .endm | 83 | .endm |
84 | 84 | ||
85 | #ifdef CONFIG_KPROBES | 85 | .section .entry.text,"ax",%progbits |
86 | .section .kprobes.text,"ax",%progbits | ||
87 | #else | ||
88 | .text | ||
89 | #endif | ||
90 | 86 | ||
91 | /* | 87 | /* |
92 | * Invalid mode handlers | 88 | * Invalid mode handlers |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index e655dcd0a933..3c4f88701f22 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -37,6 +37,7 @@ saved_pc .req lr | |||
37 | #define TRACE(x...) | 37 | #define TRACE(x...) |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | .section .entry.text,"ax",%progbits | ||
40 | .align 5 | 41 | .align 5 |
41 | #if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING)) | 42 | #if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING)) |
42 | /* | 43 | /* |
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index 65228bf4c6df..a56e7c856ab5 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/sched/debug.h> | 3 | #include <linux/sched/debug.h> |
4 | #include <linux/stacktrace.h> | 4 | #include <linux/stacktrace.h> |
5 | 5 | ||
6 | #include <asm/sections.h> | ||
6 | #include <asm/stacktrace.h> | 7 | #include <asm/stacktrace.h> |
7 | #include <asm/traps.h> | 8 | #include <asm/traps.h> |
8 | 9 | ||
@@ -63,7 +64,6 @@ EXPORT_SYMBOL(walk_stackframe); | |||
63 | #ifdef CONFIG_STACKTRACE | 64 | #ifdef CONFIG_STACKTRACE |
64 | struct stack_trace_data { | 65 | struct stack_trace_data { |
65 | struct stack_trace *trace; | 66 | struct stack_trace *trace; |
66 | unsigned long last_pc; | ||
67 | unsigned int no_sched_functions; | 67 | unsigned int no_sched_functions; |
68 | unsigned int skip; | 68 | unsigned int skip; |
69 | }; | 69 | }; |
@@ -87,16 +87,7 @@ static int save_trace(struct stackframe *frame, void *d) | |||
87 | if (trace->nr_entries >= trace->max_entries) | 87 | if (trace->nr_entries >= trace->max_entries) |
88 | return 1; | 88 | return 1; |
89 | 89 | ||
90 | /* | 90 | if (!in_entry_text(frame->pc)) |
91 | * in_exception_text() is designed to test if the PC is one of | ||
92 | * the functions which has an exception stack above it, but | ||
93 | * unfortunately what is in frame->pc is the return LR value, | ||
94 | * not the saved PC value. So, we need to track the previous | ||
95 | * frame PC value when doing this. | ||
96 | */ | ||
97 | addr = data->last_pc; | ||
98 | data->last_pc = frame->pc; | ||
99 | if (!in_exception_text(addr)) | ||
100 | return 0; | 91 | return 0; |
101 | 92 | ||
102 | regs = (struct pt_regs *)frame->sp; | 93 | regs = (struct pt_regs *)frame->sp; |
@@ -114,7 +105,6 @@ static noinline void __save_stack_trace(struct task_struct *tsk, | |||
114 | struct stackframe frame; | 105 | struct stackframe frame; |
115 | 106 | ||
116 | data.trace = trace; | 107 | data.trace = trace; |
117 | data.last_pc = ULONG_MAX; | ||
118 | data.skip = trace->skip; | 108 | data.skip = trace->skip; |
119 | data.no_sched_functions = nosched; | 109 | data.no_sched_functions = nosched; |
120 | 110 | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 5cf04888c581..e344bdd2e5ac 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -72,7 +72,7 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long | |||
72 | printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); | 72 | printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | if (in_exception_text(where)) | 75 | if (in_entry_text(from)) |
76 | dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); | 76 | dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); |
77 | } | 77 | } |
78 | 78 | ||
@@ -433,7 +433,7 @@ static int call_undef_hook(struct pt_regs *regs, unsigned int instr) | |||
433 | return fn ? fn(regs, instr) : 1; | 433 | return fn ? fn(regs, instr) : 1; |
434 | } | 434 | } |
435 | 435 | ||
436 | asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | 436 | asmlinkage void do_undefinstr(struct pt_regs *regs) |
437 | { | 437 | { |
438 | unsigned int instr; | 438 | unsigned int instr; |
439 | siginfo_t info; | 439 | siginfo_t info; |
diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index ec4b3f94ad80..12b87591eb7c 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S | |||
@@ -96,9 +96,9 @@ SECTIONS | |||
96 | .text : { /* Real text segment */ | 96 | .text : { /* Real text segment */ |
97 | _stext = .; /* Text and read-only data */ | 97 | _stext = .; /* Text and read-only data */ |
98 | IDMAP_TEXT | 98 | IDMAP_TEXT |
99 | __exception_text_start = .; | 99 | __entry_text_start = .; |
100 | *(.exception.text) | 100 | *(.entry.text) |
101 | __exception_text_end = .; | 101 | __entry_text_end = .; |
102 | IRQENTRY_TEXT | 102 | IRQENTRY_TEXT |
103 | TEXT_TEXT | 103 | TEXT_TEXT |
104 | SCHED_TEXT | 104 | SCHED_TEXT |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index ee53f6518872..84a1ae3ce46e 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -105,9 +105,9 @@ SECTIONS | |||
105 | .text : { /* Real text segment */ | 105 | .text : { /* Real text segment */ |
106 | _stext = .; /* Text and read-only data */ | 106 | _stext = .; /* Text and read-only data */ |
107 | IDMAP_TEXT | 107 | IDMAP_TEXT |
108 | __exception_text_start = .; | 108 | __entry_text_start = .; |
109 | *(.exception.text) | 109 | *(.entry.text) |
110 | __exception_text_end = .; | 110 | __entry_text_end = .; |
111 | IRQENTRY_TEXT | 111 | IRQENTRY_TEXT |
112 | SOFTIRQENTRY_TEXT | 112 | SOFTIRQENTRY_TEXT |
113 | TEXT_TEXT | 113 | TEXT_TEXT |