]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - init/main.c
[PATCH] x86-64: Dynamically adjust machine check interval
[linux-2.6-omap-h63xx.git] / init / main.c
index 1c5f6dce1bd2d062ab780a99b8417d9ceb7813b0..80f09f31bfabf68c3d6b317c7f0470f14f8bfac7 100644 (file)
@@ -369,12 +369,8 @@ static void __init setup_per_cpu_areas(void)
        unsigned long nr_possible_cpus = num_possible_cpus();
 
        /* Copy section for each CPU (we discard the original) */
-       size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
-#ifdef CONFIG_MODULES
-       if (size < PERCPU_ENOUGH_ROOM)
-               size = PERCPU_ENOUGH_ROOM;
-#endif
-       ptr = alloc_bootmem(size * nr_possible_cpus);
+       size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
+       ptr = alloc_bootmem_pages(size * nr_possible_cpus);
 
        for_each_possible_cpu(i) {
                __per_cpu_offset[i] = ptr - __per_cpu_start;
@@ -387,14 +383,19 @@ static void __init setup_per_cpu_areas(void)
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
-       unsigned int i;
+       unsigned int cpu;
+       unsigned highest = 0;
+
+       for_each_cpu_mask(cpu, cpu_possible_map)
+               highest = cpu;
+       nr_cpu_ids = highest + 1;
 
        /* FIXME: This should be done in userspace --RR */
-       for_each_present_cpu(i) {
+       for_each_present_cpu(cpu) {
                if (num_online_cpus() >= max_cpus)
                        break;
-               if (!cpu_online(i))
-                       cpu_up(i);
+               if (!cpu_online(cpu))
+                       cpu_up(cpu);
        }
 
        /* Any cleanup work */