diff mbox

[1/2,Xenial,SRU] x86/topology: Fix Intel HT disable

Message ID 1460648481-1262-1-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner April 14, 2016, 3:41 p.m. UTC
From: Peter Zijlstra <peterz@infradead.org>

BugLink: http://bugs.launchpad.net/bugs/1570441

As per the comment in the code; due to BIOS it is sometimes impossible to know
if there actually are smp siblings until the machine is fully enumerated. So
we rather overestimate the number of possible packages.

Fixes: 1f12e32f4cd5 ("x86/topology: Create logical package id")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: aherrmann@suse.com
Cc: jencce.kernel@gmail.com
Cc: bp@alien8.de
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Link: http://lkml.kernel.org/r/20160318150538.611014173@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

(cherry picked from commit 63d1e995be455ae9196270eb4b789de21afd42ed)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 arch/x86/kernel/smpboot.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Kamal Mostafa April 14, 2016, 3:51 p.m. UTC | #1
Ack this two-patch set: LP# 1570441 appears to be the same bug as reported,
fixed, and tested upstream;  Simple patches; clean cherry-picks.

Acked-by: Kamal Mostafa <kamal@canonical.com>
Tim Gardner April 14, 2016, 3:58 p.m. UTC | #2

diff mbox

Patch

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9be1a0c..5c08158 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -317,8 +317,21 @@  static void __init smp_init_package_map(void)
 	/*
 	 * Today neither Intel nor AMD support heterogenous systems. That
 	 * might change in the future....
+	 *
+	 * While ideally we'd want '* smp_num_siblings' in the below @ncpus
+	 * computation, this won't actually work since some Intel BIOSes
+	 * report inconsistent HT data when they disable HT.
+	 *
+	 * In particular, they reduce the APIC-IDs to only include the cores,
+	 * but leave the CPUID topology to say there are (2) siblings.
+	 * This means we don't know how many threads there will be until
+	 * after the APIC enumeration.
+	 *
+	 * By not including this we'll sometimes over-estimate the number of
+	 * logical packages by the amount of !present siblings, but this is
+	 * still better than MAX_LOCAL_APIC.
 	 */
-	ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings;
+	ncpus = boot_cpu_data.x86_max_cores;
 	__max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus);
 
 	/*