diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2016-09-16 15:18:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-20 02:29:34 -0400 |
commit | c8fe4609827aedc9c4b45de80e7cdc8ccfa8541b (patch) | |
tree | ec2203c6ae7e3d364c5e74d599269db483f46d5f /arch/x86/kernel/dumpstack.c | |
parent | e18bcccd1a4ecb41e99678e002ef833586185bf1 (diff) |
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 <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/5b97da3572b40b5a4d8e185cf2429308d0987a13.1474045023.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index c08f32ab8ace..999de3b3f7f4 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -56,92 +56,6 @@ void printk_address(unsigned long address) | |||
56 | pr_cont(" [<%p>] %pS\n", (void *)address, (void *)address); | 56 | pr_cont(" [<%p>] %pS\n", (void *)address, (void *)address); |
57 | } | 57 | } |
58 | 58 | ||
59 | /* | ||
60 | * x86-64 can have up to three kernel stacks: | ||
61 | * process stack | ||
62 | * interrupt stack | ||
63 | * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack | ||
64 | */ | ||
65 | |||
66 | unsigned long | ||
67 | print_context_stack(struct task_struct *task, | ||
68 | unsigned long *stack, unsigned long bp, | ||
69 | const struct stacktrace_ops *ops, void *data, | ||
70 | struct stack_info *info, int *graph) | ||
71 | { | ||
72 | struct stack_frame *frame = (struct stack_frame *)bp; | ||
73 | |||
74 | /* | ||
75 | * If we overflowed the stack into a guard page, jump back to the | ||
76 | * bottom of the usable stack. | ||
77 | */ | ||
78 | if ((unsigned long)task_stack_page(task) - (unsigned long)stack < | ||
79 | PAGE_SIZE) | ||
80 | stack = (unsigned long *)task_stack_page(task); | ||
81 | |||
82 | while (on_stack(info, stack, sizeof(*stack))) { | ||
83 | unsigned long addr = *stack; | ||
84 | |||
85 | if (__kernel_text_address(addr)) { | ||
86 | unsigned long real_addr; | ||
87 | int reliable = 0; | ||
88 | |||
89 | if ((unsigned long) stack == bp + sizeof(long)) { | ||
90 | reliable = 1; | ||
91 | frame = frame->next_frame; | ||
92 | bp = (unsigned long) frame; | ||
93 | } | ||
94 | |||
95 | /* | ||
96 | * When function graph tracing is enabled for a | ||
97 | * function, its return address on the stack is | ||
98 | * replaced with the address of an ftrace handler | ||
99 | * (return_to_handler). In that case, before printing | ||
100 | * the "real" address, we want to print the handler | ||
101 | * address as an "unreliable" hint that function graph | ||
102 | * tracing was involved. | ||
103 | */ | ||
104 | real_addr = ftrace_graph_ret_addr(task, graph, addr, | ||
105 | stack); | ||
106 | if (real_addr != addr) | ||
107 | ops->address(data, addr, 0); | ||
108 | |||
109 | ops->address(data, real_addr, reliable); | ||
110 | } | ||
111 | stack++; | ||
112 | } | ||
113 | return bp; | ||
114 | } | ||
115 | EXPORT_SYMBOL_GPL(print_context_stack); | ||
116 | |||
117 | unsigned long | ||
118 | print_context_stack_bp(struct task_struct *task, | ||
119 | unsigned long *stack, unsigned long bp, | ||
120 | const struct stacktrace_ops *ops, void *data, | ||
121 | struct stack_info *info, int *graph) | ||
122 | { | ||
123 | struct stack_frame *frame = (struct stack_frame *)bp; | ||
124 | unsigned long *retp = &frame->return_address; | ||
125 | |||
126 | while (on_stack(info, stack, sizeof(*stack) * 2)) { | ||
127 | unsigned long addr = *retp; | ||
128 | unsigned long real_addr; | ||
129 | |||
130 | if (!__kernel_text_address(addr)) | ||
131 | break; | ||
132 | |||
133 | real_addr = ftrace_graph_ret_addr(task, graph, addr, retp); | ||
134 | if (ops->address(data, real_addr, 1)) | ||
135 | break; | ||
136 | |||
137 | frame = frame->next_frame; | ||
138 | retp = &frame->return_address; | ||
139 | } | ||
140 | |||
141 | return (unsigned long)frame; | ||
142 | } | ||
143 | EXPORT_SYMBOL_GPL(print_context_stack_bp); | ||
144 | |||
145 | void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | 59 | void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, |
146 | unsigned long *stack, char *log_lvl) | 60 | unsigned long *stack, char *log_lvl) |
147 | { | 61 | { |