]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ACPI: boot correctly with "nosmp" or "maxcpus=0"
authorLen Brown <len.brown@intel.com>
Thu, 16 Aug 2007 07:34:22 +0000 (03:34 -0400)
committerLen Brown <len.brown@intel.com>
Tue, 21 Aug 2007 04:33:35 +0000 (00:33 -0400)
In MPS mode, "nosmp" and "maxcpus=0" boot a UP kernel with IOAPIC disabled.
However, in ACPI mode, these parameters didn't completely disable
the IO APIC initialization code and boot failed.

init/main.c:
Disable the IO_APIC if "nosmp" or "maxcpus=0"
undefine disable_ioapic_setup() when it doesn't apply.

i386:
delete ioapic_setup(), it was a duplicate of parse_noapic()
delete undefinition of disable_ioapic_setup()

x86_64:
rename disable_ioapic_setup() to parse_noapic() to match i386
define disable_ioapic_setup() in header to match i386

http://bugzilla.kernel.org/show_bug.cgi?id=1641

Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Documentation/kernel-parameters.txt
arch/i386/kernel/io_apic.c
arch/x86_64/kernel/io_apic.c
include/asm-i386/io_apic.h
include/asm-x86_64/io_apic.h
init/main.c

index 975f029be25cb991e02ac9d310a15cd767ad2d29..17770b45631042fae4e44409012a29a5888463e1 100644 (file)
@@ -952,14 +952,10 @@ and is between 256 and 4096 characters. It is defined in the file
                        Format: <1-256>
 
        maxcpus=        [SMP] Maximum number of processors that an SMP kernel
-                       should make use of.
-                       Using "nosmp" or "maxcpus=0" will disable SMP
-                       entirely (the MPS table probe still happens, though).
-                       A command-line option of "maxcpus=<NUM>", where <NUM>
-                       is an integer greater than 0, limits the maximum number
-                       of CPUs activated in SMP mode to <NUM>.
-                       Using "maxcpus=1" on an SMP kernel is the trivial
-                       case of an SMP kernel with only one CPU.
+                       should make use of.  maxcpus=n : n >= 0 limits the
+                       kernel to using 'n' processors.  n=0 is a special case,
+                       it is equivalent to "nosmp", which also disables
+                       the IO APIC.
 
        max_addr=[KMG]  [KNL,BOOT,ia64] All physical memory greater than or
                        equal to this physical address is ignored.
@@ -1184,7 +1180,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
        nosep           [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support.
 
-       nosmp           [SMP] Tells an SMP kernel to act as a UP kernel.
+       nosmp           [SMP] Tells an SMP kernel to act as a UP kernel,
+                       and disable the IO APIC.  legacy for "maxcpus=0".
 
        nosoftlockup    [KNL] Disable the soft-lockup detector.
 
index 4b8a8da4b2e0345b2b1a8d4ba46f4d2f0e9bb2d0..e2f4a1c685476c0025e88007c674e939ae19574d 100644 (file)
@@ -754,14 +754,6 @@ static int pirq_entries [MAX_PIRQS];
 static int pirqs_enabled;
 int skip_ioapic_setup;
 
-static int __init ioapic_setup(char *str)
-{
-       skip_ioapic_setup = 1;
-       return 1;
-}
-
-__setup("noapic", ioapic_setup);
-
 static int __init ioapic_pirq_setup(char *str)
 {
        int i, max;
index f57f8b901912dba2829ebd3ced20ec754c61a813..966fa10624911c93fd042e37440f9d101e10693f 100644 (file)
@@ -397,14 +397,12 @@ static void clear_IO_APIC (void)
 int skip_ioapic_setup;
 int ioapic_force;
 
-/* dummy parsing: see setup.c */
-
-static int __init disable_ioapic_setup(char *str)
+static int __init parse_noapic(char *str)
 {
-       skip_ioapic_setup = 1;
+       disable_ioapic_setup();
        return 0;
 }
-early_param("noapic", disable_ioapic_setup);
+early_param("noapic", parse_noapic);
 
 /* Actually the next is obsolete, but keep it for paranoid reasons -AK */
 static int __init disable_timer_pin_setup(char *arg)
index 340764076d5f4e56585779eaafb4ba249269f0a4..dbe734ddf2aff833f69cb3081d2ce2b2ee14bdc1 100644 (file)
@@ -150,7 +150,6 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
 
 #else  /* !CONFIG_X86_IO_APIC */
 #define io_apic_assign_pci_irqs 0
-static inline void disable_ioapic_setup(void) { }
 #endif
 
 #endif
index 969d225a93502bff46ec0ad92f9ce64143f1ebf1..d9f2e54324d508729e88c2195034937fc2e185b9 100644 (file)
@@ -109,6 +109,12 @@ extern int mpc_default_type;
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
 
+static inline void disable_ioapic_setup(void)
+{
+       skip_ioapic_setup = 1;
+}
+
+
 /*
  * If we use the IO-APIC for IRQ routing, disable automatic
  * assignment of PCI IRQ's.
index d3bcb3b11620784a37dd6d44561a874e9df1d982..cc0653ec081d7d50893bc3e35f24697abb445869 100644 (file)
@@ -146,9 +146,14 @@ static unsigned int __initdata max_cpus = NR_CPUS;
  * greater than 0, limits the maximum number of CPUs activated in
  * SMP mode to <NUM>.
  */
+#ifndef CONFIG_X86_IO_APIC
+static inline void disable_ioapic_setup(void) {};
+#endif
+
 static int __init nosmp(char *str)
 {
        max_cpus = 0;
+       disable_ioapic_setup();
        return 0;
 }
 
@@ -157,10 +162,13 @@ early_param("nosmp", nosmp);
 static int __init maxcpus(char *str)
 {
        get_option(&str, &max_cpus);
-       return 1;
+       if (max_cpus == 0)
+               disable_ioapic_setup();
+
+       return 0;
 }
 
-__setup("maxcpus=", maxcpus);
+early_param("maxcpus=", maxcpus);
 #else
 #define max_cpus NR_CPUS
 #endif