Commit 27e97ffc authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Fix bugs in the AMD K8 CMP support code.

Fix bugs in the AMD K8 CMP support code.

Check the correct cpuid level and move numa_add_cpu to the correct place.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1204d947
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/mach_apic.h> #include <asm/mach_apic.h>
#include <asm/numa.h>
/* /*
* Machine setup.. * Machine setup..
...@@ -688,7 +689,7 @@ static int __init init_amd(struct cpuinfo_x86 *c) ...@@ -688,7 +689,7 @@ static int __init init_amd(struct cpuinfo_x86 *c)
} }
display_cacheinfo(c); display_cacheinfo(c);
if (c->cpuid_level >= 0x80000008) { if (cpuid_eax(0x80000000) >= 0x80000008) {
c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
if (c->x86_num_cores & (c->x86_num_cores - 1)) if (c->x86_num_cores & (c->x86_num_cores - 1))
c->x86_num_cores = 1; c->x86_num_cores = 1;
...@@ -915,6 +916,9 @@ void __init identify_cpu(struct cpuinfo_x86 *c) ...@@ -915,6 +916,9 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
#ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_MCE
mcheck_init(c); mcheck_init(c);
#endif #endif
#ifdef CONFIG_NUMA
numa_add_cpu(c - cpu_data);
#endif
} }
......
...@@ -274,8 +274,4 @@ void __init cpu_init (void) ...@@ -274,8 +274,4 @@ void __init cpu_init (void)
set_debug(0UL, 7); set_debug(0UL, 7);
fpu_init(); fpu_init();
#ifdef CONFIG_NUMA
numa_add_cpu(cpu);
#endif
} }
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