aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-09-12 12:49:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-12 13:49:55 -0400
commit70556463487f33bc6728a7596b97f86b811aad22 (patch)
treece49b46bd6cd2089c82b5a1cea698bf5c6cfd1cc /arch
parent5a40b7c2abdedcf53c9a6ee790991acfcef5b6c7 (diff)
[PATCH] x86-64: Use largest APIC number, not number of CPUs to decide on physflat mode
Handles case where BIOS gives CPUs very large APIC numbers correctly. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/genapic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c
index b1c144f73149..f3159a496e39 100644
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86_64/kernel/genapic.c
@@ -45,7 +45,7 @@ void __init clustered_apic_check(void)
45 u8 clusters, max_cluster; 45 u8 clusters, max_cluster;
46 u8 id; 46 u8 id;
47 u8 cluster_cnt[NUM_APIC_CLUSTERS]; 47 u8 cluster_cnt[NUM_APIC_CLUSTERS];
48 int num_cpus = 0; 48 int max_apic = 0;
49 49
50#if defined(CONFIG_ACPI) 50#if defined(CONFIG_ACPI)
51 /* 51 /*
@@ -64,7 +64,8 @@ void __init clustered_apic_check(void)
64 id = bios_cpu_apicid[i]; 64 id = bios_cpu_apicid[i];
65 if (id == BAD_APICID) 65 if (id == BAD_APICID)
66 continue; 66 continue;
67 num_cpus++; 67 if (id > max_apic)
68 max_apic = id;
68 cluster_cnt[APIC_CLUSTERID(id)]++; 69 cluster_cnt[APIC_CLUSTERID(id)]++;
69 } 70 }
70 71
@@ -79,7 +80,7 @@ void __init clustered_apic_check(void)
79 we have ACPI platform support for CPU hotplug 80 we have ACPI platform support for CPU hotplug
80 we should detect hotplug capablity from ACPI tables and 81 we should detect hotplug capablity from ACPI tables and
81 only do this when really needed. -AK */ 82 only do this when really needed. -AK */
82 if (num_cpus <= 8) 83 if (max_apic <= 8)
83 genapic = &apic_flat; 84 genapic = &apic_flat;
84#endif 85#endif
85 goto print; 86 goto print;