From: Andi Kleen Date: Mon, 12 Sep 2005 16:49:24 +0000 (+0200) Subject: [PATCH] x86-64: Set the stack pointer correctly in init_thread and init_tss X-Git-Tag: 2.1b_release~39677 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0d58c9741e4ef42f5fbdfb2a6b86f03c6e9092f;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git [PATCH] x86-64: Set the stack pointer correctly in init_thread and init_tss Signed-off-by: Jan Beulich Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c index c4dc914..e0ba5c1 100644 --- a/arch/x86_64/kernel/init_task.c +++ b/arch/x86_64/kernel/init_task.c @@ -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"))) diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index c6461c1..03837d3 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h @@ -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 }