mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "Andreas Kleen" <ak@suse.de>
Cc: <linux-kernel@vger.kernel.org>, <discuss@x86-64.org>
Subject: [PATCH] set stack pointer in init_tss and init_thread
Date: Thu, 08 Sep 2005 18:06:46 +0200	[thread overview]
Message-ID: <43207DB6020000780002453F@emea1-mh.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Set the stack pointer correctly in init_thread and init_tss.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/arch/x86_64/kernel/init_task.c
2.6.13-x86_64-init/arch/x86_64/kernel/init_task.c
--- 2.6.13/arch/x86_64/kernel/init_task.c	2005-08-29
01:41:01.000000000 +0200
+++ 2.6.13-x86_64-init/arch/x86_64/kernel/init_task.c	2005-03-17
13:20:48.000000000 +0100
@@ -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 -Npru 2.6.13/include/asm-x86_64/processor.h
2.6.13-x86_64-init/include/asm-x86_64/processor.h
--- 2.6.13/include/asm-x86_64/processor.h	2005-08-29
01:41:01.000000000 +0200
+++ 2.6.13-x86_64-init/include/asm-x86_64/processor.h	2005-09-01
11:32:12.000000000 +0200
@@ -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 }


[-- Attachment #2: linux-2.6.13-x86_64-init.patch --]
[-- Type: application/octet-stream, Size: 1579 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Set the stack pointer correctly in init_thread and init_tss.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/arch/x86_64/kernel/init_task.c 2.6.13-x86_64-init/arch/x86_64/kernel/init_task.c
--- 2.6.13/arch/x86_64/kernel/init_task.c	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-init/arch/x86_64/kernel/init_task.c	2005-03-17 13:20:48.000000000 +0100
@@ -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 -Npru 2.6.13/include/asm-x86_64/processor.h 2.6.13-x86_64-init/include/asm-x86_64/processor.h
--- 2.6.13/include/asm-x86_64/processor.h	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-init/include/asm-x86_64/processor.h	2005-09-01 11:32:12.000000000 +0200
@@ -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 }

             reply	other threads:[~2005-09-08 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08 16:06 Jan Beulich [this message]
2005-09-09  8:52 ` [discuss] " Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43207DB6020000780002453F@emea1-mh.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®