From: James Cleverdon <jamesclv@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
John Stultz <johnstul@us.ibm.com>
Subject: [PATCH] 2.6.5-rc2: Configure APIC default enabled state
Date: Tue, 27 Apr 2004 15:27:41 -0700 [thread overview]
Message-ID: <200404271527.41098.jamesclv@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3691 bytes --]
Patch to make the default APIC state configurable. Mostly useful for distro
installer kernels.
diff -pru 2.6.5-rc2/arch/i386/Kconfig z5r2/arch/i386/Kconfig
--- 2.6.5-rc2/arch/i386/Kconfig 2004-03-19 16:11:02.000000000 -0800
+++ z5r2/arch/i386/Kconfig 2004-04-27 15:18:45.758181660 -0700
@@ -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
diff -pru 2.6.5-rc2/arch/i386/kernel/apic.c z5r2/arch/i386/kernel/apic.c
--- 2.6.5-rc2/arch/i386/kernel/apic.c 2004-03-19 16:12:09.000000000 -0800
+++ z5r2/arch/i386/kernel/apic.c 2004-04-27 15:18:45.760180861 -0700
@@ -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
--- 2.6.5-rc2/arch/i386/kernel/io_apic.c 2004-03-19 16:11:04.000000000 -0800
+++ z5r2/arch/i386/kernel/io_apic.c 2004-04-27 15:18:45.762180063 -0700
@@ -719,7 +719,7 @@ void fastcall send_IPI_self(int vector)
#define MAX_PIRQS 8
int 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)
{
diff -pru 2.6.5-rc2/arch/i386/kernel/setup.c z5r2/arch/i386/kernel/setup.c
--- 2.6.5-rc2/arch/i386/kernel/setup.c 2004-03-19 16:11:09.000000000 -0800
+++ z5r2/arch/i386/kernel/setup.c 2004-04-27 15:18:45.764179265 -0700
@@ -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 */
diff -pru 2.6.5-rc2/include/asm-i386/acpi.h z5r2/include/asm-i386/acpi.h
--- 2.6.5-rc2/include/asm-i386/acpi.h 2004-03-19 16:11:42.000000000 -0800
+++ z5r2/include/asm-i386/acpi.h 2004-04-27 15:18:45.766178467 -0700
@@ -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)
{
diff -pru 2.6.5-rc2/include/asm-i386/apic.h z5r2/include/asm-i386/apic.h
--- 2.6.5-rc2/include/asm-i386/apic.h 2004-03-19 16:12:00.000000000 -0800
+++ z5r2/include/asm-i386/apic.h 2004-04-27 15:18:45.766178467 -0700
@@ -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)
{
/*
--
James Cleverdon
IBM LTC (xSeries Linux Solutions)
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot comm
[-- Attachment #2: apic_default_off_2.6.5-rc2_2004-04-27 --]
[-- Type: text/x-diff, Size: 3465 bytes --]
diff -pru 2.6.5-rc2/arch/i386/Kconfig z5r2/arch/i386/Kconfig
--- 2.6.5-rc2/arch/i386/Kconfig 2004-03-19 16:11:02.000000000 -0800
+++ z5r2/arch/i386/Kconfig 2004-04-27 15:18:45.758181660 -0700
@@ -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
diff -pru 2.6.5-rc2/arch/i386/kernel/apic.c z5r2/arch/i386/kernel/apic.c
--- 2.6.5-rc2/arch/i386/kernel/apic.c 2004-03-19 16:12:09.000000000 -0800
+++ z5r2/arch/i386/kernel/apic.c 2004-04-27 15:18:45.760180861 -0700
@@ -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
--- 2.6.5-rc2/arch/i386/kernel/io_apic.c 2004-03-19 16:11:04.000000000 -0800
+++ z5r2/arch/i386/kernel/io_apic.c 2004-04-27 15:18:45.762180063 -0700
@@ -719,7 +719,7 @@ void fastcall send_IPI_self(int vector)
#define MAX_PIRQS 8
int 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)
{
diff -pru 2.6.5-rc2/arch/i386/kernel/setup.c z5r2/arch/i386/kernel/setup.c
--- 2.6.5-rc2/arch/i386/kernel/setup.c 2004-03-19 16:11:09.000000000 -0800
+++ z5r2/arch/i386/kernel/setup.c 2004-04-27 15:18:45.764179265 -0700
@@ -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 */
diff -pru 2.6.5-rc2/include/asm-i386/acpi.h z5r2/include/asm-i386/acpi.h
--- 2.6.5-rc2/include/asm-i386/acpi.h 2004-03-19 16:11:42.000000000 -0800
+++ z5r2/include/asm-i386/acpi.h 2004-04-27 15:18:45.766178467 -0700
@@ -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)
{
diff -pru 2.6.5-rc2/include/asm-i386/apic.h z5r2/include/asm-i386/apic.h
--- 2.6.5-rc2/include/asm-i386/apic.h 2004-03-19 16:12:00.000000000 -0800
+++ z5r2/include/asm-i386/apic.h 2004-04-27 15:18:45.766178467 -0700
@@ -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)
{
/*
reply other threads:[~2004-04-27 22:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200404271527.41098.jamesclv@us.ibm.com \
--to=jamesclv@us.ibm.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®