diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/init/main.c b/init/main.c index 83697e160b3a..20d784ab5ef8 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> |
@@ -70,6 +71,7 @@ | |||
70 | #include <asm/setup.h> | 71 | #include <asm/setup.h> |
71 | #include <asm/sections.h> | 72 | #include <asm/sections.h> |
72 | #include <asm/cacheflush.h> | 73 | #include <asm/cacheflush.h> |
74 | #include <trace/kmemtrace.h> | ||
73 | 75 | ||
74 | #ifdef CONFIG_X86_LOCAL_APIC | 76 | #ifdef CONFIG_X86_LOCAL_APIC |
75 | #include <asm/smp.h> | 77 | #include <asm/smp.h> |
@@ -135,14 +137,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS; | |||
135 | * greater than 0, limits the maximum number of CPUs activated in | 137 | * greater than 0, limits the maximum number of CPUs activated in |
136 | * SMP mode to <NUM>. | 138 | * SMP mode to <NUM>. |
137 | */ | 139 | */ |
138 | #ifndef CONFIG_X86_IO_APIC | 140 | |
139 | static inline void disable_ioapic_setup(void) {}; | 141 | void __weak arch_disable_smp_support(void) { } |
140 | #endif | ||
141 | 142 | ||
142 | static int __init nosmp(char *str) | 143 | static int __init nosmp(char *str) |
143 | { | 144 | { |
144 | setup_max_cpus = 0; | 145 | setup_max_cpus = 0; |
145 | disable_ioapic_setup(); | 146 | arch_disable_smp_support(); |
147 | |||
146 | return 0; | 148 | return 0; |
147 | } | 149 | } |
148 | 150 | ||
@@ -152,14 +154,14 @@ static int __init maxcpus(char *str) | |||
152 | { | 154 | { |
153 | get_option(&str, &setup_max_cpus); | 155 | get_option(&str, &setup_max_cpus); |
154 | if (setup_max_cpus == 0) | 156 | if (setup_max_cpus == 0) |
155 | disable_ioapic_setup(); | 157 | arch_disable_smp_support(); |
156 | 158 | ||
157 | return 0; | 159 | return 0; |
158 | } | 160 | } |
159 | 161 | ||
160 | early_param("maxcpus", maxcpus); | 162 | early_param("maxcpus", maxcpus); |
161 | #else | 163 | #else |
162 | #define setup_max_cpus NR_CPUS | 164 | const unsigned int setup_max_cpus = NR_CPUS; |
163 | #endif | 165 | #endif |
164 | 166 | ||
165 | /* | 167 | /* |
@@ -540,6 +542,12 @@ asmlinkage void __init start_kernel(void) | |||
540 | */ | 542 | */ |
541 | lockdep_init(); | 543 | lockdep_init(); |
542 | debug_objects_early_init(); | 544 | debug_objects_early_init(); |
545 | |||
546 | /* | ||
547 | * Set up the the initial canary ASAP: | ||
548 | */ | ||
549 | boot_init_stack_canary(); | ||
550 | |||
543 | cgroup_init_early(); | 551 | cgroup_init_early(); |
544 | 552 | ||
545 | local_irq_disable(); | 553 | local_irq_disable(); |
@@ -642,6 +650,7 @@ asmlinkage void __init start_kernel(void) | |||
642 | enable_debug_pagealloc(); | 650 | enable_debug_pagealloc(); |
643 | cpu_hotplug_init(); | 651 | cpu_hotplug_init(); |
644 | kmem_cache_init(); | 652 | kmem_cache_init(); |
653 | kmemtrace_init(); | ||
645 | debug_objects_mem_init(); | 654 | debug_objects_mem_init(); |
646 | idr_init_cache(); | 655 | idr_init_cache(); |
647 | setup_per_cpu_pageset(); | 656 | setup_per_cpu_pageset(); |