aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/init/main.c b/init/main.c
index 83697e160b3a..07c8658ffca5 100644
--- a/init/main.c
+++ b/init/main.c
@@ -14,6 +14,7 @@
14#include <linux/proc_fs.h> 14#include <linux/proc_fs.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/syscalls.h> 16#include <linux/syscalls.h>
17#include <linux/stackprotector.h>
17#include <linux/string.h> 18#include <linux/string.h>
18#include <linux/ctype.h> 19#include <linux/ctype.h>
19#include <linux/delay.h> 20#include <linux/delay.h>
@@ -135,14 +136,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS;
135 * greater than 0, limits the maximum number of CPUs activated in 136 * greater than 0, limits the maximum number of CPUs activated in
136 * SMP mode to <NUM>. 137 * SMP mode to <NUM>.
137 */ 138 */
138#ifndef CONFIG_X86_IO_APIC 139
139static inline void disable_ioapic_setup(void) {}; 140void __weak arch_disable_smp_support(void) { }
140#endif
141 141
142static int __init nosmp(char *str) 142static int __init nosmp(char *str)
143{ 143{
144 setup_max_cpus = 0; 144 setup_max_cpus = 0;
145 disable_ioapic_setup(); 145 arch_disable_smp_support();
146
146 return 0; 147 return 0;
147} 148}
148 149
@@ -152,14 +153,14 @@ static int __init maxcpus(char *str)
152{ 153{
153 get_option(&str, &setup_max_cpus); 154 get_option(&str, &setup_max_cpus);
154 if (setup_max_cpus == 0) 155 if (setup_max_cpus == 0)
155 disable_ioapic_setup(); 156 arch_disable_smp_support();
156 157
157 return 0; 158 return 0;
158} 159}
159 160
160early_param("maxcpus", maxcpus); 161early_param("maxcpus", maxcpus);
161#else 162#else
162#define setup_max_cpus NR_CPUS 163const unsigned int setup_max_cpus = NR_CPUS;
163#endif 164#endif
164 165
165/* 166/*
@@ -406,8 +407,7 @@ static void __init smp_init(void)
406 * Set up the current CPU as possible to migrate to. 407 * Set up the current CPU as possible to migrate to.
407 * The other ones will be done by cpu_up/cpu_down() 408 * The other ones will be done by cpu_up/cpu_down()
408 */ 409 */
409 cpu = smp_processor_id(); 410 set_cpu_active(smp_processor_id(), true);
410 cpu_set(cpu, cpu_active_map);
411 411
412 /* FIXME: This should be done in userspace --RR */ 412 /* FIXME: This should be done in userspace --RR */
413 for_each_present_cpu(cpu) { 413 for_each_present_cpu(cpu) {
@@ -540,6 +540,12 @@ asmlinkage void __init start_kernel(void)
540 */ 540 */
541 lockdep_init(); 541 lockdep_init();
542 debug_objects_early_init(); 542 debug_objects_early_init();
543
544 /*
545 * Set up the the initial canary ASAP:
546 */
547 boot_init_stack_canary();
548
543 cgroup_init_early(); 549 cgroup_init_early();
544 550
545 local_irq_disable(); 551 local_irq_disable();
@@ -787,6 +793,7 @@ static void run_init_process(char *init_filename)
787 * makes it inline to init() and it becomes part of init.text section 793 * makes it inline to init() and it becomes part of init.text section
788 */ 794 */
789static noinline int init_post(void) 795static noinline int init_post(void)
796 __releases(kernel_lock)
790{ 797{
791 /* need to finish all async __init code before freeing the memory */ 798 /* need to finish all async __init code before freeing the memory */
792 async_synchronize_full(); 799 async_synchronize_full();
@@ -835,7 +842,7 @@ static int __init kernel_init(void * unused)
835 /* 842 /*
836 * init can run on any cpu. 843 * init can run on any cpu.
837 */ 844 */
838 set_cpus_allowed_ptr(current, CPU_MASK_ALL_PTR); 845 set_cpus_allowed_ptr(current, cpu_all_mask);
839 /* 846 /*
840 * Tell the world that we're going to be the grim 847 * Tell the world that we're going to be the grim
841 * reaper of innocent orphaned children. 848 * reaper of innocent orphaned children.