Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30736
b: refs/heads/master
c: bd9e0b7
h: refs/heads/master
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Jun 28, 2006
1 parent 3b728a5 commit 241579d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 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: 28eba5bf9d4bf3ba4d58d985abf3a2903b7f2125
refs/heads/master: bd9e0b74f52dbac6241643fadca2393808b14c7a
8 changes: 7 additions & 1 deletion trunk/arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@ void __cpuinit cpu_init(void)
set_in_cr4(X86_CR4_TSD);
}

/* The CPU hotplug case */
if (cpu_gdt_descr->address) {
gdt = (struct desc_struct *)cpu_gdt_descr->address;
memset(gdt, 0, PAGE_SIZE);
goto old_gdt;
}
/*
* This is a horrible hack to allocate the GDT. The problem
* is that cpu_init() is called really early for the boot CPU
Expand All @@ -631,7 +637,7 @@ void __cpuinit cpu_init(void)
local_irq_enable();
}
}

old_gdt:
/*
* Initialize the per-CPU GDT with the boot GDT,
* and set up the GDT descriptor:
Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,13 +1056,26 @@ static int __cpuinit __smp_prepare_cpu(int cpu)
struct warm_boot_cpu_info info;
struct work_struct task;
int apicid, ret;
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);

apicid = x86_cpu_to_apicid[cpu];
if (apicid == BAD_APICID) {
ret = -ENODEV;
goto exit;
}

/*
* the CPU isn't initialized at boot time, allocate gdt table here.
* cpu_init will initialize it
*/
if (!cpu_gdt_descr->address) {
cpu_gdt_descr->address = get_zeroed_page(GFP_KERNEL);
if (!cpu_gdt_descr->address)
printk(KERN_CRIT "CPU%d failed to allocate GDT\n", cpu);
ret = -ENOMEM;
goto exit;
}

info.complete = &done;
info.apicid = apicid;
info.cpu = cpu;
Expand Down

0 comments on commit 241579d

Please sign in to comment.