diff options
| author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-20 19:11:20 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:48:31 -0400 |
| commit | 3c999f142665265afd0fe9190204dd051f17e505 (patch) | |
| tree | 83b764c2a90890c22b199d6445cf2e132babe455 | |
| parent | 88a6846c70ad6bf33a545d554ace801d69e8a1a5 (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>
| -rw-r--r-- | arch/x86/kernel/acpi/boot.c | 14 | ||||
| -rw-r--r-- | arch/x86/kernel/apic_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/setup_32.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/setup_64.c | 9 | ||||
| -rw-r--r-- | include/asm-x86/apic.h | 6 | ||||
| -rw-r--r-- | include/linux/acpi.h | 6 |
7 files changed, 44 insertions, 2 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) | |||
| 1787 | } | 1787 | } |
| 1788 | early_param("pci", parse_pci); | 1788 | early_param("pci", parse_pci); |
| 1789 | 1789 | ||
| 1790 | int __init acpi_mps_check(void) | ||
| 1791 | { | ||
| 1792 | #if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_MPPARSE) | ||
| 1793 | /* mptable code is not built-in*/ | ||
| 1794 | if (acpi_disabled || acpi_noirq) { | ||
| 1795 | printk(KERN_WARNING "MPS support code is not built-in.\n" | ||
| 1796 | "Using acpi=off or acpi=noirq or pci=noacpi " | ||
| 1797 | "may have problem\n"); | ||
| 1798 | return 1; | ||
| 1799 | } | ||
| 1800 | #endif | ||
| 1801 | return 0; | ||
| 1802 | } | ||
| 1803 | |||
| 1790 | #ifdef CONFIG_X86_IO_APIC | 1804 | #ifdef CONFIG_X86_IO_APIC |
| 1791 | static int __init parse_acpi_skip_timer_override(char *arg) | 1805 | static int __init parse_acpi_skip_timer_override(char *arg) |
| 1792 | { | 1806 | { |
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; | |||
| 57 | * | 57 | * |
| 58 | * -1=force-disable, +1=force-enable | 58 | * -1=force-disable, +1=force-enable |
| 59 | */ | 59 | */ |
| 60 | static int enable_local_apic __initdata; | 60 | int enable_local_apic; |
| 61 | 61 | ||
| 62 | /* Local APIC timer verification ok */ | 62 | /* Local APIC timer verification ok */ |
| 63 | static int local_apic_timer_verify_ok; | 63 | 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) | |||
| 161 | char *ptr; | 161 | char *ptr; |
| 162 | int cpu; | 162 | int cpu; |
| 163 | 163 | ||
| 164 | /* no processor from mptable or madt */ | ||
| 165 | if (!num_processors) | ||
| 166 | num_processors = 1; | ||
| 167 | |||
| 164 | #ifdef CONFIG_HOTPLUG_CPU | 168 | #ifdef CONFIG_HOTPLUG_CPU |
| 165 | prefill_possible_map(); | 169 | prefill_possible_map(); |
| 166 | #else | 170 | #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) | |||
| 677 | 677 | ||
| 678 | parse_early_param(); | 678 | parse_early_param(); |
| 679 | 679 | ||
| 680 | if (acpi_mps_check()){ | ||
| 681 | enable_local_apic = -1; | ||
| 682 | clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC); | ||
| 683 | } | ||
| 684 | |||
| 680 | finish_e820_parsing(); | 685 | finish_e820_parsing(); |
| 681 | 686 | ||
| 682 | probe_roms(); | 687 | 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) | |||
| 302 | 302 | ||
| 303 | parse_early_param(); | 303 | parse_early_param(); |
| 304 | 304 | ||
| 305 | if (acpi_mps_check()) { | ||
| 306 | disable_apic = 1; | ||
| 307 | clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC); | ||
| 308 | } | ||
| 309 | |||
| 305 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT | 310 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT |
| 306 | if (init_ohci1394_dma_early) | 311 | if (init_ohci1394_dma_early) |
| 307 | init_ohci1394_dma_on_all_controllers(); | 312 | init_ohci1394_dma_on_all_controllers(); |
| @@ -723,6 +728,10 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) | |||
| 723 | cpu_devs[c->x86_vendor]->c_early_init(c); | 728 | cpu_devs[c->x86_vendor]->c_early_init(c); |
| 724 | 729 | ||
| 725 | validate_pat_support(c); | 730 | validate_pat_support(c); |
| 731 | |||
| 732 | /* early_param could clear that, but recall get it set again */ | ||
| 733 | if (disable_apic) | ||
| 734 | clear_cpu_cap(c, X86_FEATURE_APIC); | ||
| 726 | } | 735 | } |
| 727 | 736 | ||
| 728 | /* | 737 | /* |
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index 313bcaf4b6c3..9fe941cd843d 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
| @@ -39,8 +39,12 @@ extern int apic_verbosity; | |||
| 39 | extern int local_apic_timer_c2_ok; | 39 | extern int local_apic_timer_c2_ok; |
| 40 | 40 | ||
| 41 | extern int ioapic_force; | 41 | extern int ioapic_force; |
| 42 | extern int disable_apic; | ||
| 43 | 42 | ||
| 43 | #ifdef CONFIG_X86_64 | ||
| 44 | extern int disable_apic; | ||
| 45 | #else | ||
| 46 | extern int enable_local_apic; | ||
| 47 | #endif | ||
| 44 | /* | 48 | /* |
| 45 | * Basic functions accessing APICs. | 49 | * Basic functions accessing APICs. |
| 46 | */ | 50 | */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 41f7ce7edd7a..0601075d09a1 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -82,6 +82,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | |||
| 82 | int early_acpi_boot_init(void); | 82 | int early_acpi_boot_init(void); |
| 83 | int acpi_boot_init (void); | 83 | int acpi_boot_init (void); |
| 84 | int acpi_boot_table_init (void); | 84 | int acpi_boot_table_init (void); |
| 85 | int acpi_mps_check (void); | ||
| 85 | int acpi_numa_init (void); | 86 | int acpi_numa_init (void); |
| 86 | 87 | ||
| 87 | int acpi_table_init (void); | 88 | int acpi_table_init (void); |
| @@ -250,6 +251,11 @@ static inline int acpi_boot_table_init(void) | |||
| 250 | return 0; | 251 | return 0; |
| 251 | } | 252 | } |
| 252 | 253 | ||
| 254 | static inline int acpi_mps_check(void) | ||
| 255 | { | ||
| 256 | return 0; | ||
| 257 | } | ||
| 258 | |||
| 253 | static inline int acpi_check_resource_conflict(struct resource *res) | 259 | static inline int acpi_check_resource_conflict(struct resource *res) |
| 254 | { | 260 | { |
| 255 | return 0; | 261 | return 0; |
