diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-05-02 13:27:04 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:04 -0400 |
commit | 3c43f03908de98fa8f7a9e8fc9411ebf4c2de298 (patch) | |
tree | 3e2c78fc91f29dfdfd29970e70982f0386863d17 /arch | |
parent | 424df390101f9dfe015f0633aaec696c159b37a8 (diff) |
[PATCH] x86: default to physical mode on hotplug CPU kernels
Default to physical mode on hotplug CPU kernels. Furher simplify and clean up
the APIC initialization code.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/mpparse.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/genapic.c | 16 | ||||
-rw-r--r-- | arch/x86_64/kernel/mpparse.c | 2 |
4 files changed, 6 insertions, 16 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 9ea5b8ecc7e1..280898b045b2 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -874,7 +874,7 @@ static void __init acpi_process_madt(void) | |||
874 | acpi_ioapic = 1; | 874 | acpi_ioapic = 1; |
875 | 875 | ||
876 | smp_found_config = 1; | 876 | smp_found_config = 1; |
877 | clustered_apic_check(); | 877 | setup_apic_routing(); |
878 | } | 878 | } |
879 | } | 879 | } |
880 | if (error == -EINVAL) { | 880 | if (error == -EINVAL) { |
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 4f5983c98669..0952eccd8f28 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c | |||
@@ -477,7 +477,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) | |||
477 | } | 477 | } |
478 | ++mpc_record; | 478 | ++mpc_record; |
479 | } | 479 | } |
480 | clustered_apic_check(); | 480 | setup_apic_routing(); |
481 | if (!num_processors) | 481 | if (!num_processors) |
482 | printk(KERN_ERR "SMP mptable: no processors registered!\n"); | 482 | printk(KERN_ERR "SMP mptable: no processors registered!\n"); |
483 | return num_processors; | 483 | return num_processors; |
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c index 025f26ebb8d7..c08650a427e2 100644 --- a/arch/x86_64/kernel/genapic.c +++ b/arch/x86_64/kernel/genapic.c | |||
@@ -35,11 +35,8 @@ struct genapic __read_mostly *genapic = &apic_flat; | |||
35 | /* | 35 | /* |
36 | * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. | 36 | * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. |
37 | */ | 37 | */ |
38 | void __init clustered_apic_check(void) | 38 | void __init setup_apic_routing(void) |
39 | { | 39 | { |
40 | unsigned int i, max_apic = 0; | ||
41 | u8 id; | ||
42 | |||
43 | #ifdef CONFIG_ACPI | 40 | #ifdef CONFIG_ACPI |
44 | /* | 41 | /* |
45 | * Quirk: some x86_64 machines can only use physical APIC mode | 42 | * Quirk: some x86_64 machines can only use physical APIC mode |
@@ -49,17 +46,10 @@ void __init clustered_apic_check(void) | |||
49 | if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && | 46 | if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && |
50 | (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) | 47 | (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) |
51 | genapic = &apic_physflat; | 48 | genapic = &apic_physflat; |
49 | else | ||
52 | #endif | 50 | #endif |
53 | 51 | ||
54 | for (i = 0; i < NR_CPUS; i++) { | 52 | if (cpus_weight(cpu_possible_map) <= 8) |
55 | id = bios_cpu_apicid[i]; | ||
56 | if (id == BAD_APICID) | ||
57 | continue; | ||
58 | if (id > max_apic) | ||
59 | max_apic = id; | ||
60 | } | ||
61 | |||
62 | if (max_apic < 8) | ||
63 | genapic = &apic_flat; | 53 | genapic = &apic_flat; |
64 | else | 54 | else |
65 | genapic = &apic_physflat; | 55 | genapic = &apic_physflat; |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 455aa0b932f0..d0dc4891599b 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -300,7 +300,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) | |||
300 | } | 300 | } |
301 | } | 301 | } |
302 | } | 302 | } |
303 | clustered_apic_check(); | 303 | setup_apic_routing(); |
304 | if (!num_processors) | 304 | if (!num_processors) |
305 | printk(KERN_ERR "MPTABLE: no processors registered!\n"); | 305 | printk(KERN_ERR "MPTABLE: no processors registered!\n"); |
306 | return num_processors; | 306 | return num_processors; |