Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45708
b: refs/heads/master
c: 9ee79a3
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and Linus Torvalds committed Jan 23, 2007
1 parent 9f536fa commit c676cd7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebcccd14b73831fa7fbc197e1d2b9c710a65731e
refs/heads/master: 9ee79a3d372fcb6729893437f4923c5efd1f85db
13 changes: 9 additions & 4 deletions trunk/arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,18 +710,22 @@ __cpuinit int init_gdt(int cpu, struct task_struct *idle)
return 1;
}

/* Common CPU init for both boot and secondary CPUs */
static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
void __cpuinit cpu_set_gdt(int cpu)
{
struct tss_struct * t = &per_cpu(init_tss, cpu);
struct thread_struct *thread = &curr->thread;
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);

/* Reinit these anyway, even if they've already been done (on
the boot CPU, this will transition from the boot gdt+pda to
the real ones). */
load_gdt(cpu_gdt_descr);
set_kernel_gs();
}

/* Common CPU init for both boot and secondary CPUs */
static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
{
struct tss_struct * t = &per_cpu(init_tss, cpu);
struct thread_struct *thread = &curr->thread;

if (cpu_test_and_set(cpu, cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
Expand Down Expand Up @@ -807,6 +811,7 @@ void __cpuinit cpu_init(void)
local_irq_enable();
}

cpu_set_gdt(cpu);
_cpu_init(cpu, curr);
}

Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,12 @@ static void __cpuinit start_secondary(void *unused)
*/
void __devinit initialize_secondary(void)
{
/*
* switch to the per CPU GDT we already set up
* in do_boot_cpu()
*/
cpu_set_gdt(current_thread_info()->cpu);

/*
* We don't actually need to load the full TSS,
* basically just the stack pointer and the eip.
Expand Down Expand Up @@ -972,9 +978,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
/* Stack for startup_32 can be just as for start_secondary onwards */
stack_start.esp = (void *) idle->thread.esp;

start_pda = cpu_pda(cpu);
cpu_gdt_descr = per_cpu(cpu_gdt_descr, cpu);

irq_ctx_init(cpu);

x86_cpu_to_apicid[cpu] = apicid;
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/i386/mach-voyager/voyager_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,12 @@ initialize_secondary(void)
set_current(hard_get_current());
#endif

/*
* switch to the per CPU GDT we already set up
* in do_boot_cpu()
*/
cpu_set_gdt(current_thread_info()->cpu);

/*
* We don't actually need to load the full TSS,
* basically just the stack pointer and the eip.
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-i386/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ extern void enable_sep_cpu(void);
extern int sysenter_setup(void);

extern int init_gdt(int cpu, struct task_struct *idle);
extern void cpu_set_gdt(int);
extern void secondary_cpu_init(void);

#endif /* __ASM_I386_PROCESSOR_H */

0 comments on commit c676cd7

Please sign in to comment.