Skip to content

Commit 487c4b2

Browse files
author
Greentime Hu
committed
nds32: Only print one page of stack when die to prevent printing too much information.
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 <[email protected]>
1 parent 95f93ed commit 487c4b2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/nds32/kernel/traps.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,10 @@ void die(const char *str, struct pt_regs *regs, int err)
173173
pr_emerg("CPU: %i\n", smp_processor_id());
174174
show_regs(regs);
175175
pr_emerg("Process %s (pid: %d, stack limit = 0x%p)\n",
176-
tsk->comm, tsk->pid, task_thread_info(tsk) + 1);
176+
tsk->comm, tsk->pid, end_of_stack(tsk));
177177

178178
if (!user_mode(regs) || in_interrupt()) {
179-
dump_mem("Stack: ", regs->sp,
180-
THREAD_SIZE + (unsigned long)task_thread_info(tsk));
179+
dump_mem("Stack: ", regs->sp, (regs->sp + PAGE_SIZE) & PAGE_MASK);
181180
dump_instr(regs);
182181
dump_stack();
183182
}

0 commit comments

Comments
 (0)