diff options
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 20 |
2 files changed, 17 insertions, 5 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 325b7bdbebaa..69e80c2ec6c2 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -110,6 +110,8 @@ struct cpuinfo_x86 { | |||
110 | u16 phys_proc_id; | 110 | u16 phys_proc_id; |
111 | /* Core id: */ | 111 | /* Core id: */ |
112 | u16 cpu_core_id; | 112 | u16 cpu_core_id; |
113 | /* Compute unit id */ | ||
114 | u8 compute_unit_id; | ||
113 | /* Index into per_cpu list: */ | 115 | /* Index into per_cpu list: */ |
114 | u16 cpu_index; | 116 | u16 cpu_index; |
115 | #endif | 117 | #endif |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 7e6a37d24253..70168ab88b7f 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -256,21 +256,29 @@ static int __cpuinit nearby_node(int apicid) | |||
256 | * Fixup core topology information for | 256 | * Fixup core topology information for |
257 | * (1) AMD multi-node processors | 257 | * (1) AMD multi-node processors |
258 | * Assumption: Number of cores in each internal node is the same. | 258 | * Assumption: Number of cores in each internal node is the same. |
259 | * (2) AMD processors supporting compute units | ||
259 | */ | 260 | */ |
260 | #ifdef CONFIG_X86_HT | 261 | #ifdef CONFIG_X86_HT |
261 | static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) | 262 | static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) |
262 | { | 263 | { |
263 | u32 nodes, cores_per_node; | 264 | u32 nodes; |
264 | u8 node_id; | 265 | u8 node_id; |
265 | unsigned long long value; | ||
266 | int cpu = smp_processor_id(); | 266 | int cpu = smp_processor_id(); |
267 | 267 | ||
268 | /* get information required for multi-node processors */ | 268 | /* get information required for multi-node processors */ |
269 | if (cpu_has(c, X86_FEATURE_TOPOEXT)) { | 269 | if (cpu_has(c, X86_FEATURE_TOPOEXT)) { |
270 | value = cpuid_ecx(0x8000001e); | 270 | u32 eax, ebx, ecx, edx; |
271 | nodes = ((value >> 8) & 7) + 1; | 271 | |
272 | node_id = value & 7; | 272 | cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); |
273 | nodes = ((ecx >> 8) & 7) + 1; | ||
274 | node_id = ecx & 7; | ||
275 | |||
276 | /* get compute unit information */ | ||
277 | smp_num_siblings = ((ebx >> 8) & 3) + 1; | ||
278 | c->compute_unit_id = ebx & 0xff; | ||
273 | } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) { | 279 | } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) { |
280 | u64 value; | ||
281 | |||
274 | rdmsrl(MSR_FAM10H_NODE_ID, value); | 282 | rdmsrl(MSR_FAM10H_NODE_ID, value); |
275 | nodes = ((value >> 3) & 7) + 1; | 283 | nodes = ((value >> 3) & 7) + 1; |
276 | node_id = value & 7; | 284 | node_id = value & 7; |
@@ -279,6 +287,8 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c) | |||
279 | 287 | ||
280 | /* fixup multi-node processor information */ | 288 | /* fixup multi-node processor information */ |
281 | if (nodes > 1) { | 289 | if (nodes > 1) { |
290 | u32 cores_per_node; | ||
291 | |||
282 | set_cpu_cap(c, X86_FEATURE_AMD_DCM); | 292 | set_cpu_cap(c, X86_FEATURE_AMD_DCM); |
283 | cores_per_node = c->x86_max_cores / nodes; | 293 | cores_per_node = c->x86_max_cores / nodes; |
284 | 294 | ||