cpu/hotplug: detect SMT disabled by BIOS
authorJosh Poimboeuf <[email protected]>
Tue, 24 Jul 2018 16:17:40 +0000 (18:17 +0200)
committerPeter Zijlstra <[email protected]>
Tue, 24 Jul 2018 16:17:40 +0000 (18:17 +0200)
commit73d5e2b472640b1fcdb61ae8be389912ef211bda
treea0b859dfb525e4a89dc068194177108d5745f46d
parent1949f9f49792d65dba2090edddbe36a5f02e3ba3
cpu/hotplug: detect SMT disabled by BIOS

If SMT is disabled in BIOS, the CPU code doesn't properly detect it.
The /sys/devices/system/cpu/smt/control file shows 'on', and the 'l1tf'
vulnerabilities file shows SMT as vulnerable.

Fix it by forcing 'cpu_smt_control' to CPU_SMT_NOT_SUPPORTED in such a
case.  Unfortunately the detection can only be done after bringing all
the CPUs online, so we have to overwrite any previous writes to the
variable.

Reported-by: Joe Mario <[email protected]>
Tested-by: Jiri Kosina <[email protected]>
Fixes: f048c399e0f7 ("x86/topology: Provide topology_smt_supported()")
Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
kernel/cpu.c