Skip to content

Commit

Permalink
x86: take load_sp0 out of smpboot.c
Browse files Browse the repository at this point in the history
there's no particular reason to do load_sp0 in different
places for i386 and x86_64. They should all be in cpu_init.
Right now, cpu_init itself is not integrated, but with this patch,
the code becomes closer to each other, making in easier to integrate
when the time comes.

Furthermore, although doing it in do_boot_cpu for x86_64 is fine, since it's
only a copy, load_sp0 should be executed in the cpu it refers to anyway.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Jul 8, 2008
1 parent 1481a3d commit 7f6cbc9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions arch/x86/kernel/setup64.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ void __cpuinit cpu_init (void)
BUG();
enter_lazy_tlb(&init_mm, me);

load_sp0(t, &current->thread);
set_tss_desc(cpu, t);
load_TR_desc();
load_LDT(&init_mm.context);
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
irq_ctx_init(cpu);
#else
cpu_pda(cpu)->pcurrent = c_idle.idle;
load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread);
clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
#endif
early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
Expand Down

0 comments on commit 7f6cbc9

Please sign in to comment.