x86: boot secondary cpus through initial_code
remove "initialize_secondary". Boot both architectures via initial_code. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
e3f77edfc1
commit
3e9704739d
|
@ -452,7 +452,7 @@ is386: movl $2,%ecx # set MP
|
||||||
je 1f
|
je 1f
|
||||||
movl $(__KERNEL_PERCPU), %eax
|
movl $(__KERNEL_PERCPU), %eax
|
||||||
movl %eax,%fs # set this cpu's percpu
|
movl %eax,%fs # set this cpu's percpu
|
||||||
jmp initialize_secondary # all other CPUs call initialize_secondary
|
movl (stack_start), %esp
|
||||||
1:
|
1:
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
jmp *(initial_code)
|
jmp *(initial_code)
|
||||||
|
|
|
@ -349,28 +349,6 @@ static void __cpuinit start_secondary(void *unused)
|
||||||
cpu_idle();
|
cpu_idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
|
||||||
/*
|
|
||||||
* Everything has been set up for the secondary
|
|
||||||
* CPUs - they just need to reload everything
|
|
||||||
* from the task structure
|
|
||||||
* This function must not return.
|
|
||||||
*/
|
|
||||||
void __devinit initialize_secondary(void)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* We don't actually need to load the full TSS,
|
|
||||||
* basically just the stack pointer and the ip.
|
|
||||||
*/
|
|
||||||
|
|
||||||
asm volatile(
|
|
||||||
"movl %0,%%esp\n\t"
|
|
||||||
"jmp *%1"
|
|
||||||
:
|
|
||||||
:"m" (current->thread.sp), "m" (current->thread.ip));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c)
|
static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
|
@ -892,16 +870,15 @@ do_rest:
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
per_cpu(current_task, cpu) = c_idle.idle;
|
per_cpu(current_task, cpu) = c_idle.idle;
|
||||||
init_gdt(cpu);
|
init_gdt(cpu);
|
||||||
c_idle.idle->thread.ip = (unsigned long) start_secondary;
|
|
||||||
/* Stack for startup_32 can be just as for start_secondary onwards */
|
/* Stack for startup_32 can be just as for start_secondary onwards */
|
||||||
irq_ctx_init(cpu);
|
irq_ctx_init(cpu);
|
||||||
#else
|
#else
|
||||||
cpu_pda(cpu)->pcurrent = c_idle.idle;
|
cpu_pda(cpu)->pcurrent = c_idle.idle;
|
||||||
load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread);
|
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);
|
clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
|
||||||
#endif
|
#endif
|
||||||
early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
|
early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
|
||||||
|
initial_code = (unsigned long)start_secondary;
|
||||||
stack_start.sp = (void *) c_idle.idle->thread.sp;
|
stack_start.sp = (void *) c_idle.idle->thread.sp;
|
||||||
|
|
||||||
/* start_ip had better be page-aligned! */
|
/* start_ip had better be page-aligned! */
|
||||||
|
|
Loading…
Reference in New Issue