diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/defconfig | 2 | ||||
-rw-r--r-- | arch/i386/kernel/entry.S | 32 | ||||
-rw-r--r-- | arch/i386/kernel/traps.c | 83 | ||||
-rw-r--r-- | arch/x86_64/Makefile | 2 | ||||
-rw-r--r-- | arch/x86_64/defconfig | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/entry.S | 33 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 84 | ||||
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 2 |
8 files changed, 0 insertions, 240 deletions
diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 3265208e5899..e075ff05c46d 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig | |||
@@ -1493,8 +1493,6 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1493 | # CONFIG_DEBUG_VM is not set | 1493 | # CONFIG_DEBUG_VM is not set |
1494 | # CONFIG_DEBUG_LIST is not set | 1494 | # CONFIG_DEBUG_LIST is not set |
1495 | # CONFIG_FRAME_POINTER is not set | 1495 | # CONFIG_FRAME_POINTER is not set |
1496 | CONFIG_UNWIND_INFO=y | ||
1497 | CONFIG_STACK_UNWIND=y | ||
1498 | # CONFIG_FORCED_INLINING is not set | 1496 | # CONFIG_FORCED_INLINING is not set |
1499 | # CONFIG_HEADERS_CHECK is not set | 1497 | # CONFIG_HEADERS_CHECK is not set |
1500 | # CONFIG_RCU_TORTURE_TEST is not set | 1498 | # CONFIG_RCU_TORTURE_TEST is not set |
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index de34b7fed3c1..06461b8b715d 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S | |||
@@ -979,38 +979,6 @@ ENTRY(spurious_interrupt_bug) | |||
979 | jmp error_code | 979 | jmp error_code |
980 | CFI_ENDPROC | 980 | CFI_ENDPROC |
981 | 981 | ||
982 | #ifdef CONFIG_STACK_UNWIND | ||
983 | ENTRY(arch_unwind_init_running) | ||
984 | CFI_STARTPROC | ||
985 | movl 4(%esp), %edx | ||
986 | movl (%esp), %ecx | ||
987 | leal 4(%esp), %eax | ||
988 | movl %ebx, PT_EBX(%edx) | ||
989 | xorl %ebx, %ebx | ||
990 | movl %ebx, PT_ECX(%edx) | ||
991 | movl %ebx, PT_EDX(%edx) | ||
992 | movl %esi, PT_ESI(%edx) | ||
993 | movl %edi, PT_EDI(%edx) | ||
994 | movl %ebp, PT_EBP(%edx) | ||
995 | movl %ebx, PT_EAX(%edx) | ||
996 | movl $__USER_DS, PT_DS(%edx) | ||
997 | movl $__USER_DS, PT_ES(%edx) | ||
998 | movl $0, PT_GS(%edx) | ||
999 | movl %ebx, PT_ORIG_EAX(%edx) | ||
1000 | movl %ecx, PT_EIP(%edx) | ||
1001 | movl 12(%esp), %ecx | ||
1002 | movl $__KERNEL_CS, PT_CS(%edx) | ||
1003 | movl %ebx, PT_EFLAGS(%edx) | ||
1004 | movl %eax, PT_OLDESP(%edx) | ||
1005 | movl 8(%esp), %eax | ||
1006 | movl %ecx, 8(%esp) | ||
1007 | movl PT_EBX(%edx), %ebx | ||
1008 | movl $__KERNEL_DS, PT_OLDSS(%edx) | ||
1009 | jmpl *%eax | ||
1010 | CFI_ENDPROC | ||
1011 | ENDPROC(arch_unwind_init_running) | ||
1012 | #endif | ||
1013 | |||
1014 | ENTRY(kernel_thread_helper) | 982 | ENTRY(kernel_thread_helper) |
1015 | pushl $0 # fake return address for unwinder | 983 | pushl $0 # fake return address for unwinder |
1016 | CFI_STARTPROC | 984 | CFI_STARTPROC |
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 2b30dbf8d117..0efad8aeb41a 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -94,11 +94,6 @@ asmlinkage void spurious_interrupt_bug(void); | |||
94 | asmlinkage void machine_check(void); | 94 | asmlinkage void machine_check(void); |
95 | 95 | ||
96 | int kstack_depth_to_print = 24; | 96 | int kstack_depth_to_print = 24; |
97 | #ifdef CONFIG_STACK_UNWIND | ||
98 | static int call_trace = 1; | ||
99 | #else | ||
100 | #define call_trace (-1) | ||
101 | #endif | ||
102 | ATOMIC_NOTIFIER_HEAD(i386die_chain); | 97 | ATOMIC_NOTIFIER_HEAD(i386die_chain); |
103 | 98 | ||
104 | int register_die_notifier(struct notifier_block *nb) | 99 | int register_die_notifier(struct notifier_block *nb) |
@@ -152,33 +147,6 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, | |||
152 | return ebp; | 147 | return ebp; |
153 | } | 148 | } |
154 | 149 | ||
155 | struct ops_and_data { | ||
156 | struct stacktrace_ops *ops; | ||
157 | void *data; | ||
158 | }; | ||
159 | |||
160 | static asmlinkage int | ||
161 | dump_trace_unwind(struct unwind_frame_info *info, void *data) | ||
162 | { | ||
163 | struct ops_and_data *oad = (struct ops_and_data *)data; | ||
164 | int n = 0; | ||
165 | unsigned long sp = UNW_SP(info); | ||
166 | |||
167 | if (arch_unw_user_mode(info)) | ||
168 | return -1; | ||
169 | while (unwind(info) == 0 && UNW_PC(info)) { | ||
170 | n++; | ||
171 | oad->ops->address(oad->data, UNW_PC(info)); | ||
172 | if (arch_unw_user_mode(info)) | ||
173 | break; | ||
174 | if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1)) | ||
175 | && sp > UNW_SP(info)) | ||
176 | break; | ||
177 | sp = UNW_SP(info); | ||
178 | } | ||
179 | return n; | ||
180 | } | ||
181 | |||
182 | #define MSG(msg) ops->warning(data, msg) | 150 | #define MSG(msg) ops->warning(data, msg) |
183 | 151 | ||
184 | void dump_trace(struct task_struct *task, struct pt_regs *regs, | 152 | void dump_trace(struct task_struct *task, struct pt_regs *regs, |
@@ -190,41 +158,6 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
190 | if (!task) | 158 | if (!task) |
191 | task = current; | 159 | task = current; |
192 | 160 | ||
193 | if (call_trace >= 0) { | ||
194 | int unw_ret = 0; | ||
195 | struct unwind_frame_info info; | ||
196 | struct ops_and_data oad = { .ops = ops, .data = data }; | ||
197 | |||
198 | if (regs) { | ||
199 | if (unwind_init_frame_info(&info, task, regs) == 0) | ||
200 | unw_ret = dump_trace_unwind(&info, &oad); | ||
201 | } else if (task == current) | ||
202 | unw_ret = unwind_init_running(&info, dump_trace_unwind, | ||
203 | &oad); | ||
204 | else { | ||
205 | if (unwind_init_blocked(&info, task) == 0) | ||
206 | unw_ret = dump_trace_unwind(&info, &oad); | ||
207 | } | ||
208 | if (unw_ret > 0) { | ||
209 | if (call_trace == 1 && !arch_unw_user_mode(&info)) { | ||
210 | ops->warning_symbol(data, | ||
211 | "DWARF2 unwinder stuck at %s", | ||
212 | UNW_PC(&info)); | ||
213 | if (UNW_SP(&info) >= PAGE_OFFSET) { | ||
214 | MSG("Leftover inexact backtrace:"); | ||
215 | stack = (void *)UNW_SP(&info); | ||
216 | if (!stack) | ||
217 | return; | ||
218 | ebp = UNW_FP(&info); | ||
219 | } else | ||
220 | MSG("Full inexact backtrace again:"); | ||
221 | } else if (call_trace >= 1) | ||
222 | return; | ||
223 | else | ||
224 | MSG("Full inexact backtrace again:"); | ||
225 | } else | ||
226 | MSG("Inexact backtrace:"); | ||
227 | } | ||
228 | if (!stack) { | 161 | if (!stack) { |
229 | unsigned long dummy; | 162 | unsigned long dummy; |
230 | stack = &dummy; | 163 | stack = &dummy; |
@@ -1258,19 +1191,3 @@ static int __init kstack_setup(char *s) | |||
1258 | return 1; | 1191 | return 1; |
1259 | } | 1192 | } |
1260 | __setup("kstack=", kstack_setup); | 1193 | __setup("kstack=", kstack_setup); |
1261 | |||
1262 | #ifdef CONFIG_STACK_UNWIND | ||
1263 | static int __init call_trace_setup(char *s) | ||
1264 | { | ||
1265 | if (strcmp(s, "old") == 0) | ||
1266 | call_trace = -1; | ||
1267 | else if (strcmp(s, "both") == 0) | ||
1268 | call_trace = 0; | ||
1269 | else if (strcmp(s, "newfallback") == 0) | ||
1270 | call_trace = 1; | ||
1271 | else if (strcmp(s, "new") == 2) | ||
1272 | call_trace = 2; | ||
1273 | return 1; | ||
1274 | } | ||
1275 | __setup("call_trace=", call_trace_setup); | ||
1276 | #endif | ||
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index b471b8550d03..2941a915d4ef 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile | |||
@@ -45,9 +45,7 @@ cflags-kernel-$(CONFIG_REORDER) += -ffunction-sections | |||
45 | # actually it makes the kernel smaller too. | 45 | # actually it makes the kernel smaller too. |
46 | cflags-y += -fno-reorder-blocks | 46 | cflags-y += -fno-reorder-blocks |
47 | cflags-y += -Wno-sign-compare | 47 | cflags-y += -Wno-sign-compare |
48 | ifneq ($(CONFIG_UNWIND_INFO),y) | ||
49 | cflags-y += -fno-asynchronous-unwind-tables | 48 | cflags-y += -fno-asynchronous-unwind-tables |
50 | endif | ||
51 | ifneq ($(CONFIG_DEBUG_INFO),y) | 49 | ifneq ($(CONFIG_DEBUG_INFO),y) |
52 | # -fweb shrinks the kernel a bit, but the difference is very small | 50 | # -fweb shrinks the kernel a bit, but the difference is very small |
53 | # it also messes up debugging, so don't use it for now. | 51 | # it also messes up debugging, so don't use it for now. |
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index 1a1c6a1a299b..ac80b1209fc0 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig | |||
@@ -1523,8 +1523,6 @@ CONFIG_DEBUG_FS=y | |||
1523 | # CONFIG_DEBUG_VM is not set | 1523 | # CONFIG_DEBUG_VM is not set |
1524 | # CONFIG_DEBUG_LIST is not set | 1524 | # CONFIG_DEBUG_LIST is not set |
1525 | # CONFIG_FRAME_POINTER is not set | 1525 | # CONFIG_FRAME_POINTER is not set |
1526 | CONFIG_UNWIND_INFO=y | ||
1527 | CONFIG_STACK_UNWIND=y | ||
1528 | # CONFIG_FORCED_INLINING is not set | 1526 | # CONFIG_FORCED_INLINING is not set |
1529 | # CONFIG_HEADERS_CHECK is not set | 1527 | # CONFIG_HEADERS_CHECK is not set |
1530 | # CONFIG_RCU_TORTURE_TEST is not set | 1528 | # CONFIG_RCU_TORTURE_TEST is not set |
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 601d332c4b79..9f5dac64aa8f 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -1155,36 +1155,3 @@ ENTRY(call_softirq) | |||
1155 | ret | 1155 | ret |
1156 | CFI_ENDPROC | 1156 | CFI_ENDPROC |
1157 | ENDPROC(call_softirq) | 1157 | ENDPROC(call_softirq) |
1158 | |||
1159 | #ifdef CONFIG_STACK_UNWIND | ||
1160 | ENTRY(arch_unwind_init_running) | ||
1161 | CFI_STARTPROC | ||
1162 | movq %r15, R15(%rdi) | ||
1163 | movq %r14, R14(%rdi) | ||
1164 | xchgq %rsi, %rdx | ||
1165 | movq %r13, R13(%rdi) | ||
1166 | movq %r12, R12(%rdi) | ||
1167 | xorl %eax, %eax | ||
1168 | movq %rbp, RBP(%rdi) | ||
1169 | movq %rbx, RBX(%rdi) | ||
1170 | movq (%rsp), %rcx | ||
1171 | movq %rax, R11(%rdi) | ||
1172 | movq %rax, R10(%rdi) | ||
1173 | movq %rax, R9(%rdi) | ||
1174 | movq %rax, R8(%rdi) | ||
1175 | movq %rax, RAX(%rdi) | ||
1176 | movq %rax, RCX(%rdi) | ||
1177 | movq %rax, RDX(%rdi) | ||
1178 | movq %rax, RSI(%rdi) | ||
1179 | movq %rax, RDI(%rdi) | ||
1180 | movq %rax, ORIG_RAX(%rdi) | ||
1181 | movq %rcx, RIP(%rdi) | ||
1182 | leaq 8(%rsp), %rcx | ||
1183 | movq $__KERNEL_CS, CS(%rdi) | ||
1184 | movq %rax, EFLAGS(%rdi) | ||
1185 | movq %rcx, RSP(%rdi) | ||
1186 | movq $__KERNEL_DS, SS(%rdi) | ||
1187 | jmpq *%rdx | ||
1188 | CFI_ENDPROC | ||
1189 | ENDPROC(arch_unwind_init_running) | ||
1190 | #endif | ||
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index b54ccc07f379..1d9eb6db732a 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -110,11 +110,6 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | int kstack_depth_to_print = 12; | 112 | int kstack_depth_to_print = 12; |
113 | #ifdef CONFIG_STACK_UNWIND | ||
114 | static int call_trace = 1; | ||
115 | #else | ||
116 | #define call_trace (-1) | ||
117 | #endif | ||
118 | 113 | ||
119 | #ifdef CONFIG_KALLSYMS | 114 | #ifdef CONFIG_KALLSYMS |
120 | void printk_address(unsigned long address) | 115 | void printk_address(unsigned long address) |
@@ -217,32 +212,6 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | |||
217 | return NULL; | 212 | return NULL; |
218 | } | 213 | } |
219 | 214 | ||
220 | struct ops_and_data { | ||
221 | struct stacktrace_ops *ops; | ||
222 | void *data; | ||
223 | }; | ||
224 | |||
225 | static int dump_trace_unwind(struct unwind_frame_info *info, void *context) | ||
226 | { | ||
227 | struct ops_and_data *oad = (struct ops_and_data *)context; | ||
228 | int n = 0; | ||
229 | unsigned long sp = UNW_SP(info); | ||
230 | |||
231 | if (arch_unw_user_mode(info)) | ||
232 | return -1; | ||
233 | while (unwind(info) == 0 && UNW_PC(info)) { | ||
234 | n++; | ||
235 | oad->ops->address(oad->data, UNW_PC(info)); | ||
236 | if (arch_unw_user_mode(info)) | ||
237 | break; | ||
238 | if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1)) | ||
239 | && sp > UNW_SP(info)) | ||
240 | break; | ||
241 | sp = UNW_SP(info); | ||
242 | } | ||
243 | return n; | ||
244 | } | ||
245 | |||
246 | #define MSG(txt) ops->warning(data, txt) | 215 | #define MSG(txt) ops->warning(data, txt) |
247 | 216 | ||
248 | /* | 217 | /* |
@@ -270,40 +239,6 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, | |||
270 | if (!tsk) | 239 | if (!tsk) |
271 | tsk = current; | 240 | tsk = current; |
272 | 241 | ||
273 | if (call_trace >= 0) { | ||
274 | int unw_ret = 0; | ||
275 | struct unwind_frame_info info; | ||
276 | struct ops_and_data oad = { .ops = ops, .data = data }; | ||
277 | |||
278 | if (regs) { | ||
279 | if (unwind_init_frame_info(&info, tsk, regs) == 0) | ||
280 | unw_ret = dump_trace_unwind(&info, &oad); | ||
281 | } else if (tsk == current) | ||
282 | unw_ret = unwind_init_running(&info, dump_trace_unwind, | ||
283 | &oad); | ||
284 | else { | ||
285 | if (unwind_init_blocked(&info, tsk) == 0) | ||
286 | unw_ret = dump_trace_unwind(&info, &oad); | ||
287 | } | ||
288 | if (unw_ret > 0) { | ||
289 | if (call_trace == 1 && !arch_unw_user_mode(&info)) { | ||
290 | ops->warning_symbol(data, | ||
291 | "DWARF2 unwinder stuck at %s", | ||
292 | UNW_PC(&info)); | ||
293 | if ((long)UNW_SP(&info) < 0) { | ||
294 | MSG("Leftover inexact backtrace:"); | ||
295 | stack = (unsigned long *)UNW_SP(&info); | ||
296 | if (!stack) | ||
297 | goto out; | ||
298 | } else | ||
299 | MSG("Full inexact backtrace again:"); | ||
300 | } else if (call_trace >= 1) | ||
301 | goto out; | ||
302 | else | ||
303 | MSG("Full inexact backtrace again:"); | ||
304 | } else | ||
305 | MSG("Inexact backtrace:"); | ||
306 | } | ||
307 | if (!stack) { | 242 | if (!stack) { |
308 | unsigned long dummy; | 243 | unsigned long dummy; |
309 | stack = &dummy; | 244 | stack = &dummy; |
@@ -387,7 +322,6 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, | |||
387 | tinfo = current_thread_info(); | 322 | tinfo = current_thread_info(); |
388 | HANDLE_STACK (valid_stack_ptr(tinfo, stack)); | 323 | HANDLE_STACK (valid_stack_ptr(tinfo, stack)); |
389 | #undef HANDLE_STACK | 324 | #undef HANDLE_STACK |
390 | out: | ||
391 | put_cpu(); | 325 | put_cpu(); |
392 | } | 326 | } |
393 | EXPORT_SYMBOL(dump_trace); | 327 | EXPORT_SYMBOL(dump_trace); |
@@ -1188,21 +1122,3 @@ static int __init kstack_setup(char *s) | |||
1188 | return 0; | 1122 | return 0; |
1189 | } | 1123 | } |
1190 | early_param("kstack", kstack_setup); | 1124 | early_param("kstack", kstack_setup); |
1191 | |||
1192 | #ifdef CONFIG_STACK_UNWIND | ||
1193 | static int __init call_trace_setup(char *s) | ||
1194 | { | ||
1195 | if (!s) | ||
1196 | return -EINVAL; | ||
1197 | if (strcmp(s, "old") == 0) | ||
1198 | call_trace = -1; | ||
1199 | else if (strcmp(s, "both") == 0) | ||
1200 | call_trace = 0; | ||
1201 | else if (strcmp(s, "newfallback") == 0) | ||
1202 | call_trace = 1; | ||
1203 | else if (strcmp(s, "new") == 0) | ||
1204 | call_trace = 2; | ||
1205 | return 0; | ||
1206 | } | ||
1207 | early_param("call_trace", call_trace_setup); | ||
1208 | #endif | ||
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 514be5dd2303..1e54ddf2338d 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -221,9 +221,7 @@ SECTIONS | |||
221 | /* Sections to be discarded */ | 221 | /* Sections to be discarded */ |
222 | /DISCARD/ : { | 222 | /DISCARD/ : { |
223 | *(.exitcall.exit) | 223 | *(.exitcall.exit) |
224 | #ifndef CONFIG_UNWIND_INFO | ||
225 | *(.eh_frame) | 224 | *(.eh_frame) |
226 | #endif | ||
227 | } | 225 | } |
228 | 226 | ||
229 | STABS_DEBUG | 227 | STABS_DEBUG |