linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/urgent] x86/topology: Set x86_max_cores to 1 for CONFIG_SMP=n
Date: Tue, 10 May 2016 00:33:44 -0700	[thread overview]
Message-ID: <tip-8d415ee225a3d15d3e3029524350e8237a4de7b8@git.kernel.org> (raw)
In-Reply-To: <761b4a2a-0332-7954-f030-c6639f949612@fb.com>

Commit-ID:  8d415ee225a3d15d3e3029524350e8237a4de7b8
Gitweb:     http://git.kernel.org/tip/8d415ee225a3d15d3e3029524350e8237a4de7b8
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 10 May 2016 09:20:33 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
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 <jbacik@fb.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team <Kernel-team@fb.com>
Cc: Kan Liang <kan.liang@intel.com>
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. */

      parent reply	other threads:[~2016-05-10  7:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 18:39 Regression introduced by cf6d445f68974d0b15a14cf6021be38a91f2b5d8 Josef Bacik
2016-05-09 19:48 ` Thomas Gleixner
2016-05-09 20:55   ` Liang, Kan
2016-05-10  6:51   ` Peter Zijlstra
2016-05-10  7:33 ` tip-bot for Thomas Gleixner [this message]

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=tip-8d415ee225a3d15d3e3029524350e8237a4de7b8@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=Kernel-team@fb.com \
    --cc=hpa@zytor.com \
    --cc=jbacik@fb.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).