Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112835
b: refs/heads/master
c: 2b86473
h: refs/heads/master
i:
  112833: 0a70ffb
  112831: 903181d
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Sep 8, 2008
1 parent 6960877 commit 41d48f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c58606ad551e9a1c85a9bd4f1698ca41ec279b2c
refs/heads/master: 2b86473604f6e9aef0b5e89c56798a90ccddcdbe
19 changes: 12 additions & 7 deletions trunk/arch/x86/kernel/cpu/amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_SMP
unsigned bits;
#ifdef CONFIG_NUMA
int cpu = smp_processor_id();
int node = 0;
unsigned apicid = hard_smp_processor_id();
#endif

bits = c->x86_coreid_bits;

/* Low order bits define the core id (index of core in socket) */
c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
/* Convert the initial APIC ID into the socket ID */
c->phys_proc_id = c->initial_apicid >> bits;
#endif
}

static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_NUMA
int cpu = smp_processor_id();
int node;
unsigned apicid = hard_smp_processor_id();

node = c->phys_proc_id;
if (apicid_to_node[apicid] != NUMA_NO_NODE)
node = apicid_to_node[apicid];
Expand Down Expand Up @@ -76,7 +80,6 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)

printk(KERN_INFO "CPU %d/%x -> Node %d\n", cpu, apicid, node);
#endif
#endif
}

static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c)
Expand Down Expand Up @@ -169,8 +172,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
display_cacheinfo(c);

/* Multi core CPU? */
if (c->extended_cpuid_level >= 0x80000008)
if (c->extended_cpuid_level >= 0x80000008) {
amd_detect_cmp(c);
srat_detect_node(c);
}

if (c->extended_cpuid_level >= 0x80000006) {
if ((c->x86 >= 0x0f) && (cpuid_edx(0x80000006) & 0xf000))
Expand Down

0 comments on commit 41d48f0

Please sign in to comment.