|
9 | 9 | * - Andrew D. Balsa (code cleanup). |
10 | 10 | */ |
11 | 11 | #include <linux/init.h> |
12 | | -#include <linux/utsname.h> |
13 | 12 | #include <linux/cpu.h> |
14 | 13 | #include <linux/module.h> |
15 | 14 | #include <linux/nospec.h> |
|
27 | 26 | #include <asm/msr.h> |
28 | 27 | #include <asm/vmx.h> |
29 | 28 | #include <asm/paravirt.h> |
30 | | -#include <asm/alternative.h> |
31 | | -#include <asm/set_memory.h> |
32 | 29 | #include <asm/intel-family.h> |
33 | 30 | #include <asm/e820/api.h> |
34 | 31 | #include <asm/hypervisor.h> |
@@ -125,21 +122,8 @@ DEFINE_STATIC_KEY_FALSE(switch_mm_cond_l1d_flush); |
125 | 122 | DEFINE_STATIC_KEY_FALSE(mmio_stale_data_clear); |
126 | 123 | EXPORT_SYMBOL_GPL(mmio_stale_data_clear); |
127 | 124 |
|
128 | | -void __init check_bugs(void) |
| 125 | +void __init cpu_select_mitigations(void) |
129 | 126 | { |
130 | | - identify_boot_cpu(); |
131 | | - |
132 | | - /* |
133 | | - * identify_boot_cpu() initialized SMT support information, let the |
134 | | - * core code know. |
135 | | - */ |
136 | | - cpu_smt_check_topology(); |
137 | | - |
138 | | - if (!IS_ENABLED(CONFIG_SMP)) { |
139 | | - pr_info("CPU: "); |
140 | | - print_cpu_info(&boot_cpu_data); |
141 | | - } |
142 | | - |
143 | 127 | /* |
144 | 128 | * Read the SPEC_CTRL MSR to account for reserved bits which may |
145 | 129 | * have unknown values. AMD64_LS_CFG MSR is cached in the early AMD |
@@ -176,39 +160,6 @@ void __init check_bugs(void) |
176 | 160 | md_clear_select_mitigation(); |
177 | 161 | srbds_select_mitigation(); |
178 | 162 | l1d_flush_select_mitigation(); |
179 | | - |
180 | | - arch_smt_update(); |
181 | | - |
182 | | -#ifdef CONFIG_X86_32 |
183 | | - /* |
184 | | - * Check whether we are able to run this kernel safely on SMP. |
185 | | - * |
186 | | - * - i386 is no longer supported. |
187 | | - * - In order to run on anything without a TSC, we need to be |
188 | | - * compiled for a i486. |
189 | | - */ |
190 | | - if (boot_cpu_data.x86 < 4) |
191 | | - panic("Kernel requires i486+ for 'invlpg' and other features"); |
192 | | - |
193 | | - init_utsname()->machine[1] = |
194 | | - '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); |
195 | | - alternative_instructions(); |
196 | | - |
197 | | - fpu__init_check_bugs(); |
198 | | -#else /* CONFIG_X86_64 */ |
199 | | - alternative_instructions(); |
200 | | - |
201 | | - /* |
202 | | - * Make sure the first 2MB area is not mapped by huge pages |
203 | | - * There are typically fixed size MTRRs in there and overlapping |
204 | | - * MTRRs into large pages causes slow downs. |
205 | | - * |
206 | | - * Right now we don't do that with gbpages because there seems |
207 | | - * very little benefit for that case. |
208 | | - */ |
209 | | - if (!direct_gbpages) |
210 | | - set_memory_4k((unsigned long)__va(0), 1); |
211 | | -#endif |
212 | 163 | } |
213 | 164 |
|
214 | 165 | /* |
|
0 commit comments