aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/efi.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2006-02-24 16:04:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-24 17:31:38 -0500
commit2b932f6cf052920fb3a6281499e08209b08f5086 (patch)
treec2710e09dd40ee9733bcd77234d6373acec741d2 /arch/i386/kernel/efi.c
parent1e275d406bf6b88e4de6925cf594b64bb2ec49bc (diff)
[PATCH] x86: fix broken SMP boot sequence
Recent GDT changes broke the SMP boot sequence if the booting CPU is numbered anything other than zero. There's also a subtle source of error in that the boot time CPU now uses cpu_gdt_table (which is actually the GDT for booting CPUs in head.S). This patch fixes both problems by making GDT descriptors themselves allocated from a per_cpu area and switching to them in cpu_init(), which now means that cpu_gdt_table is exclusively used for booting CPUs again. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Cc: Zachary Amsden <zach@vmware.com> Cc: Matt Tolentino <metolent@snoqualmie.dp.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/efi.c')
-rw-r--r--arch/i386/kernel/efi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index ecad519fd395..e3e42fd62401 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -103,17 +103,19 @@ static void efi_call_phys_prelog(void)
103 */ 103 */
104 local_flush_tlb(); 104 local_flush_tlb();
105 105
106 cpu_gdt_descr[0].address = __pa(cpu_gdt_descr[0].address); 106 per_cpu(cpu_gdt_descr, 0).address =
107 load_gdt((struct Xgt_desc_struct *) __pa(&cpu_gdt_descr[0])); 107 __pa(per_cpu(cpu_gdt_descr, 0).address);
108 load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0)));
108} 109}
109 110
110static void efi_call_phys_epilog(void) 111static void efi_call_phys_epilog(void)
111{ 112{
112 unsigned long cr4; 113 unsigned long cr4;
113 114
114 cpu_gdt_descr[0].address = 115 per_cpu(cpu_gdt_descr, 0).address =
115 (unsigned long) __va(cpu_gdt_descr[0].address); 116 (unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address);
116 load_gdt(&cpu_gdt_descr[0]); 117 load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0)));
118
117 cr4 = read_cr4(); 119 cr4 = read_cr4();
118 120
119 if (cr4 & X86_CR4_PSE) { 121 if (cr4 & X86_CR4_PSE) {