]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
nds32: Only print one page of stack when die to prevent printing too much information.
authorGreentime Hu <greentime@andestech.com>
Thu, 23 Aug 2018 06:47:43 +0000 (14:47 +0800)
committerGreentime Hu <greentime@andestech.com>
Tue, 4 Sep 2018 06:45:19 +0000 (14:45 +0800)
It may print too much information sometimes if the stack is wrong or
too big. This patch can limit the debug information in a page of stack.

Signed-off-by: Greentime Hu <greentime@andestech.com>
arch/nds32/kernel/traps.c

index b0b85b7ab0792a56b3bb9da5867a7991da015e5b..1496aab48998817c00cb175dbd8b09b3453d73dd 100644 (file)
@@ -173,11 +173,10 @@ void die(const char *str, struct pt_regs *regs, int err)
        pr_emerg("CPU: %i\n", smp_processor_id());
        show_regs(regs);
        pr_emerg("Process %s (pid: %d, stack limit = 0x%p)\n",
-                tsk->comm, tsk->pid, task_thread_info(tsk) + 1);
+                tsk->comm, tsk->pid, end_of_stack(tsk));
 
        if (!user_mode(regs) || in_interrupt()) {
-               dump_mem("Stack: ", regs->sp,
-                        THREAD_SIZE + (unsigned long)task_thread_info(tsk));
+               dump_mem("Stack: ", regs->sp, (regs->sp + PAGE_SIZE) & PAGE_MASK);
                dump_instr(regs);
                dump_stack();
        }