mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, tglx@linutronix.de, mingo@elte.hu,
	hugh@veritas.com
Subject: [PATCH 01/15] x86: use stack_start in x86_64
Date: Mon,  9 Jun 2008 11:16:44 -0300	[thread overview]
Message-ID: <1213021018-14159-2-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1213021018-14159-1-git-send-email-gcosta@redhat.com>

call x86_64's init_rsp stack_start, just as i386 does.
Put a zeroed stack segment for consistency. With this,
we can eliminate one ugly ifdef in smpboot.c.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 arch/x86/kernel/acpi/sleep.c |    2 +-
 arch/x86/kernel/head_64.S    |    5 +++--
 arch/x86/kernel/smpboot.c    |    7 +------
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index afc25ee..0103af2 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -72,7 +72,7 @@ int acpi_save_state_mem(void)
 	saved_magic = 0x12345678;
 #else /* CONFIG_64BIT */
 	header->trampoline_segment = setup_trampoline() >> 4;
-	init_rsp = (unsigned long)temp_stack + 4096;
+	stack_start.sp = temp_stack + 4096;
 	initial_code = (unsigned long)wakeup_long64;
 	saved_magic = 0x123456789abcdef0;
 #endif /* CONFIG_64BIT */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index d8ed325..4949c32 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -191,7 +191,7 @@ ENTRY(secondary_startup_64)
 	movq	%rax, %cr0
 
 	/* Setup a boot time stack */
-	movq init_rsp(%rip),%rsp
+	movq stack_start(%rip),%rsp
 
 	/* zero EFLAGS after setting rsp */
 	pushq $0
@@ -252,8 +252,9 @@ ENTRY(secondary_startup_64)
 	.quad	x86_64_start_kernel
 	__FINITDATA
 
-	ENTRY(init_rsp)
+	ENTRY(stack_start)
 	.quad  init_thread_union+THREAD_SIZE-8
+	.word  0
 
 bad_address:
 	jmp bad_address
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 722b24b..c77a7d2 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -714,11 +714,7 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
 	 * target processor state.
 	 */
 	startup_ipi_hook(phys_apicid, (unsigned long) start_secondary,
-#ifdef CONFIG_X86_64
-			 (unsigned long)init_rsp);
-#else
 			 (unsigned long)stack_start.sp);
-#endif
 
 	/*
 	 * Run STARTUP IPI loop.
@@ -905,15 +901,14 @@ do_rest:
 	early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
 	c_idle.idle->thread.ip = (unsigned long) start_secondary;
 	/* Stack for startup_32 can be just as for start_secondary onwards */
-	stack_start.sp = (void *) c_idle.idle->thread.sp;
 	irq_ctx_init(cpu);
 #else
 	cpu_pda(cpu)->pcurrent = c_idle.idle;
-	init_rsp = c_idle.idle->thread.sp;
 	load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread);
 	initial_code = (unsigned long)start_secondary;
 	clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
 #endif
+	stack_start.sp = (void *) c_idle.idle->thread.sp;
 
 	/* start_ip had better be page-aligned! */
 	start_ip = setup_trampoline();
-- 
1.5.4.5


  reply	other threads:[~2008-06-09 14:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 14:16 [PATCH 0/15] Improve x86 smpboot integration Glauber Costa
2008-06-09 14:16 ` Glauber Costa [this message]
2008-06-09 14:16   ` [PATCH 02/15] x86: don't use gdt_page openly Glauber Costa
2008-06-09 14:16     ` [PATCH 03/15] x86: remove early_gdt_descr reference Glauber Costa
2008-06-09 14:16       ` [PATCH 04/15] x86: move x86_64 gdt closer to i386 Glauber Costa
2008-06-09 14:16         ` [PATCH 05/15] x86: use initial_code for i386 Glauber Costa
2008-06-09 14:16           ` [PATCH 06/15] x86: boot secondary cpus through initial_code Glauber Costa
2008-06-09 14:16             ` [PATCH 07/15] x86: clearing io_apic harmless for x86_64 Glauber Costa
2008-06-09 14:16               ` [PATCH 08/15] x86: remove ifdef from stepping Glauber Costa
2008-06-09 14:16                 ` [PATCH 09/15] x86: change __setup_vector_irq with setup_vector_irq Glauber Costa
2008-06-09 14:16                   ` [PATCH 10/15] x86: provide connect_bsp_APIC for x86_64 Glauber Costa
2008-06-09 14:16                     ` [PATCH 11/15] x86: move enabling of io_apic to prepare_cpus Glauber Costa
2008-06-09 14:16                       ` [PATCH 12/15] x86: change naming to match x86_64 Glauber Costa
2008-06-09 14:16                         ` [PATCH 13/15] x86: remove cpu from maps Glauber Costa
2008-06-09 14:16                           ` [PATCH 14/15] x86: move cpu_exit_clear to process_32.c Glauber Costa
2008-06-09 14:16                             ` [PATCH 15/15] x86: take load_sp0 out of smpboot.c Glauber Costa
2008-06-09 15:23                       ` [PATCH 11/15] x86: move enabling of io_apic to prepare_cpus Maciej W. Rozycki
2008-06-09 15:52                         ` Glauber Costa
2008-06-09 19:44                         ` Glauber Costa
2008-06-09 20:12                           ` Maciej W. Rozycki
2008-06-09 20:53                             ` Yinghai Lu
2008-06-09 21:00                               ` Maciej W. Rozycki
2008-06-10  2:46                                 ` Maciej W. Rozycki
2008-06-10  5:08                                   ` Yinghai Lu
2008-06-10 13:00                                     ` Glauber Costa
2008-06-10 13:30                                       ` Maciej W. Rozycki
2008-06-10 19:09                                         ` Yinghai Lu
2008-06-10 19:36                                           ` Maciej W. Rozycki
2008-06-10 19:49                                             ` Yinghai Lu
2008-06-11  0:29                                               ` Maciej W. Rozycki
2008-06-11  2:32                                                 ` Yinghai Lu
2008-06-11 12:57                                                   ` Maciej W. Rozycki
2008-06-09 21:02                             ` Glauber Costa
2008-06-09 15:23       ` [PATCH 03/15] x86: remove early_gdt_descr reference James Bottomley
2008-06-09 15:49         ` Glauber Costa
2008-06-09 17:20           ` James Bottomley
2008-06-09 17:23             ` Glauber Costa
2008-06-09 17:40               ` James Bottomley

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=1213021018-14159-2-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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®