Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63d1e995 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

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: 1f12e32f ("x86/topology: Create logical package id")
Signed-off-by: default avatarPeter 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: default avatarThomas Gleixner <tglx@linutronix.de>
parent b5d5f27d
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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);

	/*