aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-09-26 04:52:32 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:32 -0400
commit2c8c0e6b8d7700a990da8d24eff767f9ca223b96 (patch)
treeb5477ee2558efff235c483d1619ce892db479d18
parent1a3f239ddf9208f2e52d36fef1c1c4518cbbbabe (diff)
[PATCH] Convert x86-64 to early param
Instead of hackish manual parsing Requires earlier i386 patchkit, but also fixes i386 early_printk again. I removed some obsolete really early parameters which didn't do anything useful. Also made a few parameters that needed it early (mostly oops printing setup) Also removed one panic check that wasn't visible without early console anyways (the early console is now initialized after that panic) This cleans up a lot of code. Signed-off-by: Andi Kleen <ak@suse.de>
-rw-r--r--arch/x86_64/kernel/apic.c34
-rw-r--r--arch/x86_64/kernel/e820.c53
-rw-r--r--arch/x86_64/kernel/early_printk.c20
-rw-r--r--arch/x86_64/kernel/head64.c15
-rw-r--r--arch/x86_64/kernel/io_apic.c15
-rw-r--r--arch/x86_64/kernel/machine_kexec.c28
-rw-r--r--arch/x86_64/kernel/pci-dma.c7
-rw-r--r--arch/x86_64/kernel/setup.c197
-rw-r--r--arch/x86_64/kernel/setup64.c8
-rw-r--r--arch/x86_64/kernel/smpboot.c6
-rw-r--r--arch/x86_64/kernel/traps.c24
-rw-r--r--arch/x86_64/mm/numa.c9
-rw-r--r--include/asm-x86_64/apic.h4
-rw-r--r--include/asm-x86_64/e820.h3
-rw-r--r--include/asm-x86_64/pgtable.h1
-rw-r--r--include/asm-x86_64/proto.h10
16 files changed, 159 insertions, 275 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
40int apic_verbosity; 41int apic_verbosity;
41int apic_runs_main_timer; 42int apic_runs_main_timer;
@@ -546,18 +547,24 @@ static void apic_pm_activate(void) { }
546 547
547static int __init apic_set_verbosity(char *str) 548static 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 567early_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)
1078static __init int setup_disableapic(char *str) 1085static __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}
1091early_param("disableapic", setup_disableapic);
1083 1092
1093/* same as disableapic, for compatibility */
1084static __init int setup_nolapic(char *str) 1094static __init int setup_nolapic(char *str)
1085{ 1095{
1086 disable_apic = 1; 1096 return setup_disableapic(str);
1087 return 1;
1088} 1097}
1098early_param("nolapic", setup_nolapic);
1089 1099
1090static __init int setup_noapictimer(char *str) 1100static __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
599void __init parse_memopt(char *p, char **from) 599static 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}
607early_param("mem", parse_memopt);
608
609static int userdef __initdata;
604 610
605void __init parse_memmapopt(char *p, char **from) 611static 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}
649early_param("memmap", parse_memmap_opt);
650
651void 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
626unsigned long pci_mem_start = 0xaeedbabe; 659unsigned 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
216static int __initdata keep_early; 216static int __initdata keep_early;
217 217
218int __init setup_early_printk(char *opt) 218static 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
251early_param("earlyprintk", setup_early_printk);
252
256void __init disable_early_printk(void) 253void __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
59void __init x86_64_start_kernel(char * real_mode_data) 59void __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
49static int no_timer_check; 49static int no_timer_check;
50 50
51int disable_timer_pin_1 __initdata; 51static int disable_timer_pin_1 __initdata;
52 52
53int timer_over_8254 __initdata = 0; 53int timer_over_8254 __initdata = 0;
54 54
@@ -253,18 +253,17 @@ int ioapic_force;
253static int __init disable_ioapic_setup(char *str) 253static 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}
258early_param("noapic", disable_ioapic_setup);
258 259
259static int __init enable_ioapic_setup(char *str) 260/* Actually the next is obsolete, but keep it for paranoid reasons -AK */
261static 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
269static int __init setup_disable_8254_timer(char *s) 268static 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 */
236static 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}
255early_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); 286early_param("iommu", iommu_setup);
284 287
285void __init pci_iommu_alloc(void) 288void __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
77int acpi_disabled; 77int acpi_disabled;
78EXPORT_SYMBOL(acpi_disabled); 78EXPORT_SYMBOL(acpi_disabled);
79#ifdef CONFIG_ACPI
80extern int __initdata acpi_ht;
81extern acpi_interrupt_flags acpi_sci_flags;
82int __initdata acpi_force = 0;
83#endif
84 79
85int acpi_numa __initdata; 80int 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
280static 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 */
279static 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 287early_param("elfcorehdr", setup_elfcorehdr);
286static __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
457static void __init 291static void __init
458contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) 292contig_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.
46on Enable(default) 46on Enable(default)
47off Disable 47off Disable
48*/ 48*/
49int __init nonx_setup(char *str) 49static 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 */ 62early_param("noexec", nonx_setup);
61 63
62int force_personality32 = 0; 64int 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) 1273static __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); 1277early_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. */ 1122static int __init oops_setup(char *s)
1123static 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); 1130early_param("oops", oops_setup);
1129 1131
1130static int __init kstack_setup(char *s) 1132static 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); 1139early_param("kstack", kstack_setup);
1136 1140
1137#ifdef CONFIG_STACK_UNWIND 1141#ifdef CONFIG_STACK_UNWIND
1138static int __init call_trace_setup(char *s) 1142static 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); 1156early_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] */ 351static __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
373early_param("numa", numa_setup);
374
372/* 375/*
373 * Setup early cpu_to_node. 376 * Setup early cpu_to_node.
374 * 377 *
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 8ed0f4d67b8d..29ee735278f2 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -17,6 +17,7 @@
17 17
18extern int apic_verbosity; 18extern int apic_verbosity;
19extern int apic_runs_main_timer; 19extern int apic_runs_main_timer;
20extern int ioapic_force;
20 21
21/* 22/*
22 * Define the default level of output to be very little 23 * Define the default level of output to be very little
@@ -93,9 +94,6 @@ extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,
93#define K8_APIC_EXT_INT_MSG_EXT 0x7 94#define K8_APIC_EXT_INT_MSG_EXT 0x7
94#define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0 95#define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0
95 96
96extern int disable_timer_pin_1;
97
98
99void smp_send_timer_broadcast_ipi(void); 97void smp_send_timer_broadcast_ipi(void);
100void switch_APIC_timer_to_ipi(void *cpumask); 98void switch_APIC_timer_to_ipi(void *cpumask);
101void switch_ipi_to_APIC_timer(void *cpumask); 99void switch_ipi_to_APIC_timer(void *cpumask);
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 670a3388e70a..dba012151856 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -55,8 +55,7 @@ extern void e820_setup_gap(void);
55extern unsigned long e820_hole_size(unsigned long start_pfn, 55extern unsigned long e820_hole_size(unsigned long start_pfn,
56 unsigned long end_pfn); 56 unsigned long end_pfn);
57 57
58extern void __init parse_memopt(char *p, char **end); 58extern void finish_e820_parsing(void);
59extern void __init parse_memmapopt(char *p, char **end);
60 59
61extern struct e820map e820; 60extern struct e820map e820;
62 61
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 0c1e2422400a..d79e7441b513 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -21,7 +21,6 @@ extern unsigned long __supported_pte_mask;
21 21
22#define swapper_pg_dir init_level4_pgt 22#define swapper_pg_dir init_level4_pgt
23 23
24extern int nonx_setup(char *str);
25extern void paging_init(void); 24extern void paging_init(void);
26extern void clear_kernel_mapping(unsigned long addr, unsigned long size); 25extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
27 26
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index 58fec91318e4..151826f8ce69 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -53,9 +53,6 @@ extern int nohpet;
53extern unsigned long vxtime_hz; 53extern unsigned long vxtime_hz;
54extern void time_init_gtod(void); 54extern void time_init_gtod(void);
55 55
56extern int numa_setup(char *opt);
57
58extern int setup_early_printk(char *);
59extern void early_printk(const char *fmt, ...) __attribute__((format(printf,1,2))); 56extern void early_printk(const char *fmt, ...) __attribute__((format(printf,1,2)));
60 57
61extern void early_identify_cpu(struct cpuinfo_x86 *c); 58extern void early_identify_cpu(struct cpuinfo_x86 *c);
@@ -104,13 +101,7 @@ extern void select_idle_routine(const struct cpuinfo_x86 *c);
104extern unsigned long table_start, table_end; 101extern unsigned long table_start, table_end;
105 102
106extern int exception_trace; 103extern int exception_trace;
107extern int using_apic_timer;
108extern int disable_apic;
109extern unsigned cpu_khz; 104extern unsigned cpu_khz;
110extern int ioapic_force;
111extern int skip_ioapic_setup;
112extern int acpi_ht;
113extern int acpi_disabled;
114 105
115extern void no_iommu_init(void); 106extern void no_iommu_init(void);
116extern int force_iommu, no_iommu; 107extern int force_iommu, no_iommu;
@@ -132,7 +123,6 @@ extern int fix_aperture;
132 123
133extern int reboot_force; 124extern int reboot_force;
134extern int notsc_setup(char *); 125extern int notsc_setup(char *);
135extern int setup_additional_cpus(char *);
136 126
137extern void smp_local_timer_interrupt(struct pt_regs * regs); 127extern void smp_local_timer_interrupt(struct pt_regs * regs);
138 128