]> err.no Git - linux-2.6/commitdiff
[PATCH] x86_64: Add kernel thread stack frame termination for properly stopping stack...
authorAndi Kleen <ak@suse.de>
Wed, 30 Aug 2006 17:37:08 +0000 (19:37 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 30 Aug 2006 23:05:15 +0000 (16:05 -0700)
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>
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/head.S

index 6f810424df44ba4aeb5fcd6abb1aea960b07d50b..aa8d8939abc1692df22e7000c226095a44167678 100644 (file)
@@ -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.
@@ -983,6 +985,7 @@ child_rip:
        # exit
        xorl %edi, %edi
        call do_exit
+       CFI_ENDPROC
 ENDPROC(child_rip)
 
 /*
index 6df05e6034faf2cefdb0edfa6b85ef3535724608..c9739ca81d062e31c30aed9ac07df6f921fe5c1f 100644 (file)
@@ -191,6 +191,7 @@ startup_64:
         * jump
         */
        movq    initial_code(%rip),%rax
+       pushq   $0              # fake return address
        jmp     *%rax
 
        /* SMP bootup changes these two */