Merge branch 'for-2.6.30' into for-2.6.31
[sfrench/cifs-2.6.git] / init / main.c
index 83697e160b3a786d3d91c14000f116a441f61bfc..3585f073d636453a0c98d5efdf44f0a26568dd02 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/stackprotector.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/delay.h>
@@ -70,6 +71,7 @@
 #include <asm/setup.h>
 #include <asm/sections.h>
 #include <asm/cacheflush.h>
+#include <trace/kmemtrace.h>
 
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/smp.h>
@@ -135,14 +137,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS;
  * greater than 0, limits the maximum number of CPUs activated in
  * SMP mode to <NUM>.
  */
-#ifndef CONFIG_X86_IO_APIC
-static inline void disable_ioapic_setup(void) {};
-#endif
+
+void __weak arch_disable_smp_support(void) { }
 
 static int __init nosmp(char *str)
 {
        setup_max_cpus = 0;
-       disable_ioapic_setup();
+       arch_disable_smp_support();
+
        return 0;
 }
 
@@ -152,14 +154,14 @@ static int __init maxcpus(char *str)
 {
        get_option(&str, &setup_max_cpus);
        if (setup_max_cpus == 0)
-               disable_ioapic_setup();
+               arch_disable_smp_support();
 
        return 0;
 }
 
 early_param("maxcpus", maxcpus);
 #else
-#define setup_max_cpus NR_CPUS
+const unsigned int setup_max_cpus = NR_CPUS;
 #endif
 
 /*
@@ -406,8 +408,7 @@ static void __init smp_init(void)
         * Set up the current CPU as possible to migrate to.
         * The other ones will be done by cpu_up/cpu_down()
         */
-       cpu = smp_processor_id();
-       cpu_set(cpu, cpu_active_map);
+       set_cpu_active(smp_processor_id(), true);
 
        /* FIXME: This should be done in userspace --RR */
        for_each_present_cpu(cpu) {
@@ -540,6 +541,12 @@ asmlinkage void __init start_kernel(void)
         */
        lockdep_init();
        debug_objects_early_init();
+
+       /*
+        * Set up the the initial canary ASAP:
+        */
+       boot_init_stack_canary();
+
        cgroup_init_early();
 
        local_irq_disable();
@@ -642,6 +649,7 @@ asmlinkage void __init start_kernel(void)
        enable_debug_pagealloc();
        cpu_hotplug_init();
        kmem_cache_init();
+       kmemtrace_init();
        debug_objects_mem_init();
        idr_init_cache();
        setup_per_cpu_pageset();
@@ -763,6 +771,7 @@ static void __init do_basic_setup(void)
 {
        rcu_init_sched(); /* needed by module_init stage. */
        init_workqueues();
+       cpuset_init_smp();
        usermodehelper_init();
        driver_init();
        init_irq_proc();
@@ -787,6 +796,7 @@ static void run_init_process(char *init_filename)
  * makes it inline to init() and it becomes part of init.text section
  */
 static noinline int init_post(void)
+       __releases(kernel_lock)
 {
        /* need to finish all async __init code before freeing the memory */
        async_synchronize_full();
@@ -835,7 +845,7 @@ static int __init kernel_init(void * unused)
        /*
         * init can run on any cpu.
         */
-       set_cpus_allowed_ptr(current, CPU_MASK_ALL_PTR);
+       set_cpus_allowed_ptr(current, cpu_all_mask);
        /*
         * Tell the world that we're going to be the grim
         * reaper of innocent orphaned children.
@@ -856,8 +866,6 @@ static int __init kernel_init(void * unused)
        smp_init();
        sched_init_smp();
 
-       cpuset_init_smp();
-
        do_basic_setup();
 
        /*