diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-05-27 21:22:54 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:48:14 -0400 |
commit | 9cf4f298e29abba25c16679fe7be70898223167e (patch) | |
tree | 009af01f7c8001fb86fcfa25226d0c78248b83c9 /arch/x86/kernel | |
parent | a7bf0bd5e6af7fe69342dabf2a3b721f0163469a (diff) |
x86: use stack_start in x86_64
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>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 5 | ||||
-rw-r--r-- | 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 36af01f029ed..a81f468ab410 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -86,7 +86,7 @@ int acpi_save_state_mem(void) | |||
86 | saved_magic = 0x12345678; | 86 | saved_magic = 0x12345678; |
87 | #else /* CONFIG_64BIT */ | 87 | #else /* CONFIG_64BIT */ |
88 | header->trampoline_segment = setup_trampoline() >> 4; | 88 | header->trampoline_segment = setup_trampoline() >> 4; |
89 | init_rsp = (unsigned long)temp_stack + 4096; | 89 | stack_start.sp = temp_stack + 4096; |
90 | initial_code = (unsigned long)wakeup_long64; | 90 | initial_code = (unsigned long)wakeup_long64; |
91 | saved_magic = 0x123456789abcdef0; | 91 | saved_magic = 0x123456789abcdef0; |
92 | #endif /* CONFIG_64BIT */ | 92 | #endif /* CONFIG_64BIT */ |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 263b9d14753e..918a2711aff6 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -191,7 +191,7 @@ ENTRY(secondary_startup_64) | |||
191 | movq %rax, %cr0 | 191 | movq %rax, %cr0 |
192 | 192 | ||
193 | /* Setup a boot time stack */ | 193 | /* Setup a boot time stack */ |
194 | movq init_rsp(%rip),%rsp | 194 | movq stack_start(%rip),%rsp |
195 | 195 | ||
196 | /* zero EFLAGS after setting rsp */ | 196 | /* zero EFLAGS after setting rsp */ |
197 | pushq $0 | 197 | pushq $0 |
@@ -252,8 +252,9 @@ ENTRY(secondary_startup_64) | |||
252 | .quad x86_64_start_kernel | 252 | .quad x86_64_start_kernel |
253 | __FINITDATA | 253 | __FINITDATA |
254 | 254 | ||
255 | ENTRY(init_rsp) | 255 | ENTRY(stack_start) |
256 | .quad init_thread_union+THREAD_SIZE-8 | 256 | .quad init_thread_union+THREAD_SIZE-8 |
257 | .word 0 | ||
257 | 258 | ||
258 | bad_address: | 259 | bad_address: |
259 | jmp bad_address | 260 | jmp bad_address |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index d3ad4e09455b..a71e3cad5470 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) | |||
714 | * target processor state. | 714 | * target processor state. |
715 | */ | 715 | */ |
716 | startup_ipi_hook(phys_apicid, (unsigned long) start_secondary, | 716 | startup_ipi_hook(phys_apicid, (unsigned long) start_secondary, |
717 | #ifdef CONFIG_X86_64 | ||
718 | (unsigned long)init_rsp); | ||
719 | #else | ||
720 | (unsigned long)stack_start.sp); | 717 | (unsigned long)stack_start.sp); |
721 | #endif | ||
722 | 718 | ||
723 | /* | 719 | /* |
724 | * Run STARTUP IPI loop. | 720 | * Run STARTUP IPI loop. |
@@ -905,15 +901,14 @@ do_rest: | |||
905 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); | 901 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); |
906 | c_idle.idle->thread.ip = (unsigned long) start_secondary; | 902 | c_idle.idle->thread.ip = (unsigned long) start_secondary; |
907 | /* Stack for startup_32 can be just as for start_secondary onwards */ | 903 | /* Stack for startup_32 can be just as for start_secondary onwards */ |
908 | stack_start.sp = (void *) c_idle.idle->thread.sp; | ||
909 | irq_ctx_init(cpu); | 904 | irq_ctx_init(cpu); |
910 | #else | 905 | #else |
911 | cpu_pda(cpu)->pcurrent = c_idle.idle; | 906 | cpu_pda(cpu)->pcurrent = c_idle.idle; |
912 | init_rsp = c_idle.idle->thread.sp; | ||
913 | load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread); | 907 | load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread); |
914 | initial_code = (unsigned long)start_secondary; | 908 | initial_code = (unsigned long)start_secondary; |
915 | clear_tsk_thread_flag(c_idle.idle, TIF_FORK); | 909 | clear_tsk_thread_flag(c_idle.idle, TIF_FORK); |
916 | #endif | 910 | #endif |
911 | stack_start.sp = (void *) c_idle.idle->thread.sp; | ||
917 | 912 | ||
918 | /* start_ip had better be page-aligned! */ | 913 | /* start_ip had better be page-aligned! */ |
919 | start_ip = setup_trampoline(); | 914 | start_ip = setup_trampoline(); |