aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-05-20 03:02:28 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-05-20 03:02:28 -0400
commit521c180874dae86f675d23c4eade4dba8b1f2cc8 (patch)
tree7509303da3a9a1b40a26f6811f321c89cd31737b /kernel/panic.c
parentf1a11e0576c7a73d759d05d776692b2b2d37172b (diff)
parent64d1304a64477629cb16b75491a77bafe6f86963 (diff)
Merge branch 'core/urgent' into core/futexes
Merge reason: this branch was on an pre -rc1 base, merge it up to -rc6+ to get the latest upstream fixes. Conflicts: kernel/futex.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c52
1 files changed, 36 insertions, 16 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 3fd8c5bf8b39..984b3ecbd72c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -213,8 +213,16 @@ unsigned long get_taint(void)
213 213
214void add_taint(unsigned flag) 214void add_taint(unsigned flag)
215{ 215{
216 /* can't trust the integrity of the kernel anymore: */ 216 /*
217 debug_locks = 0; 217 * Can't trust the integrity of the kernel anymore.
218 * We don't call directly debug_locks_off() because the issue
219 * is not necessarily serious enough to set oops_in_progress to 1
220 * Also we want to keep up lockdep for staging development and
221 * post-warning case.
222 */
223 if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
224 printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
225
218 set_bit(flag, &tainted_mask); 226 set_bit(flag, &tainted_mask);
219} 227}
220EXPORT_SYMBOL(add_taint); 228EXPORT_SYMBOL(add_taint);
@@ -332,34 +340,46 @@ void oops_exit(void)
332} 340}
333 341
334#ifdef WANT_WARN_ON_SLOWPATH 342#ifdef WANT_WARN_ON_SLOWPATH
335void warn_slowpath(const char *file, int line, const char *fmt, ...) 343struct slowpath_args {
336{ 344 const char *fmt;
337 va_list args; 345 va_list args;
338 char function[KSYM_SYMBOL_LEN]; 346};
339 unsigned long caller = (unsigned long)__builtin_return_address(0);
340 const char *board;
341 347
342 sprint_symbol(function, caller); 348static void warn_slowpath_common(const char *file, int line, void *caller, struct slowpath_args *args)
349{
350 const char *board;
343 351
344 printk(KERN_WARNING "------------[ cut here ]------------\n"); 352 printk(KERN_WARNING "------------[ cut here ]------------\n");
345 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, 353 printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
346 line, function);
347 board = dmi_get_system_info(DMI_PRODUCT_NAME); 354 board = dmi_get_system_info(DMI_PRODUCT_NAME);
348 if (board) 355 if (board)
349 printk(KERN_WARNING "Hardware name: %s\n", board); 356 printk(KERN_WARNING "Hardware name: %s\n", board);
350 357
351 if (fmt) { 358 if (args)
352 va_start(args, fmt); 359 vprintk(args->fmt, args->args);
353 vprintk(fmt, args);
354 va_end(args);
355 }
356 360
357 print_modules(); 361 print_modules();
358 dump_stack(); 362 dump_stack();
359 print_oops_end_marker(); 363 print_oops_end_marker();
360 add_taint(TAINT_WARN); 364 add_taint(TAINT_WARN);
361} 365}
362EXPORT_SYMBOL(warn_slowpath); 366
367void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
368{
369 struct slowpath_args args;
370
371 args.fmt = fmt;
372 va_start(args.args, fmt);
373 warn_slowpath_common(file, line, __builtin_return_address(0), &args);
374 va_end(args.args);
375}
376EXPORT_SYMBOL(warn_slowpath_fmt);
377
378void warn_slowpath_null(const char *file, int line)
379{
380 warn_slowpath_common(file, line, __builtin_return_address(0), NULL);
381}
382EXPORT_SYMBOL(warn_slowpath_null);
363#endif 383#endif
364 384
365#ifdef CONFIG_CC_STACKPROTECTOR 385#ifdef CONFIG_CC_STACKPROTECTOR