]> err.no Git - linux-2.6/commitdiff
[PATCH] x86-64: Set the stack pointer correctly in init_thread and init_tss
authorAndi Kleen <ak@suse.de>
Mon, 12 Sep 2005 16:49:24 +0000 (18:49 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 12 Sep 2005 17:50:57 +0000 (10:50 -0700)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/kernel/init_task.c
include/asm-x86_64/processor.h

index c4dc9149115741cf4b48c385adf8a49ec91979a8..e0ba5c1043fd23f71e48e236aebcb18b41d3934a 100644 (file)
@@ -44,6 +44,6 @@ EXPORT_SYMBOL(init_task);
  * section. Since TSS's are completely CPU-local, we want them
  * on exact cacheline boundaries, to eliminate cacheline ping-pong.
  */ 
-DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp;
+DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp = INIT_TSS;
 
 #define ALIGN_TO_4K __attribute__((section(".data.init_task")))
index c6461c16edbf9f6c6a605926c3bbf6d5e67fa714..03837d34fba0ccdb4caab752902f1bc943755876 100644 (file)
@@ -254,7 +254,13 @@ struct thread_struct {
        u64 tls_array[GDT_ENTRY_TLS_ENTRIES];
 } __attribute__((aligned(16)));
 
-#define INIT_THREAD  {}
+#define INIT_THREAD  { \
+       .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \
+}
+
+#define INIT_TSS  { \
+       .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \
+}
 
 #define INIT_MMAP \
 { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }