]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/setup_64.c
x86: clean up init_amd()
[linux-2.6] / arch / x86 / kernel / setup_64.c
index 16ef53ab538ab67141830e401213ebb8b2205cbf..c94464ab04bafed8a966e3d1e9b9dd965dcee72f 100644 (file)
@@ -72,7 +72,6 @@
 #include <asm/topology.h>
 #include <asm/trampoline.h>
 #include <asm/pat.h>
-#include <asm/mmconfig.h>
 
 #include <mach_apic.h>
 #ifdef CONFIG_PARAVIRT
@@ -81,8 +80,6 @@
 #define ARCH_SETUP
 #endif
 
-#include "cpu/cpu.h"
-
 /*
  * Machine setup..
  */
@@ -228,45 +225,22 @@ static inline void copy_edd(void)
 }
 #endif
 
-#ifdef CONFIG_KEXEC
-static void __init reserve_crashkernel(void)
+/* Overridden in paravirt.c if CONFIG_PARAVIRT */
+void __attribute__((weak)) __init memory_setup(void)
 {
-       unsigned long long total_mem;
-       unsigned long long crash_size, crash_base;
-       int ret;
-
-       total_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT;
-
-       ret = parse_crashkernel(boot_command_line, total_mem,
-                       &crash_size, &crash_base);
-       if (ret == 0 && crash_size) {
-               if (crash_base <= 0) {
-                       printk(KERN_INFO "crashkernel reservation failed - "
-                                       "you have to specify a base address\n");
-                       return;
-               }
+       machine_specific_memory_setup();
+}
 
-               if (reserve_bootmem_generic(crash_base, crash_size,
-                                       BOOTMEM_EXCLUSIVE) < 0) {
-                       printk(KERN_INFO "crashkernel reservation failed - "
-                                       "memory is in use\n");
-                       return;
-               }
+/* Current gdt points %fs at the "master" per-cpu area: after this,
+ * it's on the real one. */
+void switch_to_new_gdt(void)
+{
+       struct desc_ptr gdt_descr;
 
-               printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
-                               "for crashkernel (System RAM: %ldMB)\n",
-                               (unsigned long)(crash_size >> 20),
-                               (unsigned long)(crash_base >> 20),
-                               (unsigned long)(total_mem >> 20));
-               crashk_res.start = crash_base;
-               crashk_res.end   = crash_base + crash_size - 1;
-               insert_resource(&iomem_resource, &crashk_res);
-       }
+       gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id());
+       gdt_descr.size = GDT_SIZE - 1;
+       load_gdt(&gdt_descr);
 }
-#else
-static inline void __init reserve_crashkernel(void)
-{}
-#endif
 
 /*
  * setup_arch - architecture-specific boot-time initializations
@@ -327,6 +301,11 @@ void __init setup_arch(char **cmdline_p)
 
        parse_early_param();
 
+       if (acpi_mps_check()) {
+               disable_apic = 1;
+               clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
+       }
+
 #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
        if (init_ohci1394_dma_early)
                init_ohci1394_dma_on_all_controllers();
@@ -494,9 +473,6 @@ void __init setup_arch(char **cmdline_p)
        conswitchp = &dummy_con;
 #endif
 #endif
-
-       /* do this before identify_cpu for boot cpu */
-       check_enable_amd_mmconf_dmi();
 }
 
 struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {};
@@ -748,6 +724,10 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
                cpu_devs[c->x86_vendor]->c_early_init(c);
 
        validate_pat_support(c);
+
+       /* early_param could clear that, but recall get it set again */
+       if (disable_apic)
+               clear_cpu_cap(c, X86_FEATURE_APIC);
 }
 
 /*