diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2005-06-25 17:57:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:46 -0400 |
commit | 9635b47d910223745258768418003580ef7dba17 (patch) | |
tree | b61adfddad3bf3069c9fa379b34805420b4ef85c | |
parent | 8f43d03fe2c4962c11d8227ac9505e590bad758b (diff) |
[PATCH] kexec: x86: local apic fix
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Fix a kexec problem whcih causes local APIC detection failure.
The problem is detect_init_APIC() is called early, before the command line
have been processed. Therefore "lapic" (and "nolapic") have not been seen,
yet.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/apic.c | 25 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 11 | ||||
-rw-r--r-- | include/asm-i386/apic.h | 13 |
3 files changed, 29 insertions, 20 deletions
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index b905d7bb9a0d..cf45bed96d08 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -41,6 +41,11 @@ | |||
41 | #include "io_ports.h" | 41 | #include "io_ports.h" |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Knob to control our willingness to enable the local APIC. | ||
45 | */ | ||
46 | int enable_local_apic __initdata = 0; /* -1=force-disable, +1=force-enable */ | ||
47 | |||
48 | /* | ||
44 | * Debug level | 49 | * Debug level |
45 | */ | 50 | */ |
46 | int apic_verbosity; | 51 | int apic_verbosity; |
@@ -666,26 +671,6 @@ static void apic_pm_activate(void) { } | |||
666 | * Original code written by Keir Fraser. | 671 | * Original code written by Keir Fraser. |
667 | */ | 672 | */ |
668 | 673 | ||
669 | /* | ||
670 | * Knob to control our willingness to enable the local APIC. | ||
671 | */ | ||
672 | int enable_local_apic __initdata = 0; /* -1=force-disable, +1=force-enable */ | ||
673 | |||
674 | static int __init lapic_disable(char *str) | ||
675 | { | ||
676 | enable_local_apic = -1; | ||
677 | clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); | ||
678 | return 0; | ||
679 | } | ||
680 | __setup("nolapic", lapic_disable); | ||
681 | |||
682 | static int __init lapic_enable(char *str) | ||
683 | { | ||
684 | enable_local_apic = 1; | ||
685 | return 0; | ||
686 | } | ||
687 | __setup("lapic", lapic_enable); | ||
688 | |||
689 | static int __init apic_set_verbosity(char *str) | 674 | static int __init apic_set_verbosity(char *str) |
690 | { | 675 | { |
691 | if (strcmp("debug", str) == 0) | 676 | if (strcmp("debug", str) == 0) |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index cba67e4ba0af..f1ad9fdeaad8 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/edd.h> | 44 | #include <linux/edd.h> |
45 | #include <linux/nodemask.h> | 45 | #include <linux/nodemask.h> |
46 | #include <video/edid.h> | 46 | #include <video/edid.h> |
47 | #include <asm/apic.h> | ||
47 | #include <asm/e820.h> | 48 | #include <asm/e820.h> |
48 | #include <asm/mpspec.h> | 49 | #include <asm/mpspec.h> |
49 | #include <asm/setup.h> | 50 | #include <asm/setup.h> |
@@ -835,6 +836,16 @@ static void __init parse_cmdline_early (char ** cmdline_p) | |||
835 | #endif /* CONFIG_X86_LOCAL_APIC */ | 836 | #endif /* CONFIG_X86_LOCAL_APIC */ |
836 | #endif /* CONFIG_ACPI_BOOT */ | 837 | #endif /* CONFIG_ACPI_BOOT */ |
837 | 838 | ||
839 | #ifdef CONFIG_X86_LOCAL_APIC | ||
840 | /* enable local APIC */ | ||
841 | else if (!memcmp(from, "lapic", 5)) | ||
842 | lapic_enable(); | ||
843 | |||
844 | /* disable local APIC */ | ||
845 | else if (!memcmp(from, "nolapic", 6)) | ||
846 | lapic_disable(); | ||
847 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
848 | |||
838 | /* | 849 | /* |
839 | * highmem=size forces highmem to be exactly 'size' bytes. | 850 | * highmem=size forces highmem to be exactly 'size' bytes. |
840 | * This works even on boxes that have no highmem otherwise. | 851 | * This works even on boxes that have no highmem otherwise. |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index a5810cf7b578..53268cd9306e 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/pm.h> | 5 | #include <linux/pm.h> |
6 | #include <asm/fixmap.h> | 6 | #include <asm/fixmap.h> |
7 | #include <asm/apicdef.h> | 7 | #include <asm/apicdef.h> |
8 | #include <asm/processor.h> | ||
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
10 | #define Dprintk(x...) | 11 | #define Dprintk(x...) |
@@ -16,8 +17,20 @@ | |||
16 | #define APIC_VERBOSE 1 | 17 | #define APIC_VERBOSE 1 |
17 | #define APIC_DEBUG 2 | 18 | #define APIC_DEBUG 2 |
18 | 19 | ||
20 | extern int enable_local_apic; | ||
19 | extern int apic_verbosity; | 21 | extern int apic_verbosity; |
20 | 22 | ||
23 | static inline void lapic_disable(void) | ||
24 | { | ||
25 | enable_local_apic = -1; | ||
26 | clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); | ||
27 | } | ||
28 | |||
29 | static inline void lapic_enable(void) | ||
30 | { | ||
31 | enable_local_apic = 1; | ||
32 | } | ||
33 | |||
21 | /* | 34 | /* |
22 | * Define the default level of output to be very little | 35 | * Define the default level of output to be very little |
23 | * This can be turned up by using apic=verbose for more | 36 | * This can be turned up by using apic=verbose for more |