aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-03-06 16:46:39 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:58 -0400
commit01aaea1afbcdb7c49fe4a567ebe3e295db9f720d (patch)
tree21974b32aad2b004d2ac67bf5ee7d8812d0d30cd /arch/x86/kernel/setup_64.c
parent459cce726730ca0ac93701e53aa1d0d055ce9e90 (diff)
x86: introduce initial apicid
store initial_apicid from early identify. it is could be different from phys_proc_id later. also print it out in /proc/cpuinfo. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup_64.c')
-rw-r--r--arch/x86/kernel/setup_64.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index f303c70dd688..13fe525bf065 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -562,9 +562,9 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
562 bits = c->x86_coreid_bits; 562 bits = c->x86_coreid_bits;
563 563
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->initial_apicid & ((1 << bits)-1);
566 /* Convert the APIC ID into the socket ID */ 566 /* Convert the initial APIC ID into the socket ID */
567 c->phys_proc_id = (c->apicid - boot_cpu_id) >> bits; 567 c->phys_proc_id = c->initial_apicid >> 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 - boot_cpu_id; 584 int ht_nodeid = c->initial_apicid;
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)
@@ -936,8 +936,9 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
936 c->x86 = 4; 936 c->x86 = 4;
937 } 937 }
938 938
939 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xff;
939#ifdef CONFIG_SMP 940#ifdef CONFIG_SMP
940 c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff; 941 c->phys_proc_id = c->initial_apicid;
941#endif 942#endif
942 /* AMD-defined flags: level 0x80000001 */ 943 /* AMD-defined flags: level 0x80000001 */
943 xlvl = cpuid_eax(0x80000000); 944 xlvl = cpuid_eax(0x80000000);