diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 3 | ||||
-rw-r--r-- | Documentation/sysctl/kernel.txt | 8 | ||||
-rw-r--r-- | Documentation/x86/x86_64/boot-options.txt | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/stacktrace.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 21 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 33 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 53 | ||||
-rw-r--r-- | kernel/sysctl.c | 7 |
8 files changed, 4 insertions, 130 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 37babf91f2cb..049a9172ed22 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1958,9 +1958,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1958 | kmemcheck=2 (one-shot mode) | 1958 | kmemcheck=2 (one-shot mode) |
1959 | Default: 2 (one-shot mode) | 1959 | Default: 2 (one-shot mode) |
1960 | 1960 | ||
1961 | kstack=N [X86] Print N words from the kernel stack | ||
1962 | in oops dumps. | ||
1963 | |||
1964 | kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. | 1961 | kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. |
1965 | Default is 0 (don't ignore, but inject #GP) | 1962 | Default is 0 (don't ignore, but inject #GP) |
1966 | 1963 | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index ffab8b5caa60..065f18478c1c 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -40,7 +40,6 @@ show up in /proc/sys/kernel: | |||
40 | - hung_task_warnings | 40 | - hung_task_warnings |
41 | - kexec_load_disabled | 41 | - kexec_load_disabled |
42 | - kptr_restrict | 42 | - kptr_restrict |
43 | - kstack_depth_to_print [ X86 only ] | ||
44 | - l2cr [ PPC only ] | 43 | - l2cr [ PPC only ] |
45 | - modprobe ==> Documentation/debugging-modules.txt | 44 | - modprobe ==> Documentation/debugging-modules.txt |
46 | - modules_disabled | 45 | - modules_disabled |
@@ -395,13 +394,6 @@ When kptr_restrict is set to (2), kernel pointers printed using | |||
395 | 394 | ||
396 | ============================================================== | 395 | ============================================================== |
397 | 396 | ||
398 | kstack_depth_to_print: (X86 only) | ||
399 | |||
400 | Controls the number of words to print when dumping the raw | ||
401 | kernel stack. | ||
402 | |||
403 | ============================================================== | ||
404 | |||
405 | l2cr: (PPC only) | 397 | l2cr: (PPC only) |
406 | 398 | ||
407 | This flag controls the L2 cache of G3 processor boards. If | 399 | This flag controls the L2 cache of G3 processor boards. If |
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt index 0965a71f9942..61b611e9eeaf 100644 --- a/Documentation/x86/x86_64/boot-options.txt +++ b/Documentation/x86/x86_64/boot-options.txt | |||
@@ -277,10 +277,6 @@ IOMMU (input/output memory management unit) | |||
277 | space might stop working. Use this option if you have devices that | 277 | space might stop working. Use this option if you have devices that |
278 | are accessed from userspace directly on some PCI host bridge. | 278 | are accessed from userspace directly on some PCI host bridge. |
279 | 279 | ||
280 | Debugging | ||
281 | |||
282 | kstack=N Print N words from the kernel stack in oops dumps. | ||
283 | |||
284 | Miscellaneous | 280 | Miscellaneous |
285 | 281 | ||
286 | nogbpages | 282 | nogbpages |
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h index 37f2e0b377ad..1e375b05cfa8 100644 --- a/arch/x86/include/asm/stacktrace.h +++ b/arch/x86/include/asm/stacktrace.h | |||
@@ -43,8 +43,6 @@ static inline bool on_stack(struct stack_info *info, void *addr, size_t len) | |||
43 | addr + len > begin && addr + len <= end); | 43 | addr + len > begin && addr + len <= end); |
44 | } | 44 | } |
45 | 45 | ||
46 | extern int kstack_depth_to_print; | ||
47 | |||
48 | #ifdef CONFIG_X86_32 | 46 | #ifdef CONFIG_X86_32 |
49 | #define STACKSLOTS_PER_LINE 8 | 47 | #define STACKSLOTS_PER_LINE 8 |
50 | #else | 48 | #else |
@@ -86,9 +84,6 @@ get_stack_pointer(struct task_struct *task, struct pt_regs *regs) | |||
86 | void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | 84 | void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, |
87 | unsigned long *stack, char *log_lvl); | 85 | unsigned long *stack, char *log_lvl); |
88 | 86 | ||
89 | void show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | ||
90 | unsigned long *sp, char *log_lvl); | ||
91 | |||
92 | extern unsigned int code_bytes; | 87 | extern unsigned int code_bytes; |
93 | 88 | ||
94 | /* The form of the top of the frame on the stack */ | 89 | /* The form of the top of the frame on the stack */ |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index f967652500fa..499aa6f0fde5 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -22,7 +22,6 @@ | |||
22 | int panic_on_unrecovered_nmi; | 22 | int panic_on_unrecovered_nmi; |
23 | int panic_on_io_nmi; | 23 | int panic_on_io_nmi; |
24 | unsigned int code_bytes = 64; | 24 | unsigned int code_bytes = 64; |
25 | int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; | ||
26 | static int die_counter; | 25 | static int die_counter; |
27 | 26 | ||
28 | bool in_task_stack(unsigned long *stack, struct task_struct *task, | 27 | bool in_task_stack(unsigned long *stack, struct task_struct *task, |
@@ -171,12 +170,12 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
171 | if (!sp && task == current) | 170 | if (!sp && task == current) |
172 | sp = get_stack_pointer(current, NULL); | 171 | sp = get_stack_pointer(current, NULL); |
173 | 172 | ||
174 | show_stack_log_lvl(task, NULL, sp, KERN_DEFAULT); | 173 | show_trace_log_lvl(task, NULL, sp, KERN_DEFAULT); |
175 | } | 174 | } |
176 | 175 | ||
177 | void show_stack_regs(struct pt_regs *regs) | 176 | void show_stack_regs(struct pt_regs *regs) |
178 | { | 177 | { |
179 | show_stack_log_lvl(current, regs, NULL, KERN_DEFAULT); | 178 | show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT); |
180 | } | 179 | } |
181 | 180 | ||
182 | static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; | 181 | static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; |
@@ -295,22 +294,6 @@ void die(const char *str, struct pt_regs *regs, long err) | |||
295 | oops_end(flags, regs, sig); | 294 | oops_end(flags, regs, sig); |
296 | } | 295 | } |
297 | 296 | ||
298 | static int __init kstack_setup(char *s) | ||
299 | { | ||
300 | ssize_t ret; | ||
301 | unsigned long val; | ||
302 | |||
303 | if (!s) | ||
304 | return -EINVAL; | ||
305 | |||
306 | ret = kstrtoul(s, 0, &val); | ||
307 | if (ret) | ||
308 | return ret; | ||
309 | kstack_depth_to_print = val; | ||
310 | return 0; | ||
311 | } | ||
312 | early_param("kstack", kstack_setup); | ||
313 | |||
314 | static int __init code_bytes_setup(char *s) | 297 | static int __init code_bytes_setup(char *s) |
315 | { | 298 | { |
316 | ssize_t ret; | 299 | ssize_t ret; |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 06eb322b5f9f..90cf460d50bd 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -121,36 +121,6 @@ unknown: | |||
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | } | 122 | } |
123 | 123 | ||
124 | void show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | ||
125 | unsigned long *sp, char *log_lvl) | ||
126 | { | ||
127 | unsigned long *stack; | ||
128 | int i; | ||
129 | |||
130 | if (!try_get_task_stack(task)) | ||
131 | return; | ||
132 | |||
133 | sp = sp ? : get_stack_pointer(task, regs); | ||
134 | |||
135 | stack = sp; | ||
136 | for (i = 0; i < kstack_depth_to_print; i++) { | ||
137 | if (kstack_end(stack)) | ||
138 | break; | ||
139 | if ((i % STACKSLOTS_PER_LINE) == 0) { | ||
140 | if (i != 0) | ||
141 | pr_cont("\n"); | ||
142 | printk("%s %08lx", log_lvl, *stack++); | ||
143 | } else | ||
144 | pr_cont(" %08lx", *stack++); | ||
145 | touch_nmi_watchdog(); | ||
146 | } | ||
147 | pr_cont("\n"); | ||
148 | show_trace_log_lvl(task, regs, sp, log_lvl); | ||
149 | |||
150 | put_task_stack(task); | ||
151 | } | ||
152 | |||
153 | |||
154 | void show_regs(struct pt_regs *regs) | 124 | void show_regs(struct pt_regs *regs) |
155 | { | 125 | { |
156 | int i; | 126 | int i; |
@@ -168,8 +138,7 @@ void show_regs(struct pt_regs *regs) | |||
168 | unsigned char c; | 138 | unsigned char c; |
169 | u8 *ip; | 139 | u8 *ip; |
170 | 140 | ||
171 | pr_emerg("Stack:\n"); | 141 | show_trace_log_lvl(current, regs, NULL, KERN_EMERG); |
172 | show_stack_log_lvl(current, regs, NULL, KERN_EMERG); | ||
173 | 142 | ||
174 | pr_emerg("Code:"); | 143 | pr_emerg("Code:"); |
175 | 144 | ||
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 36cf1a498227..310abf4542dc 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -140,56 +140,6 @@ unknown: | |||
140 | return -EINVAL; | 140 | return -EINVAL; |
141 | } | 141 | } |
142 | 142 | ||
143 | void show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | ||
144 | unsigned long *sp, char *log_lvl) | ||
145 | { | ||
146 | unsigned long *irq_stack_end; | ||
147 | unsigned long *irq_stack; | ||
148 | unsigned long *stack; | ||
149 | int i; | ||
150 | |||
151 | if (!try_get_task_stack(task)) | ||
152 | return; | ||
153 | |||
154 | irq_stack_end = (unsigned long *)this_cpu_read(irq_stack_ptr); | ||
155 | irq_stack = irq_stack_end - (IRQ_STACK_SIZE / sizeof(long)); | ||
156 | |||
157 | sp = sp ? : get_stack_pointer(task, regs); | ||
158 | |||
159 | stack = sp; | ||
160 | for (i = 0; i < kstack_depth_to_print; i++) { | ||
161 | unsigned long word; | ||
162 | |||
163 | if (stack >= irq_stack && stack <= irq_stack_end) { | ||
164 | if (stack == irq_stack_end) { | ||
165 | stack = (unsigned long *) (irq_stack_end[-1]); | ||
166 | pr_cont(" <EOI> "); | ||
167 | } | ||
168 | } else { | ||
169 | if (kstack_end(stack)) | ||
170 | break; | ||
171 | } | ||
172 | |||
173 | if (probe_kernel_address(stack, word)) | ||
174 | break; | ||
175 | |||
176 | if ((i % STACKSLOTS_PER_LINE) == 0) { | ||
177 | if (i != 0) | ||
178 | pr_cont("\n"); | ||
179 | printk("%s %016lx", log_lvl, word); | ||
180 | } else | ||
181 | pr_cont(" %016lx", word); | ||
182 | |||
183 | stack++; | ||
184 | touch_nmi_watchdog(); | ||
185 | } | ||
186 | |||
187 | pr_cont("\n"); | ||
188 | show_trace_log_lvl(task, regs, sp, log_lvl); | ||
189 | |||
190 | put_task_stack(task); | ||
191 | } | ||
192 | |||
193 | void show_regs(struct pt_regs *regs) | 143 | void show_regs(struct pt_regs *regs) |
194 | { | 144 | { |
195 | int i; | 145 | int i; |
@@ -207,8 +157,7 @@ void show_regs(struct pt_regs *regs) | |||
207 | unsigned char c; | 157 | unsigned char c; |
208 | u8 *ip; | 158 | u8 *ip; |
209 | 159 | ||
210 | printk(KERN_DEFAULT "Stack:\n"); | 160 | show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT); |
211 | show_stack_log_lvl(current, regs, NULL, KERN_DEFAULT); | ||
212 | 161 | ||
213 | printk(KERN_DEFAULT "Code: "); | 162 | printk(KERN_DEFAULT "Code: "); |
214 | 163 | ||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 706309f9ed84..17a5a8253294 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -990,13 +990,6 @@ static struct ctl_table kern_table[] = { | |||
990 | .proc_handler = proc_dointvec, | 990 | .proc_handler = proc_dointvec, |
991 | }, | 991 | }, |
992 | { | 992 | { |
993 | .procname = "kstack_depth_to_print", | ||
994 | .data = &kstack_depth_to_print, | ||
995 | .maxlen = sizeof(int), | ||
996 | .mode = 0644, | ||
997 | .proc_handler = proc_dointvec, | ||
998 | }, | ||
999 | { | ||
1000 | .procname = "io_delay_type", | 993 | .procname = "io_delay_type", |
1001 | .data = &io_delay_type, | 994 | .data = &io_delay_type, |
1002 | .maxlen = sizeof(int), | 995 | .maxlen = sizeof(int), |