From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbcEJHfi (ORCPT ); Tue, 10 May 2016 03:35:38 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45710 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbcEJHfg (ORCPT ); Tue, 10 May 2016 03:35:36 -0400 Date: Tue, 10 May 2016 00:33:44 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: Kernel-team@fb.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, kan.liang@intel.com, jbacik@fb.com Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, Kernel-team@fb.com, tglx@linutronix.de, mingo@kernel.org, kan.liang@intel.com, jbacik@fb.com, peterz@infradead.org In-Reply-To: <761b4a2a-0332-7954-f030-c6639f949612@fb.com> References: <761b4a2a-0332-7954-f030-c6639f949612@fb.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/topology: Set x86_max_cores to 1 for CONFIG_SMP=n Git-Commit-ID: 8d415ee225a3d15d3e3029524350e8237a4de7b8 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: 8d415ee225a3d15d3e3029524350e8237a4de7b8 Gitweb: http://git.kernel.org/tip/8d415ee225a3d15d3e3029524350e8237a4de7b8 Author: Thomas Gleixner AuthorDate: Tue, 10 May 2016 09:20:33 +0200 Committer: Thomas Gleixner CommitDate: Tue, 10 May 2016 09:28:31 +0200 x86/topology: Set x86_max_cores to 1 for CONFIG_SMP=n Josef reported that the uncore driver trips over with CONFIG_SMP=n because x86_max_cores is 16 instead of 12. The reason is, that for SMP=n the extended topology detection is a NOOP and the cache leaf is used to determine the number of cores. That's wrong in two aspects: 1) The cache leaf enumerates the maximum addressable number of cores in the package, which is obviously not correct 2) UP has no business with topology bits at all. Make intel_num_cpu_cores() return 1 for CONFIG_SMP=n Reported-by: Josef Bacik Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: kernel-team Cc: Kan Liang Link: http://lkml.kernel.org/r/761b4a2a-0332-7954-f030-c6639f949612@fb.com --- arch/x86/kernel/cpu/intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 1f7fdb9..e4393bf 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -336,7 +336,7 @@ static int intel_num_cpu_cores(struct cpuinfo_x86 *c) { unsigned int eax, ebx, ecx, edx; - if (c->cpuid_level < 4) + if (!IS_ENABLED(CONFIG_SMP) || c->cpuid_level < 4) return 1; /* Intel has a non-standard dependency on %ecx for this CPUID level. */