Commit fee0aede authored by Thomas Gleixner's avatar Thomas Gleixner

cpu/hotplug: Set CPU_SMT_NOT_SUPPORTED early

The CPU_SMT_NOT_SUPPORTED state is set (if the processor does not support
SMT) when the sysfs SMT control file is initialized.

That was fine so far as this was only required to make the output of the
control file correct and to prevent writes in that case.

With the upcoming l1tf command line parameter, this needs to be set up
before the L1TF mitigation selection and command line parsing happens.
Signed-off-by: default avatarThomas Gleixner <>
Tested-by: default avatarJiri Kosina <>
Reviewed-by: default avatarGreg Kroah-Hartman <>
Reviewed-by: default avatarJosh Poimboeuf <>
parent 8e1b706b
......@@ -58,6 +58,12 @@ void __init check_bugs(void)
* identify_boot_cpu() initialized SMT support information, let the
* core code know.
pr_info("CPU: ");
......@@ -178,9 +178,11 @@ enum cpuhp_smt_control {
#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
extern enum cpuhp_smt_control cpu_smt_control;
extern void cpu_smt_disable(bool force);
extern void cpu_smt_check_topology(void);
# define cpu_smt_control (CPU_SMT_ENABLED)
static inline void cpu_smt_disable(bool force) { }
static inline void cpu_smt_check_topology(void) { }
#endif /* _LINUX_CPU_H_ */
......@@ -361,6 +361,16 @@ void __init cpu_smt_disable(bool force)
* The decision whether SMT is supported can only be done after the full
* CPU identification. Called from architecture code.
void __init cpu_smt_check_topology(void)
if (!topology_smt_supported())
cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
static int __init smt_cmdline_disable(char *str)
cpu_smt_disable(str && !strcmp(str, "force"));
......@@ -2115,9 +2125,6 @@ static const struct attribute_group cpuhp_smt_attr_group = {
static int __init cpu_smt_state_init(void)
if (!topology_smt_supported())
cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
return sysfs_create_group(&cpu_subsys.dev_root->kobj,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment