vserver 1.9.3
[linux-2.6.git] / arch / i386 / kernel / head.S
index 3f868ea..95fe2fd 100644 (file)
@@ -153,6 +153,32 @@ ENTRY(startup_32_smp)
        orl %edx,%eax
        movl %eax,%cr4
 
+       btl $5, %eax            # check if PAE is enabled
+       jnc 6f
+
+       /* Check if extended functions are implemented */
+       movl $0x80000000, %eax
+       cpuid
+       cmpl $0x80000000, %eax
+       jbe 6f
+       mov $0x80000001, %eax
+       cpuid
+       /* Execute Disable bit supported? */
+       btl $20, %edx
+       jnc 6f
+
+       /* Setup EFER (Extended Feature Enable Register) */
+       movl $0xc0000080, %ecx
+       rdmsr
+
+       btsl $11, %eax
+       /* Make changes effective */
+       wrmsr
+
+6:
+       /* cpuid clobbered ebx, set it up again: */
+       xorl %ebx,%ebx
+       incl %ebx
 3:
 #endif /* CONFIG_SMP */
 
@@ -495,6 +521,3 @@ ENTRY(cpu_gdt_table)
        .quad 0x0000000000000000        /* 0xf0 - unused */
        .quad 0x0000000000000000        /* 0xf8 - GDT entry 31: double-fault TSS */
 
-#ifdef CONFIG_SMP
-       .fill (NR_CPUS-1)*GDT_ENTRIES,8,0 /* other CPU's GDT */
-#endif