Skip to content

Commit

Permalink
[PATCH] x86_64: Add kernel thread stack frame termination for properl…
Browse files Browse the repository at this point in the history
…y stopping stack unwinds.

One open question: Should these added pushes perhaps be made
conditional upon CONFIG_STACK_UNWIND or CONFIG_UNWIND_INFO?
[AK: Not needed -- these are all very slow paths]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Aug 30, 2006
1 parent 11012d4 commit c05991e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86_64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@ ENTRY(kernel_thread)
ENDPROC(kernel_thread)

child_rip:
pushq $0 # fake return address
CFI_STARTPROC
/*
* Here we are in the child and the registers are set as they were
* at kernel_thread() invocation in the parent.
Expand All @@ -983,6 +985,7 @@ child_rip:
# exit
xorl %edi, %edi
call do_exit
CFI_ENDPROC
ENDPROC(child_rip)

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86_64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ startup_64:
* jump
*/
movq initial_code(%rip),%rax
pushq $0 # fake return address
jmp *%rax

/* SMP bootup changes these two */
Expand Down

0 comments on commit c05991e

Please sign in to comment.