diff options
author | Andi Kleen <ak@suse.de> | 2006-08-30 13:37:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-30 19:05:15 -0400 |
commit | c05991ed12fd71e539dd8de8f5663450cd0c934c (patch) | |
tree | e9a86dac1c2bf688d0683be97a5de32af59c175e | |
parent | 11012d419cfc0e0f78ca356aca03674217910124 (diff) |
[PATCH] x86_64: Add kernel thread stack frame termination for properly 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>
-rw-r--r-- | arch/x86_64/kernel/entry.S | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/head.S | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 6f810424df44..aa8d8939abc1 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -973,6 +973,8 @@ ENTRY(kernel_thread) | |||
973 | ENDPROC(kernel_thread) | 973 | ENDPROC(kernel_thread) |
974 | 974 | ||
975 | child_rip: | 975 | child_rip: |
976 | pushq $0 # fake return address | ||
977 | CFI_STARTPROC | ||
976 | /* | 978 | /* |
977 | * Here we are in the child and the registers are set as they were | 979 | * Here we are in the child and the registers are set as they were |
978 | * at kernel_thread() invocation in the parent. | 980 | * at kernel_thread() invocation in the parent. |
@@ -983,6 +985,7 @@ child_rip: | |||
983 | # exit | 985 | # exit |
984 | xorl %edi, %edi | 986 | xorl %edi, %edi |
985 | call do_exit | 987 | call do_exit |
988 | CFI_ENDPROC | ||
986 | ENDPROC(child_rip) | 989 | ENDPROC(child_rip) |
987 | 990 | ||
988 | /* | 991 | /* |
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 6df05e6034fa..c9739ca81d06 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -191,6 +191,7 @@ startup_64: | |||
191 | * jump | 191 | * jump |
192 | */ | 192 | */ |
193 | movq initial_code(%rip),%rax | 193 | movq initial_code(%rip),%rax |
194 | pushq $0 # fake return address | ||
194 | jmp *%rax | 195 | jmp *%rax |
195 | 196 | ||
196 | /* SMP bootup changes these two */ | 197 | /* SMP bootup changes these two */ |