Skip to content

Commit 3ffdeb1

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/dumpstack: Print registers for first stack frame
In the stack dump code, if the frame after the starting pt_regs is also a regs frame, the registers don't get printed. Fix that. Reported-by: Andy Lutomirski <[email protected]> Tested-by: Alexander Tsoy <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Toralf Förster <[email protected]> Cc: [email protected] Fixes: 3b3fa11 ("x86/dumpstack: Print any pt_regs found on the stack") Link: http://lkml.kernel.org/r/396f84491d2f0ef64eda4217a2165f5712f6a115.1514736742.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <[email protected]>
1 parent a9cdbe7 commit 3ffdeb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kernel/dumpstack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
115115

116116
unwind_start(&state, task, regs, stack);
117117
stack = stack ? : get_stack_pointer(task, regs);
118+
regs = unwind_get_entry_regs(&state, &partial);
118119

119120
/*
120121
* Iterate through the stacks, starting with the current stack pointer.
@@ -132,7 +133,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
132133
* - hardirq stack
133134
* - entry stack
134135
*/
135-
for (regs = NULL; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
136+
for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
136137
const char *stack_name;
137138

138139
if (get_stack_info(stack, task, &stack_info, &visit_mask)) {

0 commit comments

Comments
 (0)