Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Apr 2015 20:23:34 +0000 (13:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Apr 2015 20:23:34 +0000 (13:23 -0700)
Pull x86 debug changes from Ingo Molnar:
 "Stack printing fixlets"

* 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/kernel: Use kstack_end() in dumpstack_64.c
  x86/kernel: Fix output of show_stack_log_lvl()

1  2 
arch/x86/kernel/dumpstack.c
arch/x86/kernel/dumpstack_32.c

index ab3b65639a3e1d6136d73893bdf76d93e627532c,81b3932edbdc59ddffdf69b68e2fcf3a161dac3c..9c30acfadae24757cca11f00513d089e488da78d
@@@ -25,10 -25,12 +25,12 @@@ unsigned int code_bytes = 64
  int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE;
  static int die_counter;
  
- static void printk_stack_address(unsigned long address, int reliable)
+ static void printk_stack_address(unsigned long address, int reliable,
+               void *data)
  {
-       pr_cont(" [<%p>] %s%pB\n",
-               (void *)address, reliable ? "" : "? ", (void *)address);
+       printk("%s [<%p>] %s%pB\n",
+               (char *)data, (void *)address, reliable ? "" : "? ",
+               (void *)address);
  }
  
  void printk_address(unsigned long address)
@@@ -155,8 -157,7 +157,7 @@@ static int print_trace_stack(void *data
  static void print_trace_address(void *data, unsigned long addr, int reliable)
  {
        touch_nmi_watchdog();
-       printk(data);
-       printk_stack_address(addr, reliable);
+       printk_stack_address(addr, reliable, data);
  }
  
  static const struct stacktrace_ops print_trace_ops = {
@@@ -278,7 -279,7 +279,7 @@@ int __die(const char *str, struct pt_re
        print_modules();
        show_regs(regs);
  #ifdef CONFIG_X86_32
 -      if (user_mode_vm(regs)) {
 +      if (user_mode(regs)) {
                sp = regs->sp;
                ss = regs->ss & 0xffff;
        } else {
@@@ -307,7 -308,7 +308,7 @@@ void die(const char *str, struct pt_reg
        unsigned long flags = oops_begin();
        int sig = SIGSEGV;
  
 -      if (!user_mode_vm(regs))
 +      if (!user_mode(regs))
                report_bug(regs->ip, regs);
  
        if (__die(str, regs, err))
index 39891ff50d037cf9c1cf6ee921427bb558e05975,efff5ed6045d6e105693786c1bdef74c5e276235..464ffd69b92e9ef376b9c534aec3c12973d6ad7a
@@@ -108,9 -108,12 +108,12 @@@ show_stack_log_lvl(struct task_struct *
        for (i = 0; i < kstack_depth_to_print; i++) {
                if (kstack_end(stack))
                        break;
-               if (i && ((i % STACKSLOTS_PER_LINE) == 0))
-                       pr_cont("\n");
-               pr_cont(" %08lx", *stack++);
+               if ((i % STACKSLOTS_PER_LINE) == 0) {
+                       if (i != 0)
+                               pr_cont("\n");
+                       printk("%s %08lx", log_lvl, *stack++);
+               } else
+                       pr_cont(" %08lx", *stack++);
                touch_nmi_watchdog();
        }
        pr_cont("\n");
@@@ -123,13 -126,13 +126,13 @@@ void show_regs(struct pt_regs *regs
        int i;
  
        show_regs_print_info(KERN_EMERG);
 -      __show_regs(regs, !user_mode_vm(regs));
 +      __show_regs(regs, !user_mode(regs));
  
        /*
         * When in-kernel, we also print out the stack and code at the
         * time of the fault..
         */
 -      if (!user_mode_vm(regs)) {
 +      if (!user_mode(regs)) {
                unsigned int code_prologue = code_bytes * 43 / 64;
                unsigned int code_len = code_bytes;
                unsigned char c;