aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r--include/linux/cpu.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 3233fbe23594..218df7f4d3e1 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -55,6 +55,8 @@ extern ssize_t cpu_show_spectre_v2(struct device *dev,
55 struct device_attribute *attr, char *buf); 55 struct device_attribute *attr, char *buf);
56extern ssize_t cpu_show_spec_store_bypass(struct device *dev, 56extern ssize_t cpu_show_spec_store_bypass(struct device *dev,
57 struct device_attribute *attr, char *buf); 57 struct device_attribute *attr, char *buf);
58extern ssize_t cpu_show_l1tf(struct device *dev,
59 struct device_attribute *attr, char *buf);
58 60
59extern __printf(4, 5) 61extern __printf(4, 5)
60struct device *cpu_device_create(struct device *parent, void *drvdata, 62struct device *cpu_device_create(struct device *parent, void *drvdata,
@@ -103,6 +105,7 @@ extern void cpus_write_lock(void);
103extern void cpus_write_unlock(void); 105extern void cpus_write_unlock(void);
104extern void cpus_read_lock(void); 106extern void cpus_read_lock(void);
105extern void cpus_read_unlock(void); 107extern void cpus_read_unlock(void);
108extern int cpus_read_trylock(void);
106extern void lockdep_assert_cpus_held(void); 109extern void lockdep_assert_cpus_held(void);
107extern void cpu_hotplug_disable(void); 110extern void cpu_hotplug_disable(void);
108extern void cpu_hotplug_enable(void); 111extern void cpu_hotplug_enable(void);
@@ -115,6 +118,7 @@ static inline void cpus_write_lock(void) { }
115static inline void cpus_write_unlock(void) { } 118static inline void cpus_write_unlock(void) { }
116static inline void cpus_read_lock(void) { } 119static inline void cpus_read_lock(void) { }
117static inline void cpus_read_unlock(void) { } 120static inline void cpus_read_unlock(void) { }
121static inline int cpus_read_trylock(void) { return true; }
118static inline void lockdep_assert_cpus_held(void) { } 122static inline void lockdep_assert_cpus_held(void) { }
119static inline void cpu_hotplug_disable(void) { } 123static inline void cpu_hotplug_disable(void) { }
120static inline void cpu_hotplug_enable(void) { } 124static inline void cpu_hotplug_enable(void) { }
@@ -166,4 +170,23 @@ void cpuhp_report_idle_dead(void);
166static inline void cpuhp_report_idle_dead(void) { } 170static inline void cpuhp_report_idle_dead(void) { }
167#endif /* #ifdef CONFIG_HOTPLUG_CPU */ 171#endif /* #ifdef CONFIG_HOTPLUG_CPU */
168 172
173enum cpuhp_smt_control {
174 CPU_SMT_ENABLED,
175 CPU_SMT_DISABLED,
176 CPU_SMT_FORCE_DISABLED,
177 CPU_SMT_NOT_SUPPORTED,
178};
179
180#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
181extern enum cpuhp_smt_control cpu_smt_control;
182extern void cpu_smt_disable(bool force);
183extern void cpu_smt_check_topology_early(void);
184extern void cpu_smt_check_topology(void);
185#else
186# define cpu_smt_control (CPU_SMT_ENABLED)
187static inline void cpu_smt_disable(bool force) { }
188static inline void cpu_smt_check_topology_early(void) { }
189static inline void cpu_smt_check_topology(void) { }
190#endif
191
169#endif /* _LINUX_CPU_H_ */ 192#endif /* _LINUX_CPU_H_ */