diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/init/main.c b/init/main.c index 0eb1c7463fe4..d3bcb3b11620 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -132,20 +132,9 @@ static char *static_command_line; | |||
132 | static char *execute_command; | 132 | static char *execute_command; |
133 | static char *ramdisk_execute_command; | 133 | static char *ramdisk_execute_command; |
134 | 134 | ||
135 | #ifdef CONFIG_SMP | ||
135 | /* Setup configured maximum number of CPUs to activate */ | 136 | /* Setup configured maximum number of CPUs to activate */ |
136 | static unsigned int max_cpus = NR_CPUS; | 137 | static unsigned int __initdata max_cpus = NR_CPUS; |
137 | |||
138 | /* | ||
139 | * If set, this is an indication to the drivers that reset the underlying | ||
140 | * device before going ahead with the initialization otherwise driver might | ||
141 | * rely on the BIOS and skip the reset operation. | ||
142 | * | ||
143 | * This is useful if kernel is booting in an unreliable environment. | ||
144 | * For ex. kdump situaiton where previous kernel has crashed, BIOS has been | ||
145 | * skipped and devices will be in unknown state. | ||
146 | */ | ||
147 | unsigned int reset_devices; | ||
148 | EXPORT_SYMBOL(reset_devices); | ||
149 | 138 | ||
150 | /* | 139 | /* |
151 | * Setup routine for controlling SMP activation | 140 | * Setup routine for controlling SMP activation |
@@ -160,10 +149,10 @@ EXPORT_SYMBOL(reset_devices); | |||
160 | static int __init nosmp(char *str) | 149 | static int __init nosmp(char *str) |
161 | { | 150 | { |
162 | max_cpus = 0; | 151 | max_cpus = 0; |
163 | return 1; | 152 | return 0; |
164 | } | 153 | } |
165 | 154 | ||
166 | __setup("nosmp", nosmp); | 155 | early_param("nosmp", nosmp); |
167 | 156 | ||
168 | static int __init maxcpus(char *str) | 157 | static int __init maxcpus(char *str) |
169 | { | 158 | { |
@@ -172,6 +161,21 @@ static int __init maxcpus(char *str) | |||
172 | } | 161 | } |
173 | 162 | ||
174 | __setup("maxcpus=", maxcpus); | 163 | __setup("maxcpus=", maxcpus); |
164 | #else | ||
165 | #define max_cpus NR_CPUS | ||
166 | #endif | ||
167 | |||
168 | /* | ||
169 | * If set, this is an indication to the drivers that reset the underlying | ||
170 | * device before going ahead with the initialization otherwise driver might | ||
171 | * rely on the BIOS and skip the reset operation. | ||
172 | * | ||
173 | * This is useful if kernel is booting in an unreliable environment. | ||
174 | * For ex. kdump situaiton where previous kernel has crashed, BIOS has been | ||
175 | * skipped and devices will be in unknown state. | ||
176 | */ | ||
177 | unsigned int reset_devices; | ||
178 | EXPORT_SYMBOL(reset_devices); | ||
175 | 179 | ||
176 | static int __init set_reset_devices(char *str) | 180 | static int __init set_reset_devices(char *str) |
177 | { | 181 | { |
@@ -385,6 +389,10 @@ static void __init smp_init(void) | |||
385 | { | 389 | { |
386 | unsigned int cpu; | 390 | unsigned int cpu; |
387 | 391 | ||
392 | #ifndef CONFIG_HOTPLUG_CPU | ||
393 | cpu_possible_map = cpu_present_map; | ||
394 | #endif | ||
395 | |||
388 | /* FIXME: This should be done in userspace --RR */ | 396 | /* FIXME: This should be done in userspace --RR */ |
389 | for_each_present_cpu(cpu) { | 397 | for_each_present_cpu(cpu) { |
390 | if (num_online_cpus() >= max_cpus) | 398 | if (num_online_cpus() >= max_cpus) |
@@ -453,7 +461,10 @@ static int __init do_early_param(char *param, char *val) | |||
453 | struct obs_kernel_param *p; | 461 | struct obs_kernel_param *p; |
454 | 462 | ||
455 | for (p = __setup_start; p < __setup_end; p++) { | 463 | for (p = __setup_start; p < __setup_end; p++) { |
456 | if (p->early && strcmp(param, p->str) == 0) { | 464 | if ((p->early && strcmp(param, p->str) == 0) || |
465 | (strcmp(param, "console") == 0 && | ||
466 | strcmp(p->str, "earlycon") == 0) | ||
467 | ) { | ||
457 | if (p->setup_func(val) != 0) | 468 | if (p->setup_func(val) != 0) |
458 | printk(KERN_WARNING | 469 | printk(KERN_WARNING |
459 | "Malformed early option '%s'\n", param); | 470 | "Malformed early option '%s'\n", param); |
@@ -526,6 +537,10 @@ asmlinkage void __init start_kernel(void) | |||
526 | setup_arch(&command_line); | 537 | setup_arch(&command_line); |
527 | setup_command_line(command_line); | 538 | setup_command_line(command_line); |
528 | unwind_setup(); | 539 | unwind_setup(); |
540 | #ifndef CONFIG_HOTPLUG_CPU | ||
541 | if (max_cpus < 2) | ||
542 | cpu_possible_map = cpu_online_map; | ||
543 | #endif | ||
529 | setup_per_cpu_areas(); | 544 | setup_per_cpu_areas(); |
530 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | 545 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ |
531 | 546 | ||
@@ -725,6 +740,15 @@ static void __init do_basic_setup(void) | |||
725 | do_initcalls(); | 740 | do_initcalls(); |
726 | } | 741 | } |
727 | 742 | ||
743 | static int __initdata nosoftlockup; | ||
744 | |||
745 | static int __init nosoftlockup_setup(char *str) | ||
746 | { | ||
747 | nosoftlockup = 1; | ||
748 | return 1; | ||
749 | } | ||
750 | __setup("nosoftlockup", nosoftlockup_setup); | ||
751 | |||
728 | static void __init do_pre_smp_initcalls(void) | 752 | static void __init do_pre_smp_initcalls(void) |
729 | { | 753 | { |
730 | extern int spawn_ksoftirqd(void); | 754 | extern int spawn_ksoftirqd(void); |
@@ -734,7 +758,8 @@ static void __init do_pre_smp_initcalls(void) | |||
734 | migration_init(); | 758 | migration_init(); |
735 | #endif | 759 | #endif |
736 | spawn_ksoftirqd(); | 760 | spawn_ksoftirqd(); |
737 | spawn_softlockup_task(); | 761 | if (!nosoftlockup) |
762 | spawn_softlockup_task(); | ||
738 | } | 763 | } |
739 | 764 | ||
740 | static void run_init_process(char *init_filename) | 765 | static void run_init_process(char *init_filename) |