From 002c85b08ffa7b03493ac111dde232f60d49c43b Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Wed, 30 Jan 2008 13:30:39 +0100 Subject: [PATCH] --- yaml --- r: 79827 b: refs/heads/master c: 3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a h: refs/heads/master i: 79825: 307434ce12c8217aca063f68eeca3abf104ec8ed 79823: 113233cd9fd91d3236aa43d06fdd4849547dff8b v: v3 --- [refs] | 2 +- trunk/arch/x86/mm/k8topology_64.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 949d749ec189..2694fb1ff135 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a860b63c41f241c685245127a3d32f352cb04c12 +refs/heads/master: 3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a diff --git a/trunk/arch/x86/mm/k8topology_64.c b/trunk/arch/x86/mm/k8topology_64.c index a96006f7ae0c..3695c9e8b9b6 100644 --- a/trunk/arch/x86/mm/k8topology_64.c +++ b/trunk/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<