From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: Brice Goglin <Brice.Goglin@inria.fr>,
Yazen Ghannam <yazen.ghannam@amd.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86/CPU/AMD: Fix Bulldozer topology
Date: Thu, 5 Jan 2017 10:26:38 +0100 [thread overview]
Message-ID: <20170105092638.5247-1-bp@alien8.de> (raw)
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
next reply other threads:[~2017-01-05 9:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 9:26 Borislav Petkov [this message]
2017-01-06 10:59 ` [tip:x86/urgent] " tip-bot for Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170105092638.5247-1-bp@alien8.de \
--to=bp@alien8.de \
--cc=Brice.Goglin@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome