summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-20 16:11:20 -0700
committerIngo Molnar <mingo@elte.hu>2008-07-08 12:48:31 +0200
commit3c999f142665265afd0fe9190204dd051f17e505 (patch)
tree83b764c2a90890c22b199d6445cf2e132babe455 /arch
parent88a6846c70ad6bf33a545d554ace801d69e8a1a5 (diff)
x86: check command line when CONFIG_X86_MPPARSE is not set, v2
if acpi=off, acpi=noirq and pci=noacpi, we need to disable apic. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/acpi/boot.c14
-rw-r--r--arch/x86/kernel/apic_32.c2
-rw-r--r--arch/x86/kernel/setup.c4
-rw-r--r--arch/x86/kernel/setup_32.c5
-rw-r--r--arch/x86/kernel/setup_64.c9
5 files changed, 33 insertions, 1 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6516359922ba..5c0107602b62 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1787,6 +1787,20 @@ static int __init parse_pci(char *arg)
}
early_param("pci", parse_pci);
+int __init acpi_mps_check(void)
+{
+#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_MPPARSE)
+/* mptable code is not built-in*/
+ if (acpi_disabled || acpi_noirq) {
+ printk(KERN_WARNING "MPS support code is not built-in.\n"
+ "Using acpi=off or acpi=noirq or pci=noacpi "
+ "may have problem\n");
+ return 1;
+ }
+#endif
+ return 0;
+}
+
#ifdef CONFIG_X86_IO_APIC
static int __init parse_acpi_skip_timer_override(char *arg)
{
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index dd8de26b2786..4932d7813bcd 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -57,7 +57,7 @@ unsigned long mp_lapic_addr;
*
* -1=force-disable, +1=force-enable
*/
-static int enable_local_apic __initdata;
+int enable_local_apic;
/* Local APIC timer verification ok */
static int local_apic_timer_verify_ok;
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index c5330f601b68..56aee55cf8dc 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -161,6 +161,10 @@ void __init setup_per_cpu_areas(void)
char *ptr;
int cpu;
+ /* no processor from mptable or madt */
+ if (!num_processors)
+ num_processors = 1;
+
#ifdef CONFIG_HOTPLUG_CPU
prefill_possible_map();
#else
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 369d0fe1ff9c..cad4e893df05 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -677,6 +677,11 @@ void __init setup_arch(char **cmdline_p)
parse_early_param();
+ if (acpi_mps_check()){
+ enable_local_apic = -1;
+ clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
+ }
+
finish_e820_parsing();
probe_roms();
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index a93300de4da9..175c696ec536 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -302,6 +302,11 @@ void __init setup_arch(char **cmdline_p)
parse_early_param();
+ if (acpi_mps_check()) {
+ disable_apic = 1;
+ clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
+ }
+
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
if (init_ohci1394_dma_early)
init_ohci1394_dma_on_all_controllers();
@@ -723,6 +728,10 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
cpu_devs[c->x86_vendor]->c_early_init(c);
validate_pat_support(c);
+
+ /* early_param could clear that, but recall get it set again */
+ if (disable_apic)
+ clear_cpu_cap(c, X86_FEATURE_APIC);
}
/*