xref: /linux/arch/x86/Kconfig.cpu (revision 7b49a3fb69e785a2425c8dc7dbd0779a0a4c0eb2)
1# SPDX-License-Identifier: GPL-2.0
2# Put here option for CPU selection and depending optimization
3choice
4	prompt "x86-32 Processor family"
5	depends on X86_32
6	default M686
7	help
8	  This is the processor type of your CPU. This information is
9	  used for optimizing purposes. In order to compile a kernel
10	  that can run on all supported x86 CPU types (albeit not
11	  optimally fast), you can specify "586" here.
12
13	  Note that the 386 and 486 is no longer supported, this includes
14	  AMD/Cyrix/Intel 386DX/DXL/SL/SLC/SX, Cyrix/TI 486DLC/DLC2,
15	  UMC 486SX-S and the NexGen Nx586, AMD ELAN and all 486 based
16	  CPUs.
17
18	  The kernel will not necessarily run on earlier architectures than
19	  the one you have chosen, e.g. a Pentium optimized kernel will run on
20	  a PPro, but not necessarily on a i486.
21
22	  Here are the settings recommended for greatest speed:
23	  - "586" for generic Pentium CPUs lacking the TSC
24	    (time stamp counter) register.
25	  - "Pentium-Classic" for the Intel Pentium.
26	  - "Pentium-MMX" for the Intel Pentium MMX.
27	  - "Pentium-Pro" for the Intel Pentium Pro.
28	  - "Pentium-II" for the Intel Pentium II or pre-Coppermine Celeron.
29	  - "Pentium-III" for the Intel Pentium III or Coppermine Celeron.
30	  - "Pentium-4" for the Intel Pentium 4 or P4-based Celeron.
31	  - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
32	  - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
33	  - "Crusoe" for the Transmeta Crusoe series.
34	  - "Efficeon" for the Transmeta Efficeon series.
35	  - "AMD Elan" for the 32-bit AMD Elan embedded CPU.
36	  - "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
37	  - "Geode GX/LX" For AMD Geode GX and LX processors.
38	  - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
39	  - "VIA C3-2" for VIA C3-2 "Nehemiah" (model 9 and above).
40	  - "VIA C7" for VIA C7.
41	  - "Intel Atom" for the Atom-microarchitecture CPUs.
42
43	  See each option's help text for additional details. If you don't know
44	  what to do, choose "Pentium-Pro".
45
46config M586TSC
47	bool "Pentium-Classic"
48	depends on X86_32
49	help
50	  Select this for a Pentium Classic processor with the RDTSC (Read
51	  Time Stamp Counter) instruction for benchmarking.
52
53config M586MMX
54	bool "Pentium-MMX"
55	depends on X86_32
56	help
57	  Select this for a Pentium with the MMX graphics/multimedia
58	  extended instructions.
59
60config M686
61	bool "Pentium-Pro"
62	depends on X86_32
63	help
64	  Select this for Intel Pentium Pro chips.  This enables the use of
65	  Pentium Pro extended instructions, and disables the init-time guard
66	  against the f00f bug found in earlier Pentiums.
67
68config MPENTIUMII
69	bool "Pentium-II/Celeron(pre-Coppermine)"
70	depends on X86_32
71	help
72	  Select this for Intel chips based on the Pentium-II and
73	  pre-Coppermine Celeron core.  This option enables an unaligned
74	  copy optimization, compiles the kernel with optimization flags
75	  tailored for the chip, and applies any applicable Pentium Pro
76	  optimizations.
77
78config MPENTIUMIII
79	bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
80	depends on X86_32
81	help
82	  Select this for Intel chips based on the Pentium-III and
83	  Celeron-Coppermine core.  This option enables use of some
84	  extended prefetch instructions in addition to the Pentium II
85	  extensions.
86
87config MPENTIUMM
88	bool "Pentium M/Pentium Dual Core/Core Solo/Core Duo"
89	depends on X86_32
90	help
91	  Select this for Intel Pentium M (not Pentium-4 M)
92	  "Merom" Core Solo/Duo notebook chips
93
94config MPENTIUM4
95	bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon"
96	depends on X86_32
97	help
98	  Select this for Intel Pentium 4 chips.  This includes the
99	  Pentium 4, Pentium D, P4-based Celeron and Xeon, and
100	  Pentium-4 M (not Pentium M) chips.  This option enables compile
101	  flags optimized for the chip, uses the correct cache line size, and
102	  applies any applicable optimizations.
103
104	  CPUIDs: F[0-6][1-A] (in /proc/cpuinfo show = cpu family : 15 )
105
106	  Select this for:
107	    Pentiums (Pentium 4, Pentium D, Celeron, Celeron D) corename:
108		-Willamette
109		-Northwood
110		-Mobile Pentium 4
111		-Mobile Pentium 4 M
112		-Extreme Edition (Gallatin)
113	    Xeons (Intel Xeon, Xeon MP, Xeon LV, Xeon MV) corename:
114		-Foster
115		-Prestonia
116		-Gallatin
117
118config MK6
119	bool "K6/K6-II/K6-III"
120	depends on X86_32
121	help
122	  Select this for an AMD K6-family processor.  Enables use of
123	  some extended instructions, and passes appropriate optimization
124	  flags to GCC.
125
126config MK7
127	bool "Athlon/Duron/K7"
128	depends on X86_32
129	help
130	  Select this for an AMD Athlon K7-family processor.  Enables use of
131	  some extended instructions, and passes appropriate optimization
132	  flags to GCC.
133
134config MCRUSOE
135	bool "Crusoe"
136	depends on X86_32
137	help
138	  Select this for a Transmeta Crusoe processor.  Treats the processor
139	  like a 586 with TSC, and sets some GCC optimization flags (like a
140	  Pentium Pro with no alignment requirements).
141
142config MEFFICEON
143	bool "Efficeon"
144	depends on X86_32
145	help
146	  Select this for a Transmeta Efficeon processor.
147
148config MGEODEGX1
149	bool "GeodeGX1"
150	depends on X86_32
151	help
152	  Select this for a Geode GX1 (Cyrix MediaGX) chip.
153
154config MGEODE_LX
155	bool "Geode GX/LX"
156	depends on X86_32
157	help
158	  Select this for AMD Geode GX and LX processors.
159
160config MCYRIXIII
161	bool "CyrixIII/VIA-C3"
162	depends on X86_32
163	help
164	  Select this for a Cyrix III or C3 chip.  Presently Linux and GCC
165	  treat this chip as a generic 586. Whilst the CPU is 686 class,
166	  it lacks the cmov extension which gcc assumes is present when
167	  generating 686 code.
168	  Note that Nehemiah (Model 9) and above will not boot with this
169	  kernel due to them lacking the 3DNow! instructions used in earlier
170	  incarnations of the CPU.
171
172config MVIAC3_2
173	bool "VIA C3-2 (Nehemiah)"
174	depends on X86_32
175	help
176	  Select this for a VIA C3 "Nehemiah". Selecting this enables usage
177	  of SSE and tells gcc to treat the CPU as a 686.
178	  Note, this kernel will not boot on older (pre model 9) C3s.
179
180config MVIAC7
181	bool "VIA C7"
182	depends on X86_32
183	help
184	  Select this for a VIA C7.  Selecting this uses the correct cache
185	  shift and tells gcc to treat the CPU as a 686.
186
187config MATOM
188	bool "Intel Atom"
189	help
190	  Select this for the Intel Atom platform. Intel Atom CPUs have an
191	  in-order pipelining architecture and thus can benefit from
192	  accordingly optimized code. Use a recent GCC with specific Atom
193	  support in order to fully benefit from selecting this option.
194
195endchoice
196
197config CC_HAS_MARCH_NATIVE
198	# This flag might not be available in cross-compilers:
199	def_bool $(cc-option, -march=native)
200	# LLVM 18 has an easily triggered internal compiler error in core
201	# networking code with '-march=native' on certain systems:
202	# https://github.com/llvm/llvm-project/issues/72026
203	# LLVM 19 introduces an optimization that resolves some high stack
204	# usage warnings that only appear wth '-march=native'.
205	depends on CC_IS_GCC || CLANG_VERSION >= 190100
206
207config X86_NATIVE_CPU
208	bool "Build and optimize for local/native CPU"
209	depends on X86_64
210	depends on CC_HAS_MARCH_NATIVE
211	help
212	  Optimize for the current CPU used to compile the kernel.
213	  Use this option if you intend to build the kernel for your
214	  local machine.
215
216	  Note that such a kernel might not work optimally on a
217	  different x86 machine.
218
219	  If unsure, say N.
220
221config X86_GENERIC
222	bool "Generic x86 support"
223	depends on X86_32
224	help
225	  Instead of just including optimizations for the selected
226	  x86 variant (e.g. PII, Crusoe or Athlon), include some more
227	  generic optimizations as well. This will make the kernel
228	  perform better on x86 CPUs other than that selected.
229
230	  This is really intended for distributors who need more
231	  generic optimizations.
232
233#
234# Define implied options from the CPU selection here
235config X86_INTERNODE_CACHE_SHIFT
236	int
237	default "12" if X86_VSMP
238	default X86_L1_CACHE_SHIFT
239
240config X86_L1_CACHE_SHIFT
241	int
242	default "7" if MPENTIUM4
243	default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64
244	default "4" if MGEODEGX1
245	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MGEODE_LX
246
247config X86_F00F_BUG
248	def_bool y
249	depends on M586MMX || M586TSC || M586
250
251config X86_ALIGNMENT_16
252	def_bool y
253	depends on MCYRIXIII || MK6 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
254
255config X86_INTEL_USERCOPY
256	def_bool y
257	depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK7 || MEFFICEON
258
259config X86_USE_PPRO_CHECKSUM
260	def_bool y
261	depends on MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MATOM
262
263config X86_TSC
264	def_bool y
265	depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MATOM) || X86_64
266
267config X86_HAVE_PAE
268	def_bool y
269	depends on MCRUSOE || MEFFICEON || MCYRIXIII || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC7 || MATOM || X86_64
270
271config X86_CX8
272	def_bool y
273	depends on X86_HAVE_PAE || M586TSC || M586MMX || MK6 || MK7 || MGEODEGX1 || MGEODE_LX
274
275# this should be set for all -march=.. options where the compiler
276# generates cmov.
277config X86_CMOV
278	def_bool y
279	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || MATOM || MGEODE_LX || X86_64)
280
281config X86_MINIMUM_CPU_FAMILY
282	int
283	default "64" if X86_64
284	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
285	default "5"
286
287config X86_DEBUGCTLMSR
288	def_bool y
289	depends on !(MK6 || MCYRIXIII || M586MMX || M586TSC || M586) && !UML
290
291config IA32_FEAT_CTL
292	def_bool y
293	depends on CPU_SUP_INTEL || CPU_SUP_CENTAUR || CPU_SUP_ZHAOXIN
294
295config X86_VMX_FEATURE_NAMES
296	def_bool y
297	depends on IA32_FEAT_CTL
298
299menuconfig PROCESSOR_SELECT
300	bool "Supported processor vendors" if EXPERT
301	help
302	  This lets you choose what x86 vendor support code your kernel
303	  will include.
304
305config BROADCAST_TLB_FLUSH
306	def_bool y
307	depends on CPU_SUP_AMD && 64BIT
308
309config CPU_SUP_INTEL
310	default y
311	bool "Support Intel processors" if PROCESSOR_SELECT
312	help
313	  This enables detection, tunings and quirks for Intel processors
314
315	  You need this enabled if you want your kernel to run on an
316	  Intel CPU. Disabling this option on other types of CPUs
317	  makes the kernel a tiny bit smaller. Disabling it on an Intel
318	  CPU might render the kernel unbootable.
319
320	  If unsure, say N.
321
322config CPU_SUP_CYRIX_32
323	default y
324	bool "Support Cyrix processors" if PROCESSOR_SELECT
325	depends on M586 || M586TSC || M586MMX || (EXPERT && !64BIT)
326	help
327	  This enables detection, tunings and quirks for Cyrix processors
328
329	  You need this enabled if you want your kernel to run on a
330	  Cyrix CPU. Disabling this option on other types of CPUs
331	  makes the kernel a tiny bit smaller. Disabling it on a Cyrix
332	  CPU might render the kernel unbootable.
333
334	  If unsure, say N.
335
336config CPU_SUP_AMD
337	default y
338	bool "Support AMD processors" if PROCESSOR_SELECT
339	help
340	  This enables detection, tunings and quirks for AMD processors
341
342	  You need this enabled if you want your kernel to run on an
343	  AMD CPU. Disabling this option on other types of CPUs
344	  makes the kernel a tiny bit smaller. Disabling it on an AMD
345	  CPU might render the kernel unbootable.
346
347	  If unsure, say N.
348
349config CPU_SUP_HYGON
350	default y
351	bool "Support Hygon processors" if PROCESSOR_SELECT
352	select CPU_SUP_AMD
353	help
354	  This enables detection, tunings and quirks for Hygon processors
355
356	  You need this enabled if you want your kernel to run on an
357	  Hygon CPU. Disabling this option on other types of CPUs
358	  makes the kernel a tiny bit smaller. Disabling it on an Hygon
359	  CPU might render the kernel unbootable.
360
361	  If unsure, say N.
362
363config CPU_SUP_CENTAUR
364	default y
365	bool "Support Centaur processors" if PROCESSOR_SELECT
366	help
367	  This enables detection, tunings and quirks for Centaur processors
368
369	  You need this enabled if you want your kernel to run on a
370	  Centaur CPU. Disabling this option on other types of CPUs
371	  makes the kernel a tiny bit smaller. Disabling it on a Centaur
372	  CPU might render the kernel unbootable.
373
374	  If unsure, say N.
375
376config CPU_SUP_TRANSMETA_32
377	default y
378	bool "Support Transmeta processors" if PROCESSOR_SELECT
379	depends on !64BIT
380	help
381	  This enables detection, tunings and quirks for Transmeta processors
382
383	  You need this enabled if you want your kernel to run on a
384	  Transmeta CPU. Disabling this option on other types of CPUs
385	  makes the kernel a tiny bit smaller. Disabling it on a Transmeta
386	  CPU might render the kernel unbootable.
387
388	  If unsure, say N.
389
390config CPU_SUP_ZHAOXIN
391	default y
392	bool "Support Zhaoxin processors" if PROCESSOR_SELECT
393	help
394	  This enables detection, tunings and quirks for Zhaoxin processors
395
396	  You need this enabled if you want your kernel to run on a
397	  Zhaoxin CPU. Disabling this option on other types of CPUs
398	  makes the kernel a tiny bit smaller. Disabling it on a Zhaoxin
399	  CPU might render the kernel unbootable.
400
401	  If unsure, say N.
402
403config CPU_SUP_VORTEX_32
404	default y
405	bool "Support Vortex processors" if PROCESSOR_SELECT
406	depends on X86_32
407	help
408	  This enables detection, tunings and quirks for Vortex processors
409
410	  You need this enabled if you want your kernel to run on a
411	  Vortex CPU. Disabling this option on other types of CPUs
412	  makes the kernel a tiny bit smaller.
413
414	  If unsure, say N.
415