Skip to content

Commit 08b2596

Browse files
yghannamIngo Molnar
authored andcommitted
x86/CPU/AMD: Fix Zen SMT topology
After: a33d331 ("x86/CPU/AMD: Fix Bulldozer topology") our SMT scheduling topology for Fam17h systems is broken, because the ThreadId is included in the ApicId when SMT is enabled. So, without further decoding cpu_core_id is unique for each thread rather than the same for threads on the same core. This didn't affect systems with SMT disabled. Make cpu_core_id be what it is defined to be. Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: <[email protected]> # 4.9 Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 79a8b9a commit 08b2596

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
319319
if (c->x86 == 0x15)
320320
c->cu_id = ebx & 0xff;
321321

322+
if (c->x86 >= 0x17) {
323+
c->cpu_core_id = ebx & 0xff;
324+
325+
if (smp_num_siblings > 1)
326+
c->x86_max_cores /= smp_num_siblings;
327+
}
328+
322329
/*
323330
* We may have multiple LLCs if L3 caches exist, so check if we
324331
* have an L3 cache by looking at the L3 cache CPUID leaf.

0 commit comments

Comments
 (0)