2.6.5-rc2: Configure APIC default enabled state
PATCH 1/1 2.6.5-rc2: Configure APIC default enabled state
Patch to make the default APIC state configurable. Mostly useful for distro installer kernels.
arch/i386/Kconfig +12 -0
@@ -517,6 +517,18 @@ config X86_UP_IOAPIC If you have a system with several CPUs, you do not need to say Y here: the IO-APIC will be used automatically. +config X86_UP_APIC_DEFAULT_OFF + bool "APIC support on uniprocessors defaults to off" + depends on !SMP && X86_UP_APIC + help + Some older systems have flaky APICs. Say Y to turn off APIC + support by default, while still allowing it to be enabled by the + "lapic" and "apic" command line options. + + Usually this is only necessary for distro installer kernels that + must work with everything. Everyone else can safely say N here + and configure APIC support in or out as needed. + config X86_LOCAL_APIC bool depends on !SMP && X86_UP_APIC
arch/i386/kernel/apic.c +0 -1
@@ -608,7 +608,7 @@ static void apic_pm_activate(void) { }/* * Knob to control our willingness to enable the local APIC. */ -int enable_local_apic__initdata =0 ;/* -1=force-disable, +1=force-enable
*/
+int enable_local_apic __initdata = (X86_APIC_DEFAULT_OFF ? -1 : 0); /* -1=force-disable, +1=force-enable */
static int __init lapic_disable(char *str)
{
diff -pru 2.6.5-rc2/arch/i386/kernel/io_apic.c z5r2/arch/i386/kernel/ io_apic.c
arch/i386/kernel/io_apic.c +1 -1
@@ -719,7 +719,7 @@ void fastcall send_IPI_self(int vector)#define MAX_PIRQS 8int pirq_entries [MAX_PIRQS ];int pirqs_enabled; -int skip_ioapic_setup; +int skip_ioapic_setup =X86_APIC_DEFAULT_OFF ;static int __init ioapic_setup (char *str) {
arch/i386/kernel/setup.c +3 -0
@@ -594,6 +594,9 @@ static void __init parse_cmdline_early (/* disable IO-APIC */ else if (!memcmp(from, "noapic", 6))disable_ioapic_setup (); +/* disable IO-APIC */ + else if (!memcmp(from, "apic", 4)) +enable_ioapic_setup ();#endif /* CONFIG_X86_LOCAL_APIC */ #endif /* CONFIG_ACPI_BOOT */
include/asm-i386/acpi.h +4 -0
@@ -128,6 +128,10 @@ static inline void disable_ioapic_setup( { skip_ioapic_setup =1 ; } +static inline void enable_ioapic_setup (void ) +{ + skip_ioapic_setup =0 ; +}static inline int ioapic_setup_disabled (void ) {
include/asm-i386/apic.h +6 -0
@@ -51,6 +51,12 @@ static __inline__ void apic_wait_icr_idl# define apic_write_around (x,y) apic_write_atomic((x),(y))#endif +#ifdef CONFIG_X86_UP_APIC_DEFAULT_OFF +# define X86_APIC_DEFAULT_OFF 1 +#else +# define X86_APIC_DEFAULT_OFF 0 +#endif +static inline void ack_APIC_irq (void ) {/*
Signature · 3 lines
James Cleverdon
IBM LTC (xSeries Linux Solutions)
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot commarch/i386/Kconfig +12 -0
@@ -517,6 +517,18 @@ config X86_UP_IOAPIC If you have a system with several CPUs, you do not need to say Y here: the IO-APIC will be used automatically. +config X86_UP_APIC_DEFAULT_OFF + bool "APIC support on uniprocessors defaults to off" + depends on !SMP && X86_UP_APIC + help + Some older systems have flaky APICs. Say Y to turn off APIC + support by default, while still allowing it to be enabled by the + "lapic" and "apic" command line options. + + Usually this is only necessary for distro installer kernels that + must work with everything. Everyone else can safely say N here + and configure APIC support in or out as needed. + config X86_LOCAL_APIC bool depends on !SMP && X86_UP_APIC
arch/i386/kernel/apic.c +1 -1
@@ -608,7 +608,7 @@ static void apic_pm_activate(void) { }/* * Knob to control our willingness to enable the local APIC. */ -int enable_local_apic__initdata =0 ;/* -1=force-disable, +1=force-enable */ +int enable_local_apic__initdata = (X86_APIC_DEFAULT_OFF ?-1 :0 );/* -1=force-disable, +1=force-enable */ static int __init lapic_disable (char *str) {
arch/i386/kernel/io_apic.c +1 -1
@@ -719,7 +719,7 @@ void fastcall send_IPI_self(int vector)#define MAX_PIRQS 8int pirq_entries [MAX_PIRQS ];int pirqs_enabled; -int skip_ioapic_setup; +int skip_ioapic_setup =X86_APIC_DEFAULT_OFF ;static int __init ioapic_setup (char *str) {
arch/i386/kernel/setup.c +3 -0
@@ -594,6 +594,9 @@ static void __init parse_cmdline_early (/* disable IO-APIC */ else if (!memcmp(from, "noapic", 6))disable_ioapic_setup (); +/* disable IO-APIC */ + else if (!memcmp(from, "apic", 4)) +enable_ioapic_setup ();#endif /* CONFIG_X86_LOCAL_APIC */ #endif /* CONFIG_ACPI_BOOT */
include/asm-i386/acpi.h +4 -0
@@ -128,6 +128,10 @@ static inline void disable_ioapic_setup( { skip_ioapic_setup =1 ; } +static inline void enable_ioapic_setup (void ) +{ + skip_ioapic_setup =0 ; +}static inline int ioapic_setup_disabled (void ) {
include/asm-i386/apic.h +6 -0
@@ -51,6 +51,12 @@ static __inline__ void apic_wait_icr_idl# define apic_write_around (x,y) apic_write_atomic((x),(y))#endif +#ifdef CONFIG_X86_UP_APIC_DEFAULT_OFF +# define X86_APIC_DEFAULT_OFF 1 +#else +# define X86_APIC_DEFAULT_OFF 0 +#endif +static inline void ack_APIC_irq (void ) {/*