diff options
-rw-r--r-- | arch/x86/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 12 |
4 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 1be64da0384e..e6cfe7ba2d65 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -104,6 +104,7 @@ struct cpuinfo_x86 { | |||
104 | __u8 x86_phys_bits; | 104 | __u8 x86_phys_bits; |
105 | /* CPUID returned core id bits: */ | 105 | /* CPUID returned core id bits: */ |
106 | __u8 x86_coreid_bits; | 106 | __u8 x86_coreid_bits; |
107 | __u8 cu_id; | ||
107 | /* Max extended CPUID function supported: */ | 108 | /* Max extended CPUID function supported: */ |
108 | __u32 extended_cpuid_level; | 109 | __u32 extended_cpuid_level; |
109 | /* Maximum supported CPUID level, -1=no CPUID: */ | 110 | /* Maximum supported CPUID level, -1=no CPUID: */ |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 1d3167269a67..20dc44d1e6be 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -309,8 +309,15 @@ static void amd_get_topology(struct cpuinfo_x86 *c) | |||
309 | 309 | ||
310 | /* get information required for multi-node processors */ | 310 | /* get information required for multi-node processors */ |
311 | if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { | 311 | if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { |
312 | u32 eax, ebx, ecx, edx; | ||
312 | 313 | ||
313 | node_id = cpuid_ecx(0x8000001e) & 7; | 314 | cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); |
315 | |||
316 | node_id = ecx & 0xff; | ||
317 | smp_num_siblings = ((ebx >> 8) & 0xff) + 1; | ||
318 | |||
319 | if (c->x86 == 0x15) | ||
320 | c->cu_id = ebx & 0xff; | ||
314 | 321 | ||
315 | /* | 322 | /* |
316 | * We may have multiple LLCs if L3 caches exist, so check if we | 323 | * We may have multiple LLCs if L3 caches exist, so check if we |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 9bab7a8a4293..ede03e849a8b 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -1015,6 +1015,7 @@ static void identify_cpu(struct cpuinfo_x86 *c) | |||
1015 | c->x86_model_id[0] = '\0'; /* Unset */ | 1015 | c->x86_model_id[0] = '\0'; /* Unset */ |
1016 | c->x86_max_cores = 1; | 1016 | c->x86_max_cores = 1; |
1017 | c->x86_coreid_bits = 0; | 1017 | c->x86_coreid_bits = 0; |
1018 | c->cu_id = 0xff; | ||
1018 | #ifdef CONFIG_X86_64 | 1019 | #ifdef CONFIG_X86_64 |
1019 | c->x86_clflush_size = 64; | 1020 | c->x86_clflush_size = 64; |
1020 | c->x86_phys_bits = 36; | 1021 | c->x86_phys_bits = 36; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 46732dc3b73c..99b920d0e516 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -433,9 +433,15 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | |||
433 | int cpu1 = c->cpu_index, cpu2 = o->cpu_index; | 433 | int cpu1 = c->cpu_index, cpu2 = o->cpu_index; |
434 | 434 | ||
435 | if (c->phys_proc_id == o->phys_proc_id && | 435 | if (c->phys_proc_id == o->phys_proc_id && |
436 | per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) && | 436 | per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2)) { |
437 | c->cpu_core_id == o->cpu_core_id) | 437 | if (c->cpu_core_id == o->cpu_core_id) |
438 | return topology_sane(c, o, "smt"); | 438 | return topology_sane(c, o, "smt"); |
439 | |||
440 | if ((c->cu_id != 0xff) && | ||
441 | (o->cu_id != 0xff) && | ||
442 | (c->cu_id == o->cu_id)) | ||
443 | return topology_sane(c, o, "smt"); | ||
444 | } | ||
439 | 445 | ||
440 | } else if (c->phys_proc_id == o->phys_proc_id && | 446 | } else if (c->phys_proc_id == o->phys_proc_id && |
441 | c->cpu_core_id == o->cpu_core_id) { | 447 | c->cpu_core_id == o->cpu_core_id) { |