aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3c7f3b4c453c..91d5c38eb7e5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -10,6 +10,7 @@
10#include <linux/sched/signal.h> 10#include <linux/sched/signal.h>
11#include <linux/sched/hotplug.h> 11#include <linux/sched/hotplug.h>
12#include <linux/sched/task.h> 12#include <linux/sched/task.h>
13#include <linux/sched/smt.h>
13#include <linux/unistd.h> 14#include <linux/unistd.h>
14#include <linux/cpu.h> 15#include <linux/cpu.h>
15#include <linux/oom.h> 16#include <linux/oom.h>
@@ -367,6 +368,12 @@ static void lockdep_release_cpus_lock(void)
367 368
368#endif /* CONFIG_HOTPLUG_CPU */ 369#endif /* CONFIG_HOTPLUG_CPU */
369 370
371/*
372 * Architectures that need SMT-specific errata handling during SMT hotplug
373 * should override this.
374 */
375void __weak arch_smt_update(void) { }
376
370#ifdef CONFIG_HOTPLUG_SMT 377#ifdef CONFIG_HOTPLUG_SMT
371enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED; 378enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
372EXPORT_SYMBOL_GPL(cpu_smt_control); 379EXPORT_SYMBOL_GPL(cpu_smt_control);
@@ -1011,6 +1018,7 @@ out:
1011 * concurrent CPU hotplug via cpu_add_remove_lock. 1018 * concurrent CPU hotplug via cpu_add_remove_lock.
1012 */ 1019 */
1013 lockup_detector_cleanup(); 1020 lockup_detector_cleanup();
1021 arch_smt_update();
1014 return ret; 1022 return ret;
1015} 1023}
1016 1024
@@ -1139,6 +1147,7 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
1139 ret = cpuhp_up_callbacks(cpu, st, target); 1147 ret = cpuhp_up_callbacks(cpu, st, target);
1140out: 1148out:
1141 cpus_write_unlock(); 1149 cpus_write_unlock();
1150 arch_smt_update();
1142 return ret; 1151 return ret;
1143} 1152}
1144 1153
@@ -2055,12 +2064,6 @@ static void cpuhp_online_cpu_device(unsigned int cpu)
2055 kobject_uevent(&dev->kobj, KOBJ_ONLINE); 2064 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
2056} 2065}
2057 2066
2058/*
2059 * Architectures that need SMT-specific errata handling during SMT hotplug
2060 * should override this.
2061 */
2062void __weak arch_smt_update(void) { };
2063
2064static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) 2067static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
2065{ 2068{
2066 int cpu, ret = 0; 2069 int cpu, ret = 0;