Commit-ID: c8fe4609827aedc9c4b45de80e7cdc8ccfa8541b
Gitweb: http://git.kernel.org/tip/c8fe4609827aedc9c4b45de80e7cdc8ccfa8541b
Author: Josh Poimboeuf
AuthorDate: Fri, 16 Sep 2016 14:18:17 -0500
Committer: Ingo Molnar
CommitDate: Tue, 20 Sep 2016 08:29:34 +0200
x86/dumpstack: Remove dump_trace() and related callbacks
All previous users of dump_trace() have been converted to use the new
unwind interfaces, so we can remove it and the related
print_context_stack() and print_context_stack_bp() callback functions.
Signed-off-by: Josh Poimboeuf
Cc: Andy Lutomirski
Cc: Andy Lutomirski
Cc: Borislav Petkov
Cc: Brian Gerst
Cc: Byungchul Park
Cc: Denys Vlasenko
Cc: Frederic Weisbecker
Cc: H. Peter Anvin
Cc: Kees Cook
Cc: Linus Torvalds
Cc: Nilay Vaish
Cc: Peter Zijlstra
Cc: Steven Rostedt
Cc: Thomas Gleixner
Link:
http://lkml.kernel.org/r/5b97da3572b40b5a4d8e185cf2429308d0987a13.1474045023.git.jpoim...@redhat.com
Signed-off-by: Ingo Molnar
---
arch/x86/include/asm/stacktrace.h | 36
arch/x86/kernel/dumpstack.c | 86 ---
arch/x86/kernel/dumpstack_32.c| 35
arch/x86/kernel/dumpstack_64.c| 69 ---
4 files changed, 226 deletions(-)
diff --git a/arch/x86/include/asm/stacktrace.h
b/arch/x86/include/asm/stacktrace.h
index c9ccf06..37f2e0b 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -45,42 +45,6 @@ static inline bool on_stack(struct stack_info *info, void
*addr, size_t len)
extern int kstack_depth_to_print;
-struct thread_info;
-struct stacktrace_ops;
-
-typedef unsigned long (*walk_stack_t)(struct task_struct *task,
- unsigned long *stack,
- unsigned long bp,
- const struct stacktrace_ops *ops,
- void *data,
- struct stack_info *info,
- int *graph);
-
-extern unsigned long
-print_context_stack(struct task_struct *task,
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data,
- struct stack_info *info, int *graph);
-
-extern unsigned long
-print_context_stack_bp(struct task_struct *task,
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data,
- struct stack_info *info, int *graph);
-
-/* Generic stack tracer with callbacks */
-
-struct stacktrace_ops {
- int (*address)(void *data, unsigned long address, int reliable);
- /* On negative return stop dumping */
- int (*stack)(void *data, const char *name);
- walk_stack_twalk_stack;
-};
-
-void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data);
-
#ifdef CONFIG_X86_32
#define STACKSLOTS_PER_LINE 8
#else
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index c08f32a..999de3b 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -56,92 +56,6 @@ void printk_address(unsigned long address)
pr_cont(" [<%p>] %pS\n", (void *)address, (void *)address);
}
-/*
- * x86-64 can have up to three kernel stacks:
- * process stack
- * interrupt stack
- * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
- */
-
-unsigned long
-print_context_stack(struct task_struct *task,
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data,
- struct stack_info *info, int *graph)
-{
- struct stack_frame *frame = (struct stack_frame *)bp;
-
- /*
-* If we overflowed the stack into a guard page, jump back to the
-* bottom of the usable stack.
-*/
- if ((unsigned long)task_stack_page(task) - (unsigned long)stack <
- PAGE_SIZE)
- stack = (unsigned long *)task_stack_page(task);
-
- while (on_stack(info, stack, sizeof(*stack))) {
- unsigned long addr = *stack;
-
- if (__kernel_text_address(addr)) {
- unsigned long real_addr;
- int reliable = 0;
-
- if ((unsigned long) stack == bp + sizeof(long)) {
- reliable = 1;
- frame = frame->next_frame;
- bp = (unsigned long) frame;
- }
-
- /*
-* When function graph tracing is enabled for a
-* function, its return address on the stack is
-* replaced with the address of an ftrace handler
-*