Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112820
b: refs/heads/master
c: 1cd7877
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Sep 5, 2008
1 parent 97b7484 commit 8cbbcb3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 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: 140fc72709278989f08eb756d16a70008bdcc409
refs/heads/master: 1cd78776c7d5487e3000426d0ce1ff203c5d60cd
13 changes: 12 additions & 1 deletion trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_CMP_LEGACY))
goto out;

if (cpu_has(c, X86_FEATURE_XTOPOLOGY))
return;

cpuid(1, &eax, &ebx, &ecx, &edx);

smp_num_siblings = (ebx & 0xff0000) >> 16;
Expand All @@ -346,17 +349,25 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
}

index_msb = get_count_order(smp_num_siblings);
#ifdef CONFIG_X86_64
c->phys_proc_id = phys_pkg_id(index_msb);
#else
c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);

#endif

smp_num_siblings = smp_num_siblings / c->x86_max_cores;

index_msb = get_count_order(smp_num_siblings);

core_bits = get_count_order(c->x86_max_cores);

#ifdef CONFIG_X86_64
c->cpu_core_id = phys_pkg_id(index_msb) &
((1 << core_bits) - 1);
#else
c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
((1 << core_bits) - 1);
#endif
}

out:
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/cpu/common_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,25 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
}

index_msb = get_count_order(smp_num_siblings);
#ifdef CONFIG_X86_64
c->phys_proc_id = phys_pkg_id(index_msb);
#else
c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
#endif

smp_num_siblings = smp_num_siblings / c->x86_max_cores;

index_msb = get_count_order(smp_num_siblings);

core_bits = get_count_order(c->x86_max_cores);

#ifdef CONFIG_X86_64
c->cpu_core_id = phys_pkg_id(index_msb) &
((1 << core_bits) - 1);
#else
c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
((1 << core_bits) - 1);
#endif
}

out:
Expand Down

0 comments on commit 8cbbcb3

Please sign in to comment.