From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940023AbdAFLBr (ORCPT ); Fri, 6 Jan 2017 06:01:47 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55398 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939984AbdAFLBJ (ORCPT ); Fri, 6 Jan 2017 06:01:09 -0500 Date: Fri, 6 Jan 2017 02:59:56 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: Brice.Goglin@inria.fr, bp@alien8.de, linux-kernel@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com, mingo@kernel.org, bp@suse.de, luto@kernel.org, hpa@zytor.com, brgerst@gmail.com, tglx@linutronix.de, torvalds@linux-foundation.org, dvlasenk@redhat.com, yazen.ghannam@amd.com Reply-To: brgerst@gmail.com, hpa@zytor.com, dvlasenk@redhat.com, yazen.ghannam@amd.com, torvalds@linux-foundation.org, tglx@linutronix.de, bp@suse.de, luto@kernel.org, mingo@kernel.org, Brice.Goglin@inria.fr, bp@alien8.de, jpoimboe@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <20170105092638.5247-1-bp@alien8.de> References: <20170105092638.5247-1-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/CPU/AMD: Fix Bulldozer topology Git-Commit-ID: a33d331761bc5dd330499ca5ceceb67f0640a8e6 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a33d331761bc5dd330499ca5ceceb67f0640a8e6 Gitweb: http://git.kernel.org/tip/a33d331761bc5dd330499ca5ceceb67f0640a8e6 Author: Borislav Petkov AuthorDate: Thu, 5 Jan 2017 10:26:38 +0100 Committer: Ingo Molnar 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 Tested-by: Yazen Ghannam Signed-off-by: Borislav Petkov Cc: # v4.6+ Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner 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 --- 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