diff options
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/apic.c | 34 | ||||
-rw-r--r-- | arch/x86_64/kernel/e820.c | 53 | ||||
-rw-r--r-- | arch/x86_64/kernel/early_printk.c | 20 | ||||
-rw-r--r-- | arch/x86_64/kernel/head64.c | 15 | ||||
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 15 | ||||
-rw-r--r-- | arch/x86_64/kernel/machine_kexec.c | 28 | ||||
-rw-r--r-- | arch/x86_64/kernel/pci-dma.c | 7 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 197 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup64.c | 8 | ||||
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 6 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 24 | ||||
-rw-r--r-- | arch/x86_64/mm/numa.c | 9 |
12 files changed, 157 insertions, 259 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 496cd1bd2ae5..660602c51f51 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/idle.h> | 36 | #include <asm/idle.h> |
37 | #include <asm/proto.h> | 37 | #include <asm/proto.h> |
38 | #include <asm/timex.h> | 38 | #include <asm/timex.h> |
39 | #include <asm/apic.h> | ||
39 | 40 | ||
40 | int apic_verbosity; | 41 | int apic_verbosity; |
41 | int apic_runs_main_timer; | 42 | int apic_runs_main_timer; |
@@ -546,18 +547,24 @@ static void apic_pm_activate(void) { } | |||
546 | 547 | ||
547 | static int __init apic_set_verbosity(char *str) | 548 | static int __init apic_set_verbosity(char *str) |
548 | { | 549 | { |
550 | if (str == NULL) { | ||
551 | skip_ioapic_setup = 0; | ||
552 | ioapic_force = 1; | ||
553 | return 0; | ||
554 | } | ||
549 | if (strcmp("debug", str) == 0) | 555 | if (strcmp("debug", str) == 0) |
550 | apic_verbosity = APIC_DEBUG; | 556 | apic_verbosity = APIC_DEBUG; |
551 | else if (strcmp("verbose", str) == 0) | 557 | else if (strcmp("verbose", str) == 0) |
552 | apic_verbosity = APIC_VERBOSE; | 558 | apic_verbosity = APIC_VERBOSE; |
553 | else | 559 | else { |
554 | printk(KERN_WARNING "APIC Verbosity level %s not recognised" | 560 | printk(KERN_WARNING "APIC Verbosity level %s not recognised" |
555 | " use apic=verbose or apic=debug", str); | 561 | " use apic=verbose or apic=debug\n", str); |
562 | return -EINVAL; | ||
563 | } | ||
556 | 564 | ||
557 | return 1; | 565 | return 0; |
558 | } | 566 | } |
559 | 567 | early_param("apic", apic_set_verbosity); | |
560 | __setup("apic=", apic_set_verbosity); | ||
561 | 568 | ||
562 | /* | 569 | /* |
563 | * Detect and enable local APICs on non-SMP boards. | 570 | * Detect and enable local APICs on non-SMP boards. |
@@ -1078,14 +1085,17 @@ int __init APIC_init_uniprocessor (void) | |||
1078 | static __init int setup_disableapic(char *str) | 1085 | static __init int setup_disableapic(char *str) |
1079 | { | 1086 | { |
1080 | disable_apic = 1; | 1087 | disable_apic = 1; |
1081 | return 1; | 1088 | clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); |
1082 | } | 1089 | return 0; |
1090 | } | ||
1091 | early_param("disableapic", setup_disableapic); | ||
1083 | 1092 | ||
1093 | /* same as disableapic, for compatibility */ | ||
1084 | static __init int setup_nolapic(char *str) | 1094 | static __init int setup_nolapic(char *str) |
1085 | { | 1095 | { |
1086 | disable_apic = 1; | 1096 | return setup_disableapic(str); |
1087 | return 1; | ||
1088 | } | 1097 | } |
1098 | early_param("nolapic", setup_nolapic); | ||
1089 | 1099 | ||
1090 | static __init int setup_noapictimer(char *str) | 1100 | static __init int setup_noapictimer(char *str) |
1091 | { | 1101 | { |
@@ -1118,11 +1128,5 @@ static __init int setup_apicpmtimer(char *s) | |||
1118 | } | 1128 | } |
1119 | __setup("apicpmtimer", setup_apicpmtimer); | 1129 | __setup("apicpmtimer", setup_apicpmtimer); |
1120 | 1130 | ||
1121 | /* dummy parsing: see setup.c */ | ||
1122 | |||
1123 | __setup("disableapic", setup_disableapic); | ||
1124 | __setup("nolapic", setup_nolapic); /* same as disableapic, for compatibility */ | ||
1125 | |||
1126 | __setup("noapictimer", setup_noapictimer); | 1131 | __setup("noapictimer", setup_noapictimer); |
1127 | 1132 | ||
1128 | /* no "lapic" flag - we only use the lapic when the BIOS tells us so. */ | ||
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 1362aad4f3aa..a4739dc82937 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -596,31 +596,64 @@ void __init setup_memory_region(void) | |||
596 | e820_print_map(who); | 596 | e820_print_map(who); |
597 | } | 597 | } |
598 | 598 | ||
599 | void __init parse_memopt(char *p, char **from) | 599 | static int __init parse_memopt(char *p) |
600 | { | 600 | { |
601 | end_user_pfn = memparse(p, from); | 601 | if (!p) |
602 | return -EINVAL; | ||
603 | end_user_pfn = memparse(p, &p); | ||
602 | end_user_pfn >>= PAGE_SHIFT; | 604 | end_user_pfn >>= PAGE_SHIFT; |
605 | return 0; | ||
603 | } | 606 | } |
607 | early_param("mem", parse_memopt); | ||
608 | |||
609 | static int userdef __initdata; | ||
604 | 610 | ||
605 | void __init parse_memmapopt(char *p, char **from) | 611 | static int __init parse_memmap_opt(char *p) |
606 | { | 612 | { |
613 | char *oldp; | ||
607 | unsigned long long start_at, mem_size; | 614 | unsigned long long start_at, mem_size; |
608 | 615 | ||
609 | mem_size = memparse(p, from); | 616 | if (!strcmp(p, "exactmap")) { |
610 | p = *from; | 617 | #ifdef CONFIG_CRASH_DUMP |
618 | /* If we are doing a crash dump, we | ||
619 | * still need to know the real mem | ||
620 | * size before original memory map is | ||
621 | * reset. | ||
622 | */ | ||
623 | saved_max_pfn = e820_end_of_ram(); | ||
624 | #endif | ||
625 | end_pfn_map = 0; | ||
626 | e820.nr_map = 0; | ||
627 | userdef = 1; | ||
628 | return 0; | ||
629 | } | ||
630 | |||
631 | oldp = p; | ||
632 | mem_size = memparse(p, &p); | ||
633 | if (p == oldp) | ||
634 | return -EINVAL; | ||
611 | if (*p == '@') { | 635 | if (*p == '@') { |
612 | start_at = memparse(p+1, from); | 636 | start_at = memparse(p+1, &p); |
613 | add_memory_region(start_at, mem_size, E820_RAM); | 637 | add_memory_region(start_at, mem_size, E820_RAM); |
614 | } else if (*p == '#') { | 638 | } else if (*p == '#') { |
615 | start_at = memparse(p+1, from); | 639 | start_at = memparse(p+1, &p); |
616 | add_memory_region(start_at, mem_size, E820_ACPI); | 640 | add_memory_region(start_at, mem_size, E820_ACPI); |
617 | } else if (*p == '$') { | 641 | } else if (*p == '$') { |
618 | start_at = memparse(p+1, from); | 642 | start_at = memparse(p+1, &p); |
619 | add_memory_region(start_at, mem_size, E820_RESERVED); | 643 | add_memory_region(start_at, mem_size, E820_RESERVED); |
620 | } else { | 644 | } else { |
621 | end_user_pfn = (mem_size >> PAGE_SHIFT); | 645 | end_user_pfn = (mem_size >> PAGE_SHIFT); |
622 | } | 646 | } |
623 | p = *from; | 647 | return *p == '\0' ? 0 : -EINVAL; |
648 | } | ||
649 | early_param("memmap", parse_memmap_opt); | ||
650 | |||
651 | void finish_e820_parsing(void) | ||
652 | { | ||
653 | if (userdef) { | ||
654 | printk(KERN_INFO "user-defined physical RAM map:\n"); | ||
655 | e820_print_map("user"); | ||
656 | } | ||
624 | } | 657 | } |
625 | 658 | ||
626 | unsigned long pci_mem_start = 0xaeedbabe; | 659 | unsigned long pci_mem_start = 0xaeedbabe; |
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c index 140051e07fa6..e22ecd54870d 100644 --- a/arch/x86_64/kernel/early_printk.c +++ b/arch/x86_64/kernel/early_printk.c | |||
@@ -215,20 +215,16 @@ void early_printk(const char *fmt, ...) | |||
215 | 215 | ||
216 | static int __initdata keep_early; | 216 | static int __initdata keep_early; |
217 | 217 | ||
218 | int __init setup_early_printk(char *opt) | 218 | static int __init setup_early_printk(char *buf) |
219 | { | 219 | { |
220 | char *space; | 220 | if (!buf) |
221 | char buf[256]; | 221 | return 0; |
222 | 222 | ||
223 | if (early_console_initialized) | 223 | if (early_console_initialized) |
224 | return 1; | 224 | return 0; |
225 | 225 | early_console_initialized = 1; | |
226 | strlcpy(buf,opt,sizeof(buf)); | ||
227 | space = strchr(buf, ' '); | ||
228 | if (space) | ||
229 | *space = 0; | ||
230 | 226 | ||
231 | if (strstr(buf,"keep")) | 227 | if (!strcmp(buf,"keep")) |
232 | keep_early = 1; | 228 | keep_early = 1; |
233 | 229 | ||
234 | if (!strncmp(buf, "serial", 6)) { | 230 | if (!strncmp(buf, "serial", 6)) { |
@@ -248,11 +244,12 @@ int __init setup_early_printk(char *opt) | |||
248 | early_console = &simnow_console; | 244 | early_console = &simnow_console; |
249 | keep_early = 1; | 245 | keep_early = 1; |
250 | } | 246 | } |
251 | early_console_initialized = 1; | ||
252 | register_console(early_console); | 247 | register_console(early_console); |
253 | return 0; | 248 | return 0; |
254 | } | 249 | } |
255 | 250 | ||
251 | early_param("earlyprintk", setup_early_printk); | ||
252 | |||
256 | void __init disable_early_printk(void) | 253 | void __init disable_early_printk(void) |
257 | { | 254 | { |
258 | if (!early_console_initialized || !early_console) | 255 | if (!early_console_initialized || !early_console) |
@@ -266,4 +263,3 @@ void __init disable_early_printk(void) | |||
266 | } | 263 | } |
267 | } | 264 | } |
268 | 265 | ||
269 | __setup("earlyprintk=", setup_early_printk); | ||
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c index f2461fde9f8f..6716cbfc34ac 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86_64/kernel/head64.c | |||
@@ -58,7 +58,6 @@ static void __init copy_bootdata(char *real_mode_data) | |||
58 | 58 | ||
59 | void __init x86_64_start_kernel(char * real_mode_data) | 59 | void __init x86_64_start_kernel(char * real_mode_data) |
60 | { | 60 | { |
61 | char *s; | ||
62 | int i; | 61 | int i; |
63 | 62 | ||
64 | for (i = 0; i < 256; i++) | 63 | for (i = 0; i < 256; i++) |
@@ -85,19 +84,5 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
85 | #ifdef CONFIG_SMP | 84 | #ifdef CONFIG_SMP |
86 | cpu_set(0, cpu_online_map); | 85 | cpu_set(0, cpu_online_map); |
87 | #endif | 86 | #endif |
88 | s = strstr(saved_command_line, "earlyprintk="); | ||
89 | if (s != NULL) | ||
90 | setup_early_printk(strchr(s, '=') + 1); | ||
91 | #ifdef CONFIG_NUMA | ||
92 | s = strstr(saved_command_line, "numa="); | ||
93 | if (s != NULL) | ||
94 | numa_setup(s+5); | ||
95 | #endif | ||
96 | if (strstr(saved_command_line, "disableapic")) | ||
97 | disable_apic = 1; | ||
98 | /* You need early console to see that */ | ||
99 | if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE) | ||
100 | panic("Kernel too big for kernel mapping\n"); | ||
101 | |||
102 | start_kernel(); | 87 | start_kernel(); |
103 | } | 88 | } |
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index a1412042b918..afac3dbb3729 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -48,7 +48,7 @@ int sis_apic_bug; /* not actually supported, dummy for compile */ | |||
48 | 48 | ||
49 | static int no_timer_check; | 49 | static int no_timer_check; |
50 | 50 | ||
51 | int disable_timer_pin_1 __initdata; | 51 | static int disable_timer_pin_1 __initdata; |
52 | 52 | ||
53 | int timer_over_8254 __initdata = 0; | 53 | int timer_over_8254 __initdata = 0; |
54 | 54 | ||
@@ -253,18 +253,17 @@ int ioapic_force; | |||
253 | static int __init disable_ioapic_setup(char *str) | 253 | static int __init disable_ioapic_setup(char *str) |
254 | { | 254 | { |
255 | skip_ioapic_setup = 1; | 255 | skip_ioapic_setup = 1; |
256 | return 1; | 256 | return 0; |
257 | } | 257 | } |
258 | early_param("noapic", disable_ioapic_setup); | ||
258 | 259 | ||
259 | static int __init enable_ioapic_setup(char *str) | 260 | /* Actually the next is obsolete, but keep it for paranoid reasons -AK */ |
261 | static int __init disable_timer_pin_setup(char *arg) | ||
260 | { | 262 | { |
261 | ioapic_force = 1; | 263 | disable_timer_pin_1 = 1; |
262 | skip_ioapic_setup = 0; | ||
263 | return 1; | 264 | return 1; |
264 | } | 265 | } |
265 | 266 | __setup("disable_timer_pin_1", disable_timer_pin_setup); | |
266 | __setup("noapic", disable_ioapic_setup); | ||
267 | __setup("apic", enable_ioapic_setup); | ||
268 | 267 | ||
269 | static int __init setup_disable_8254_timer(char *s) | 268 | static int __init setup_disable_8254_timer(char *s) |
270 | { | 269 | { |
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c index 106076b370fc..2e94c072d84a 100644 --- a/arch/x86_64/kernel/machine_kexec.c +++ b/arch/x86_64/kernel/machine_kexec.c | |||
@@ -226,3 +226,31 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
226 | rnk = (relocate_new_kernel_t) control_code_buffer; | 226 | rnk = (relocate_new_kernel_t) control_code_buffer; |
227 | (*rnk)(page_list, control_code_buffer, image->start, start_pgtable); | 227 | (*rnk)(page_list, control_code_buffer, image->start, start_pgtable); |
228 | } | 228 | } |
229 | |||
230 | /* crashkernel=size@addr specifies the location to reserve for | ||
231 | * a crash kernel. By reserving this memory we guarantee | ||
232 | * that linux never set's it up as a DMA target. | ||
233 | * Useful for holding code to do something appropriate | ||
234 | * after a kernel panic. | ||
235 | */ | ||
236 | static int __init setup_crashkernel(char *arg) | ||
237 | { | ||
238 | unsigned long size, base; | ||
239 | char *p; | ||
240 | if (!arg) | ||
241 | return -EINVAL; | ||
242 | size = memparse(arg, &p); | ||
243 | if (arg == p) | ||
244 | return -EINVAL; | ||
245 | if (*p == '@') { | ||
246 | base = memparse(p+1, &p); | ||
247 | /* FIXME: Do I want a sanity check to validate the | ||
248 | * memory range? Yes you do, but it's too early for | ||
249 | * e820 -AK */ | ||
250 | crashk_res.start = base; | ||
251 | crashk_res.end = base + size - 1; | ||
252 | } | ||
253 | return 0; | ||
254 | } | ||
255 | early_param("crashkernel", setup_crashkernel); | ||
256 | |||
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index 9c44f4f2433d..4dcb671bd19f 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c | |||
@@ -236,6 +236,9 @@ __init int iommu_setup(char *p) | |||
236 | { | 236 | { |
237 | iommu_merge = 1; | 237 | iommu_merge = 1; |
238 | 238 | ||
239 | if (!p) | ||
240 | return -EINVAL; | ||
241 | |||
239 | while (*p) { | 242 | while (*p) { |
240 | if (!strncmp(p,"off",3)) | 243 | if (!strncmp(p,"off",3)) |
241 | no_iommu = 1; | 244 | no_iommu = 1; |
@@ -278,9 +281,9 @@ __init int iommu_setup(char *p) | |||
278 | if (*p == ',') | 281 | if (*p == ',') |
279 | ++p; | 282 | ++p; |
280 | } | 283 | } |
281 | return 1; | 284 | return 0; |
282 | } | 285 | } |
283 | __setup("iommu=", iommu_setup); | 286 | early_param("iommu", iommu_setup); |
284 | 287 | ||
285 | void __init pci_iommu_alloc(void) | 288 | void __init pci_iommu_alloc(void) |
286 | { | 289 | { |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 73f1cdd140fe..f55540a6084e 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -76,11 +76,6 @@ unsigned long mmu_cr4_features; | |||
76 | 76 | ||
77 | int acpi_disabled; | 77 | int acpi_disabled; |
78 | EXPORT_SYMBOL(acpi_disabled); | 78 | EXPORT_SYMBOL(acpi_disabled); |
79 | #ifdef CONFIG_ACPI | ||
80 | extern int __initdata acpi_ht; | ||
81 | extern acpi_interrupt_flags acpi_sci_flags; | ||
82 | int __initdata acpi_force = 0; | ||
83 | #endif | ||
84 | 79 | ||
85 | int acpi_numa __initdata; | 80 | int acpi_numa __initdata; |
86 | 81 | ||
@@ -276,183 +271,22 @@ static void __init probe_roms(void) | |||
276 | } | 271 | } |
277 | } | 272 | } |
278 | 273 | ||
279 | /* Check for full argument with no trailing characters */ | 274 | #ifdef CONFIG_PROC_VMCORE |
280 | static int fullarg(char *p, char *arg) | 275 | /* elfcorehdr= specifies the location of elf core header |
276 | * stored by the crashed kernel. This option will be passed | ||
277 | * by kexec loader to the capture kernel. | ||
278 | */ | ||
279 | static int __init setup_elfcorehdr(char *arg) | ||
281 | { | 280 | { |
282 | int l = strlen(arg); | 281 | char *end; |
283 | return !memcmp(p, arg, l) && (p[l] == 0 || isspace(p[l])); | 282 | if (!arg) |
283 | return -EINVAL; | ||
284 | elfcorehdr_addr = memparse(arg, &end); | ||
285 | return end > arg ? 0 : -EINVAL; | ||
284 | } | 286 | } |
285 | 287 | early_param("elfcorehdr", setup_elfcorehdr); | |
286 | static __init void parse_cmdline_early (char ** cmdline_p) | ||
287 | { | ||
288 | char c = ' ', *to = command_line, *from = COMMAND_LINE; | ||
289 | int len = 0; | ||
290 | int userdef = 0; | ||
291 | |||
292 | for (;;) { | ||
293 | if (c != ' ') | ||
294 | goto next_char; | ||
295 | |||
296 | #ifdef CONFIG_SMP | ||
297 | /* | ||
298 | * If the BIOS enumerates physical processors before logical, | ||
299 | * maxcpus=N at enumeration-time can be used to disable HT. | ||
300 | */ | ||
301 | else if (!memcmp(from, "maxcpus=", 8)) { | ||
302 | extern unsigned int maxcpus; | ||
303 | |||
304 | maxcpus = simple_strtoul(from + 8, NULL, 0); | ||
305 | } | ||
306 | #endif | ||
307 | #ifdef CONFIG_ACPI | ||
308 | /* "acpi=off" disables both ACPI table parsing and interpreter init */ | ||
309 | if (fullarg(from,"acpi=off")) | ||
310 | disable_acpi(); | ||
311 | |||
312 | if (fullarg(from, "acpi=force")) { | ||
313 | /* add later when we do DMI horrors: */ | ||
314 | acpi_force = 1; | ||
315 | acpi_disabled = 0; | ||
316 | } | ||
317 | |||
318 | /* acpi=ht just means: do ACPI MADT parsing | ||
319 | at bootup, but don't enable the full ACPI interpreter */ | ||
320 | if (fullarg(from, "acpi=ht")) { | ||
321 | if (!acpi_force) | ||
322 | disable_acpi(); | ||
323 | acpi_ht = 1; | ||
324 | } | ||
325 | else if (fullarg(from, "pci=noacpi")) | ||
326 | acpi_disable_pci(); | ||
327 | else if (fullarg(from, "acpi=noirq")) | ||
328 | acpi_noirq_set(); | ||
329 | |||
330 | else if (fullarg(from, "acpi_sci=edge")) | ||
331 | acpi_sci_flags.trigger = 1; | ||
332 | else if (fullarg(from, "acpi_sci=level")) | ||
333 | acpi_sci_flags.trigger = 3; | ||
334 | else if (fullarg(from, "acpi_sci=high")) | ||
335 | acpi_sci_flags.polarity = 1; | ||
336 | else if (fullarg(from, "acpi_sci=low")) | ||
337 | acpi_sci_flags.polarity = 3; | ||
338 | |||
339 | /* acpi=strict disables out-of-spec workarounds */ | ||
340 | else if (fullarg(from, "acpi=strict")) { | ||
341 | acpi_strict = 1; | ||
342 | } | ||
343 | else if (fullarg(from, "acpi_skip_timer_override")) | ||
344 | acpi_skip_timer_override = 1; | ||
345 | #endif | 288 | #endif |
346 | 289 | ||
347 | if (fullarg(from, "disable_timer_pin_1")) | ||
348 | disable_timer_pin_1 = 1; | ||
349 | if (fullarg(from, "enable_timer_pin_1")) | ||
350 | disable_timer_pin_1 = -1; | ||
351 | |||
352 | if (fullarg(from, "nolapic") || fullarg(from, "disableapic")) { | ||
353 | clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); | ||
354 | disable_apic = 1; | ||
355 | } | ||
356 | |||
357 | if (fullarg(from, "noapic")) | ||
358 | skip_ioapic_setup = 1; | ||
359 | |||
360 | if (fullarg(from,"apic")) { | ||
361 | skip_ioapic_setup = 0; | ||
362 | ioapic_force = 1; | ||
363 | } | ||
364 | |||
365 | if (!memcmp(from, "mem=", 4)) | ||
366 | parse_memopt(from+4, &from); | ||
367 | |||
368 | if (!memcmp(from, "memmap=", 7)) { | ||
369 | /* exactmap option is for used defined memory */ | ||
370 | if (!memcmp(from+7, "exactmap", 8)) { | ||
371 | #ifdef CONFIG_CRASH_DUMP | ||
372 | /* If we are doing a crash dump, we | ||
373 | * still need to know the real mem | ||
374 | * size before original memory map is | ||
375 | * reset. | ||
376 | */ | ||
377 | saved_max_pfn = e820_end_of_ram(); | ||
378 | #endif | ||
379 | from += 8+7; | ||
380 | end_pfn_map = 0; | ||
381 | e820.nr_map = 0; | ||
382 | userdef = 1; | ||
383 | } | ||
384 | else { | ||
385 | parse_memmapopt(from+7, &from); | ||
386 | userdef = 1; | ||
387 | } | ||
388 | } | ||
389 | |||
390 | #ifdef CONFIG_NUMA | ||
391 | if (!memcmp(from, "numa=", 5)) | ||
392 | numa_setup(from+5); | ||
393 | #endif | ||
394 | |||
395 | if (!memcmp(from,"iommu=",6)) { | ||
396 | iommu_setup(from+6); | ||
397 | } | ||
398 | |||
399 | if (fullarg(from,"oops=panic")) | ||
400 | panic_on_oops = 1; | ||
401 | |||
402 | if (!memcmp(from, "noexec=", 7)) | ||
403 | nonx_setup(from + 7); | ||
404 | |||
405 | #ifdef CONFIG_KEXEC | ||
406 | /* crashkernel=size@addr specifies the location to reserve for | ||
407 | * a crash kernel. By reserving this memory we guarantee | ||
408 | * that linux never set's it up as a DMA target. | ||
409 | * Useful for holding code to do something appropriate | ||
410 | * after a kernel panic. | ||
411 | */ | ||
412 | else if (!memcmp(from, "crashkernel=", 12)) { | ||
413 | unsigned long size, base; | ||
414 | size = memparse(from+12, &from); | ||
415 | if (*from == '@') { | ||
416 | base = memparse(from+1, &from); | ||
417 | /* FIXME: Do I want a sanity check | ||
418 | * to validate the memory range? | ||
419 | */ | ||
420 | crashk_res.start = base; | ||
421 | crashk_res.end = base + size - 1; | ||
422 | } | ||
423 | } | ||
424 | #endif | ||
425 | |||
426 | #ifdef CONFIG_PROC_VMCORE | ||
427 | /* elfcorehdr= specifies the location of elf core header | ||
428 | * stored by the crashed kernel. This option will be passed | ||
429 | * by kexec loader to the capture kernel. | ||
430 | */ | ||
431 | else if(!memcmp(from, "elfcorehdr=", 11)) | ||
432 | elfcorehdr_addr = memparse(from+11, &from); | ||
433 | #endif | ||
434 | |||
435 | #ifdef CONFIG_HOTPLUG_CPU | ||
436 | else if (!memcmp(from, "additional_cpus=", 16)) | ||
437 | setup_additional_cpus(from+16); | ||
438 | #endif | ||
439 | |||
440 | next_char: | ||
441 | c = *(from++); | ||
442 | if (!c) | ||
443 | break; | ||
444 | if (COMMAND_LINE_SIZE <= ++len) | ||
445 | break; | ||
446 | *(to++) = c; | ||
447 | } | ||
448 | if (userdef) { | ||
449 | printk(KERN_INFO "user-defined physical RAM map:\n"); | ||
450 | e820_print_map("user"); | ||
451 | } | ||
452 | *to = '\0'; | ||
453 | *cmdline_p = command_line; | ||
454 | } | ||
455 | |||
456 | #ifndef CONFIG_NUMA | 290 | #ifndef CONFIG_NUMA |
457 | static void __init | 291 | static void __init |
458 | contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) | 292 | contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) |
@@ -547,7 +381,12 @@ void __init setup_arch(char **cmdline_p) | |||
547 | 381 | ||
548 | early_identify_cpu(&boot_cpu_data); | 382 | early_identify_cpu(&boot_cpu_data); |
549 | 383 | ||
550 | parse_cmdline_early(cmdline_p); | 384 | strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); |
385 | *cmdline_p = command_line; | ||
386 | |||
387 | parse_early_param(); | ||
388 | |||
389 | finish_e820_parsing(); | ||
551 | 390 | ||
552 | /* | 391 | /* |
553 | * partially used pages are not usable - thus | 392 | * partially used pages are not usable - thus |
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c index 417de564456e..646caa0a20bb 100644 --- a/arch/x86_64/kernel/setup64.c +++ b/arch/x86_64/kernel/setup64.c | |||
@@ -46,8 +46,10 @@ Control non executable mappings for 64bit processes. | |||
46 | on Enable(default) | 46 | on Enable(default) |
47 | off Disable | 47 | off Disable |
48 | */ | 48 | */ |
49 | int __init nonx_setup(char *str) | 49 | static int __init nonx_setup(char *str) |
50 | { | 50 | { |
51 | if (!str) | ||
52 | return -EINVAL; | ||
51 | if (!strncmp(str, "on", 2)) { | 53 | if (!strncmp(str, "on", 2)) { |
52 | __supported_pte_mask |= _PAGE_NX; | 54 | __supported_pte_mask |= _PAGE_NX; |
53 | do_not_nx = 0; | 55 | do_not_nx = 0; |
@@ -55,9 +57,9 @@ int __init nonx_setup(char *str) | |||
55 | do_not_nx = 1; | 57 | do_not_nx = 1; |
56 | __supported_pte_mask &= ~_PAGE_NX; | 58 | __supported_pte_mask &= ~_PAGE_NX; |
57 | } | 59 | } |
58 | return 1; | 60 | return 0; |
59 | } | 61 | } |
60 | __setup("noexec=", nonx_setup); /* parsed early actually */ | 62 | early_param("noexec", nonx_setup); |
61 | 63 | ||
62 | int force_personality32 = 0; | 64 | int force_personality32 = 0; |
63 | 65 | ||
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index ae7d6d84e352..0b9f28b05e7d 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -1270,11 +1270,11 @@ void __cpu_die(unsigned int cpu) | |||
1270 | printk(KERN_ERR "CPU %u didn't die...\n", cpu); | 1270 | printk(KERN_ERR "CPU %u didn't die...\n", cpu); |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | __init int setup_additional_cpus(char *s) | 1273 | static __init int setup_additional_cpus(char *s) |
1274 | { | 1274 | { |
1275 | return get_option(&s, &additional_cpus); | 1275 | return s && get_option(&s, &additional_cpus) ? 0 : -EINVAL; |
1276 | } | 1276 | } |
1277 | __setup("additional_cpus=", setup_additional_cpus); | 1277 | early_param("additional_cpus", setup_additional_cpus); |
1278 | 1278 | ||
1279 | #else /* ... !CONFIG_HOTPLUG_CPU */ | 1279 | #else /* ... !CONFIG_HOTPLUG_CPU */ |
1280 | 1280 | ||
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 56d7ff0c894c..9ec2b1d5893d 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -1119,24 +1119,30 @@ void __init trap_init(void) | |||
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | 1121 | ||
1122 | /* Actual parsing is done early in setup.c. */ | 1122 | static int __init oops_setup(char *s) |
1123 | static int __init oops_dummy(char *s) | ||
1124 | { | 1123 | { |
1125 | panic_on_oops = 1; | 1124 | if (!s) |
1126 | return 1; | 1125 | return -EINVAL; |
1126 | if (!strcmp(s, "panic")) | ||
1127 | panic_on_oops = 1; | ||
1128 | return 0; | ||
1127 | } | 1129 | } |
1128 | __setup("oops=", oops_dummy); | 1130 | early_param("oops", oops_setup); |
1129 | 1131 | ||
1130 | static int __init kstack_setup(char *s) | 1132 | static int __init kstack_setup(char *s) |
1131 | { | 1133 | { |
1134 | if (!s) | ||
1135 | return -EINVAL; | ||
1132 | kstack_depth_to_print = simple_strtoul(s,NULL,0); | 1136 | kstack_depth_to_print = simple_strtoul(s,NULL,0); |
1133 | return 1; | 1137 | return 0; |
1134 | } | 1138 | } |
1135 | __setup("kstack=", kstack_setup); | 1139 | early_param("kstack", kstack_setup); |
1136 | 1140 | ||
1137 | #ifdef CONFIG_STACK_UNWIND | 1141 | #ifdef CONFIG_STACK_UNWIND |
1138 | static int __init call_trace_setup(char *s) | 1142 | static int __init call_trace_setup(char *s) |
1139 | { | 1143 | { |
1144 | if (!s) | ||
1145 | return -EINVAL; | ||
1140 | if (strcmp(s, "old") == 0) | 1146 | if (strcmp(s, "old") == 0) |
1141 | call_trace = -1; | 1147 | call_trace = -1; |
1142 | else if (strcmp(s, "both") == 0) | 1148 | else if (strcmp(s, "both") == 0) |
@@ -1145,7 +1151,7 @@ static int __init call_trace_setup(char *s) | |||
1145 | call_trace = 1; | 1151 | call_trace = 1; |
1146 | else if (strcmp(s, "new") == 0) | 1152 | else if (strcmp(s, "new") == 0) |
1147 | call_trace = 2; | 1153 | call_trace = 2; |
1148 | return 1; | 1154 | return 0; |
1149 | } | 1155 | } |
1150 | __setup("call_trace=", call_trace_setup); | 1156 | early_param("call_trace", call_trace_setup); |
1151 | #endif | 1157 | #endif |
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index b2fac14baac0..d64d6d93d04b 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c | |||
@@ -348,9 +348,10 @@ void __init paging_init(void) | |||
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | /* [numa=off] */ | 351 | static __init int numa_setup(char *opt) |
352 | __init int numa_setup(char *opt) | ||
353 | { | 352 | { |
353 | if (!opt) | ||
354 | return -EINVAL; | ||
354 | if (!strncmp(opt,"off",3)) | 355 | if (!strncmp(opt,"off",3)) |
355 | numa_off = 1; | 356 | numa_off = 1; |
356 | #ifdef CONFIG_NUMA_EMU | 357 | #ifdef CONFIG_NUMA_EMU |
@@ -366,9 +367,11 @@ __init int numa_setup(char *opt) | |||
366 | if (!strncmp(opt,"hotadd=", 7)) | 367 | if (!strncmp(opt,"hotadd=", 7)) |
367 | hotadd_percent = simple_strtoul(opt+7, NULL, 10); | 368 | hotadd_percent = simple_strtoul(opt+7, NULL, 10); |
368 | #endif | 369 | #endif |
369 | return 1; | 370 | return 0; |
370 | } | 371 | } |
371 | 372 | ||
373 | early_param("numa", numa_setup); | ||
374 | |||
372 | /* | 375 | /* |
373 | * Setup early cpu_to_node. | 376 | * Setup early cpu_to_node. |
374 | * | 377 | * |