diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-10 11:41:05 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-10 11:41:05 -0700 |
commit | 7ec02e3bf45e0e7502db7f8d50c19abc1ebbab00 (patch) | |
tree | 1f0a24b433f0a4d096d1b87e56e682a873c8dab1 /arch | |
parent | ac2440654df6ac7314e2f8819fe05e7c863a2392 (diff) | |
parent | 8d415ee225a3d15d3e3029524350e8237a4de7b8 (diff) | |
download | linux-stable-7ec02e3bf45e0e7502db7f8d50c19abc1ebbab00.tar.gz linux-stable-7ec02e3bf45e0e7502db7f8d50c19abc1ebbab00.tar.bz2 linux-stable-7ec02e3bf45e0e7502db7f8d50c19abc1ebbab00.zip |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
"Two topology corner case fixes, and a MAINTAINERS file update for
mmiotrace maintenance"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/topology: Set x86_max_cores to 1 for CONFIG_SMP=n
MAINTAINERS: Add mmiotrace entry
x86/topology: Handle CPUID bogosity gracefully
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 1f7fdb91a818..e4393bfc7f0d 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. */ diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a2065d3b3b39..0e4329ed91ef 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -332,6 +332,11 @@ static void __init smp_init_package_map(void) * primary cores. */ ncpus = boot_cpu_data.x86_max_cores; + if (!ncpus) { + pr_warn("x86_max_cores == zero !?!?"); + ncpus = 1; + } + __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus); /* |