diff options
Diffstat (limited to 'include/linux/cpu.h')
| -rw-r--r-- | include/linux/cpu.h | 23 |
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); |
| 56 | extern ssize_t cpu_show_spec_store_bypass(struct device *dev, | 56 | extern ssize_t cpu_show_spec_store_bypass(struct device *dev, |
| 57 | struct device_attribute *attr, char *buf); | 57 | struct device_attribute *attr, char *buf); |
| 58 | extern ssize_t cpu_show_l1tf(struct device *dev, | ||
| 59 | struct device_attribute *attr, char *buf); | ||
| 58 | 60 | ||
| 59 | extern __printf(4, 5) | 61 | extern __printf(4, 5) |
| 60 | struct device *cpu_device_create(struct device *parent, void *drvdata, | 62 | struct device *cpu_device_create(struct device *parent, void *drvdata, |
| @@ -103,6 +105,7 @@ extern void cpus_write_lock(void); | |||
| 103 | extern void cpus_write_unlock(void); | 105 | extern void cpus_write_unlock(void); |
| 104 | extern void cpus_read_lock(void); | 106 | extern void cpus_read_lock(void); |
| 105 | extern void cpus_read_unlock(void); | 107 | extern void cpus_read_unlock(void); |
| 108 | extern int cpus_read_trylock(void); | ||
| 106 | extern void lockdep_assert_cpus_held(void); | 109 | extern void lockdep_assert_cpus_held(void); |
| 107 | extern void cpu_hotplug_disable(void); | 110 | extern void cpu_hotplug_disable(void); |
| 108 | extern void cpu_hotplug_enable(void); | 111 | extern void cpu_hotplug_enable(void); |
| @@ -115,6 +118,7 @@ static inline void cpus_write_lock(void) { } | |||
| 115 | static inline void cpus_write_unlock(void) { } | 118 | static inline void cpus_write_unlock(void) { } |
| 116 | static inline void cpus_read_lock(void) { } | 119 | static inline void cpus_read_lock(void) { } |
| 117 | static inline void cpus_read_unlock(void) { } | 120 | static inline void cpus_read_unlock(void) { } |
| 121 | static inline int cpus_read_trylock(void) { return true; } | ||
| 118 | static inline void lockdep_assert_cpus_held(void) { } | 122 | static inline void lockdep_assert_cpus_held(void) { } |
| 119 | static inline void cpu_hotplug_disable(void) { } | 123 | static inline void cpu_hotplug_disable(void) { } |
| 120 | static inline void cpu_hotplug_enable(void) { } | 124 | static inline void cpu_hotplug_enable(void) { } |
| @@ -166,4 +170,23 @@ void cpuhp_report_idle_dead(void); | |||
| 166 | static inline void cpuhp_report_idle_dead(void) { } | 170 | static inline void cpuhp_report_idle_dead(void) { } |
| 167 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ | 171 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ |
| 168 | 172 | ||
| 173 | enum 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) | ||
| 181 | extern enum cpuhp_smt_control cpu_smt_control; | ||
| 182 | extern void cpu_smt_disable(bool force); | ||
| 183 | extern void cpu_smt_check_topology_early(void); | ||
| 184 | extern void cpu_smt_check_topology(void); | ||
| 185 | #else | ||
| 186 | # define cpu_smt_control (CPU_SMT_ENABLED) | ||
| 187 | static inline void cpu_smt_disable(bool force) { } | ||
| 188 | static inline void cpu_smt_check_topology_early(void) { } | ||
| 189 | static inline void cpu_smt_check_topology(void) { } | ||
| 190 | #endif | ||
| 191 | |||
| 169 | #endif /* _LINUX_CPU_H_ */ | 192 | #endif /* _LINUX_CPU_H_ */ |
