summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/k8topology_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-01-30 13:30:39 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:30:39 +0100
commit3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a (patch)
treede18e4699de3eb5a0f4480974833deff66f5ad47 /arch/x86/mm/k8topology_64.c
parenta860b63c41f241c685245127a3d32f352cb04c12 (diff)
downloadblackbird-op-linux-3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a.tar.gz
blackbird-op-linux-3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a.zip
x86: use core id bits for apicid_to_node initialization
We shoud use core id bits instead of max cores, in case later with AMD downcores Quad core Opteron. [ tglx: arch/x86 adaptation ] Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/k8topology_64.c')
-rw-r--r--arch/x86/mm/k8topology_64.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index a96006f7ae0c..3695c9e8b9b6 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -44,12 +44,14 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
{
unsigned long prevbase;
struct bootnode nodes[8];
- int nodeid, i, j, nb;
+ int nodeid, i, nb;
unsigned char nodeids[8];
int found = 0;
u32 reg;
unsigned numnodes;
- unsigned num_cores;
+ unsigned cores;
+ unsigned bits;
+ int j;
if (!early_pci_allowed())
return -1;
@@ -60,9 +62,6 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb);
- num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
- printk(KERN_INFO "CPU has %d num_cores\n", num_cores);
-
reg = read_pci_config(0, nb, 0, 0x60);
numnodes = ((reg >> 4) & 0xF) + 1;
if (numnodes <= 1)
@@ -168,11 +167,15 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
}
printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift);
+ /* use the coreid bits from early_identify_cpu */
+ bits = boot_cpu_data.x86_coreid_bits;
+ cores = (1<<bits);
+
for (i = 0; i < 8; i++) {
if (nodes[i].start != nodes[i].end) {
nodeid = nodeids[i];
- for (j = 0; j < num_cores; j++)
- apicid_to_node[(nodeid * num_cores) + j] = i;
+ for (j = 0; j < cores; j++)
+ apicid_to_node[(nodeid << bits) + j] = i;
setup_node_bootmem(i, nodes[i].start, nodes[i].end);
}
}
OpenPOWER on IntegriCloud