Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1551799 > unrolled thread

[PATCH] x86/CPU/AMD: Fix Bulldozer topology

Started byBorislav Petkov <bp@alien8.de>
First post2017-01-05 10:30 +0100
Last post2017-01-06 12:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/CPU/AMD: Fix Bulldozer topology Borislav Petkov <bp@alien8.de> - 2017-01-05 10:30 +0100
    [tip:x86/urgent] x86/CPU/AMD: Fix Bulldozer topology tip-bot for Borislav Petkov <tipbot@zytor.com> - 2017-01-06 12:10 +0100

#1551799 — [PATCH] x86/CPU/AMD: Fix Bulldozer topology

FromBorislav Petkov <bp@alien8.de>
Date2017-01-05 10:30 +0100
Subject[PATCH] x86/CPU/AMD: Fix Bulldozer topology
Message-ID<sWcwW-Vl-11@gated-at.bofh.it>
From: Borislav Petkov <bp@suse.de>

8196dab4fc15 ("x86/cpu: Get rid of compute_unit_id") broke the initial
strategy for Bulldozer-based cores' topology, where we consider each
thread of a compute unit a standalone core and not a HT or SMT thread.

Revert to the firmware-supplied core_id numbering and do not make
them thread siblings as we don't consider them for such even if they
technically are, more or less.

Reported-and-tested-by: Brice Goglin <Brice.Goglin@inria.fr>
Tested-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org> # v4.6..
Fixes: 8196dab4fc15 ("x86/cpu: Get rid of compute_unit_id")
---
 arch/x86/kernel/cpu/amd.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 71cae73a5076..1d3167269a67 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -309,15 +309,8 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 
 	/* get information required for multi-node processors */
 	if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
-		u32 eax, ebx, ecx, edx;
 
-		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
-		node_id = ecx & 7;
-
-		/* get compute unit information */
-		smp_num_siblings = ((ebx >> 8) & 3) + 1;
-		c->x86_max_cores /= smp_num_siblings;
-		c->cpu_core_id = ebx & 0xff;
+		node_id = cpuid_ecx(0x8000001e) & 7;
 
 		/*
 		 * We may have multiple LLCs if L3 caches exist, so check if we
-- 
2.11.0

[toc] | [next] | [standalone]


#1552690 — [tip:x86/urgent] x86/CPU/AMD: Fix Bulldozer topology

Fromtip-bot for Borislav Petkov <tipbot@zytor.com>
Date2017-01-06 12:10 +0100
Subject[tip:x86/urgent] x86/CPU/AMD: Fix Bulldozer topology
Message-ID<sWAzf-Ta-1@gated-at.bofh.it>
In reply to#1551799
Commit-ID:  a33d331761bc5dd330499ca5ceceb67f0640a8e6
Gitweb:     http://git.kernel.org/tip/a33d331761bc5dd330499ca5ceceb67f0640a8e6
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Thu, 5 Jan 2017 10:26:38 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 6 Jan 2017 08:37:41 +0100

x86/CPU/AMD: Fix Bulldozer topology

The following commit:

  8196dab4fc15 ("x86/cpu: Get rid of compute_unit_id")

... broke the initial strategy for Bulldozer-based cores' topology,
where we consider each thread of a compute unit a standalone core
and not a HT or SMT thread.

Revert to the firmware-supplied core_id numbering and do not make
them thread siblings as we don't consider them for such even if they
technically are, more or less.

Reported-and-tested-by: Brice Goglin <Brice.Goglin@inria.fr>
Tested-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org> # v4.6+
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 8196dab4fc15 ("x86/cpu: Get rid of compute_unit_id")
Link: http://lkml.kernel.org/r/20170105092638.5247-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/amd.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 71cae73..1d31672 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -309,15 +309,8 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 
 	/* get information required for multi-node processors */
 	if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
-		u32 eax, ebx, ecx, edx;
 
-		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
-		node_id = ecx & 7;
-
-		/* get compute unit information */
-		smp_num_siblings = ((ebx >> 8) & 3) + 1;
-		c->x86_max_cores /= smp_num_siblings;
-		c->cpu_core_id = ebx & 0xff;
+		node_id = cpuid_ecx(0x8000001e) & 7;
 
 		/*
 		 * We may have multiple LLCs if L3 caches exist, so check if we

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web