Commit 70556463 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[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: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5a40b7c2
...@@ -45,7 +45,7 @@ void __init clustered_apic_check(void) ...@@ -45,7 +45,7 @@ void __init clustered_apic_check(void)
u8 clusters, max_cluster; u8 clusters, max_cluster;
u8 id; u8 id;
u8 cluster_cnt[NUM_APIC_CLUSTERS]; u8 cluster_cnt[NUM_APIC_CLUSTERS];
int num_cpus = 0; int max_apic = 0;
#if defined(CONFIG_ACPI) #if defined(CONFIG_ACPI)
/* /*
...@@ -64,7 +64,8 @@ void __init clustered_apic_check(void) ...@@ -64,7 +64,8 @@ void __init clustered_apic_check(void)
id = bios_cpu_apicid[i]; id = bios_cpu_apicid[i];
if (id == BAD_APICID) if (id == BAD_APICID)
continue; continue;
num_cpus++; if (id > max_apic)
max_apic = id;
cluster_cnt[APIC_CLUSTERID(id)]++; cluster_cnt[APIC_CLUSTERID(id)]++;
} }
...@@ -79,7 +80,7 @@ void __init clustered_apic_check(void) ...@@ -79,7 +80,7 @@ void __init clustered_apic_check(void)
we have ACPI platform support for CPU hotplug we have ACPI platform support for CPU hotplug
we should detect hotplug capablity from ACPI tables and we should detect hotplug capablity from ACPI tables and
only do this when really needed. -AK */ only do this when really needed. -AK */
if (num_cpus <= 8) if (max_apic <= 8)
genapic = &apic_flat; genapic = &apic_flat;
#endif #endif
goto print; goto print;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment