Skip to contentSkip to conversation

x86/entry/64: Fix unwind hint for rewind_stack_do_exit

PATCH In review Jann Horn 2 participants 2 messages Mar 5, 2020 – Mar 6, 2020

Subsystems (2)
lore
Share & tools
lore

Jann Horn

author
#0 lore raw

PATCH 1/1 x86/entry/64: Fix unwind hint for rewind_stack_do_exit

The leaq instruction in rewind_stack_do_exit moves the stack pointer directly below the pt_regs at the top of the task stack before calling do_exit(). Tell the unwinder to expect pt_regs.

---
 arch/x86/entry/entry_64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/entry_64.S +1 -1
index f2bb91e87877..2393c803fd8c 100644
@@ -1739,7 +1739,7 @@ SYM_CODE_START(rewind_stack_do_exit)
 
 	movq	PER_CPU_VAR(cpu_current_top_of_stack), %rax
 	leaq	-PTREGS_SIZE(%rax), %rsp
-	UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE
+	UNWIND_HINT_REGS
 
 	call	do_exit
 SYM_CODE_END(rewind_stack_do_exit)

base-commit: 9f65ed5fe41ce08ed1cb1f6a950f9ec694c142ad

Signature · 1 line
2.25.0.265.gbab2e86ba0-goog
#1 lore raw
Quoted 5 lines · Jann Horn

The leaq instruction in rewind_stack_do_exit moves the stack pointer directly below the pt_regs at the top of the task stack before calling do_exit(). Tell the unwinder to expect pt_regs.

Thanks Jann. This fits in nicely with my ORC series so I'll add it.

Signature · 1 line
Josh