diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-03-06 04:11:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:40:57 -0400 |
commit | a7062211865efb53cda253d6e33a106f0fe20ebe (patch) | |
tree | ad3384e1304ebe8de4e5caa2fee20fb843d8ff61 /arch | |
parent | 97b44ae6cd8117212d41bedc433b5571ee3b79d9 (diff) |
x86: fix amd_detect_cmp
for system with apicid lifting, boot cpu apicid will be 4
got:
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU 0/4 -> Node 0
CPU: Physical Processor ID: 1
CPU: Processor Core ID: 0
so try to offset apicid back before get phys_proc_id with bits shift.
then we can get correct socket ID
also remove remove cpu_data(0) reference.
because cpu_data(0) only be ready after smp_prepare_cpus with the assignment
from boot_cpu_data to current_cpu_data aka cpu_data(0).
and check_bugs()==>identify_cpu(&boot_cpu_data) is quite before than
smp_prepare_cpus. So just use boot_cpu_id instead.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup_64.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index d65b73e63384..f303c70dd688 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -564,7 +564,7 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c) | |||
564 | /* Low order bits define the core id (index of core in socket) */ | 564 | /* Low order bits define the core id (index of core in socket) */ |
565 | c->cpu_core_id = c->phys_proc_id & ((1 << bits)-1); | 565 | c->cpu_core_id = c->phys_proc_id & ((1 << bits)-1); |
566 | /* Convert the APIC ID into the socket ID */ | 566 | /* Convert the APIC ID into the socket ID */ |
567 | c->phys_proc_id = phys_pkg_id(bits); | 567 | c->phys_proc_id = (c->apicid - boot_cpu_id) >> bits; |
568 | 568 | ||
569 | #ifdef CONFIG_NUMA | 569 | #ifdef CONFIG_NUMA |
570 | node = c->phys_proc_id; | 570 | node = c->phys_proc_id; |
@@ -581,7 +581,7 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c) | |||
581 | If that doesn't result in a usable node fall back to the | 581 | If that doesn't result in a usable node fall back to the |
582 | path for the previous case. */ | 582 | path for the previous case. */ |
583 | 583 | ||
584 | int ht_nodeid = apicid - (cpu_data(0).phys_proc_id << bits); | 584 | int ht_nodeid = apicid - boot_cpu_id; |
585 | 585 | ||
586 | if (ht_nodeid >= 0 && | 586 | if (ht_nodeid >= 0 && |
587 | apicid_to_node[ht_nodeid] != NUMA_NO_NODE) | 587 | apicid_to_node[ht_nodeid] != NUMA_NO_NODE) |