.. | .. |
---|
64 | 64 | char *buf); |
---|
65 | 65 | extern ssize_t cpu_show_itlb_multihit(struct device *dev, |
---|
66 | 66 | struct device_attribute *attr, char *buf); |
---|
| 67 | +extern ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *buf); |
---|
| 68 | +extern ssize_t cpu_show_mmio_stale_data(struct device *dev, |
---|
| 69 | + struct device_attribute *attr, |
---|
| 70 | + char *buf); |
---|
| 71 | +extern ssize_t cpu_show_retbleed(struct device *dev, |
---|
| 72 | + struct device_attribute *attr, char *buf); |
---|
67 | 73 | |
---|
68 | 74 | extern __printf(4, 5) |
---|
69 | 75 | struct device *cpu_device_create(struct device *parent, void *drvdata, |
---|
.. | .. |
---|
88 | 94 | |
---|
89 | 95 | #ifdef CONFIG_SMP |
---|
90 | 96 | extern bool cpuhp_tasks_frozen; |
---|
91 | | -int cpu_up(unsigned int cpu); |
---|
| 97 | +int add_cpu(unsigned int cpu); |
---|
| 98 | +int cpu_device_up(struct device *dev); |
---|
92 | 99 | void notify_cpu_starting(unsigned int cpu); |
---|
93 | 100 | extern void cpu_maps_update_begin(void); |
---|
94 | 101 | extern void cpu_maps_update_done(void); |
---|
| 102 | +int bringup_hibernate_cpu(unsigned int sleep_cpu); |
---|
| 103 | +void bringup_nonboot_cpus(unsigned int setup_max_cpus); |
---|
95 | 104 | |
---|
96 | 105 | #else /* CONFIG_SMP */ |
---|
97 | 106 | #define cpuhp_tasks_frozen 0 |
---|
.. | .. |
---|
117 | 126 | extern void cpu_hotplug_disable(void); |
---|
118 | 127 | extern void cpu_hotplug_enable(void); |
---|
119 | 128 | void clear_tasks_mm_cpumask(int cpu); |
---|
120 | | -int cpu_down(unsigned int cpu); |
---|
| 129 | +int remove_cpu(unsigned int cpu); |
---|
| 130 | +int pause_cpus(struct cpumask *cpumask); |
---|
| 131 | +int resume_cpus(struct cpumask *cpumask); |
---|
| 132 | +int cpu_device_down(struct device *dev); |
---|
| 133 | +extern void smp_shutdown_nonboot_cpus(unsigned int primary_cpu); |
---|
121 | 134 | |
---|
122 | 135 | #else /* CONFIG_HOTPLUG_CPU */ |
---|
123 | 136 | |
---|
.. | .. |
---|
129 | 142 | static inline void lockdep_assert_cpus_held(void) { } |
---|
130 | 143 | static inline void cpu_hotplug_disable(void) { } |
---|
131 | 144 | static inline void cpu_hotplug_enable(void) { } |
---|
132 | | - |
---|
| 145 | +static inline int pause_cpus(struct cpumask *cpumask) { return -ENODEV; } |
---|
| 146 | +static inline int resume_cpus(struct cpumask *cpumask) { return -ENODEV; } |
---|
| 147 | +static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { } |
---|
133 | 148 | #endif /* !CONFIG_HOTPLUG_CPU */ |
---|
134 | 149 | |
---|
135 | 150 | /* Wrappers which go away once all code is converted */ |
---|
.. | .. |
---|
140 | 155 | |
---|
141 | 156 | #ifdef CONFIG_PM_SLEEP_SMP |
---|
142 | 157 | extern int freeze_secondary_cpus(int primary); |
---|
143 | | -static inline int disable_nonboot_cpus(void) |
---|
| 158 | +extern void thaw_secondary_cpus(void); |
---|
| 159 | + |
---|
| 160 | +static inline int suspend_disable_secondary_cpus(void) |
---|
144 | 161 | { |
---|
145 | | - return freeze_secondary_cpus(0); |
---|
| 162 | + int cpu = 0; |
---|
| 163 | + |
---|
| 164 | + if (IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU)) |
---|
| 165 | + cpu = -1; |
---|
| 166 | + |
---|
| 167 | + return freeze_secondary_cpus(cpu); |
---|
146 | 168 | } |
---|
147 | | -extern void enable_nonboot_cpus(void); |
---|
| 169 | +static inline void suspend_enable_secondary_cpus(void) |
---|
| 170 | +{ |
---|
| 171 | + return thaw_secondary_cpus(); |
---|
| 172 | +} |
---|
| 173 | + |
---|
148 | 174 | #else /* !CONFIG_PM_SLEEP_SMP */ |
---|
149 | | -static inline int disable_nonboot_cpus(void) { return 0; } |
---|
150 | | -static inline void enable_nonboot_cpus(void) {} |
---|
| 175 | +static inline void thaw_secondary_cpus(void) {} |
---|
| 176 | +static inline int suspend_disable_secondary_cpus(void) { return 0; } |
---|
| 177 | +static inline void suspend_enable_secondary_cpus(void) { } |
---|
151 | 178 | #endif /* !CONFIG_PM_SLEEP_SMP */ |
---|
152 | 179 | |
---|
153 | 180 | void cpu_startup_entry(enum cpuhp_state state); |
---|
.. | .. |
---|
155 | 182 | void cpu_idle_poll_ctrl(bool enable); |
---|
156 | 183 | |
---|
157 | 184 | /* Attach to any functions which should be considered cpuidle. */ |
---|
158 | | -#define __cpuidle __attribute__((__section__(".cpuidle.text"))) |
---|
| 185 | +#define __cpuidle __section(".cpuidle.text") |
---|
159 | 186 | |
---|
160 | 187 | bool cpu_in_idle(unsigned long pc); |
---|
161 | 188 | |
---|
.. | .. |
---|
168 | 195 | int cpu_report_state(int cpu); |
---|
169 | 196 | int cpu_check_up_prepare(int cpu); |
---|
170 | 197 | void cpu_set_state_online(int cpu); |
---|
171 | | -void play_idle(unsigned long duration_ms); |
---|
| 198 | +void play_idle_precise(u64 duration_ns, u64 latency_ns); |
---|
| 199 | + |
---|
| 200 | +static inline void play_idle(unsigned long duration_us) |
---|
| 201 | +{ |
---|
| 202 | + play_idle_precise(duration_us * NSEC_PER_USEC, U64_MAX); |
---|
| 203 | +} |
---|
172 | 204 | |
---|
173 | 205 | #ifdef CONFIG_HOTPLUG_CPU |
---|
174 | 206 | bool cpu_wait_death(unsigned int cpu, int seconds); |
---|
.. | .. |
---|
183 | 215 | CPU_SMT_DISABLED, |
---|
184 | 216 | CPU_SMT_FORCE_DISABLED, |
---|
185 | 217 | CPU_SMT_NOT_SUPPORTED, |
---|
| 218 | + CPU_SMT_NOT_IMPLEMENTED, |
---|
186 | 219 | }; |
---|
187 | 220 | |
---|
188 | 221 | #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT) |
---|
189 | 222 | extern enum cpuhp_smt_control cpu_smt_control; |
---|
190 | 223 | extern void cpu_smt_disable(bool force); |
---|
191 | 224 | extern void cpu_smt_check_topology(void); |
---|
| 225 | +extern bool cpu_smt_possible(void); |
---|
192 | 226 | extern int cpuhp_smt_enable(void); |
---|
193 | 227 | extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval); |
---|
194 | 228 | #else |
---|
195 | | -# define cpu_smt_control (CPU_SMT_ENABLED) |
---|
| 229 | +# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED) |
---|
196 | 230 | static inline void cpu_smt_disable(bool force) { } |
---|
197 | 231 | static inline void cpu_smt_check_topology(void) { } |
---|
| 232 | +static inline bool cpu_smt_possible(void) { return false; } |
---|
198 | 233 | static inline int cpuhp_smt_enable(void) { return 0; } |
---|
199 | 234 | static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; } |
---|
200 | 235 | #endif |
---|