aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2016-03-18 16:03:48 +0100
committerThomas Gleixner <[email protected]>2016-03-19 10:26:40 +0100
commit63d1e995be455ae9196270eb4b789de21afd42ed (patch)
tree209f75e65c7d6959b590e146bc9bde88e05c5aa4
parentb5d5f27d938fb6fc8d3202704e699d2694a02da6 (diff)
x86/topology: Fix Intel HT disable
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) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Mike Galbraith <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
-rw-r--r--arch/x86/kernel/smpboot.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 64b669dcbf23..81e6a432f23c 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -312,8 +312,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);
/*