xref: /linux/arch/x86/Kconfig.cpu (revision 156fa7417fac89fd9dcf3a4ee88785ff90ab6411)
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 RUSTC_HAS_APXF
208	# The kernel isn't ready for in-kernel APX instructions. Without
209	# explicit frontend gating of APX, the backend may emit those
210	# instructions in native builds.
211	#
212	# Rust 1.88 added the `apxf` feature option, but versions before 1.93
213	# emit an `apxf` target attribute that only LLVM 23+ can interpret.
214	def_bool (RUSTC_VERSION >= 108800 && RUSTC_LLVM_MAJOR_VERSION >= 23) || \
215		 RUSTC_VERSION >= 109300
216
217config X86_NATIVE_CPU
218	bool "Build and optimize for local/native CPU"
219	depends on X86_64
220	depends on CC_HAS_MARCH_NATIVE
221	depends on !RUST || RUSTC_HAS_APXF
222	help
223	  Optimize for the current CPU used to compile the kernel.
224	  Use this option if you intend to build the kernel for your
225	  local machine.
226
227	  Note that such a kernel might not work optimally on a
228	  different x86 machine.
229
230	  If unsure, say N.
231
232config X86_GENERIC
233	bool "Generic x86 support"
234	depends on X86_32
235	help
236	  Instead of just including optimizations for the selected
237	  x86 variant (e.g. PII, Crusoe or Athlon), include some more
238	  generic optimizations as well. This will make the kernel
239	  perform better on x86 CPUs other than that selected.
240
241	  This is really intended for distributors who need more
242	  generic optimizations.
243
244#
245# Define implied options from the CPU selection here
246config X86_INTERNODE_CACHE_SHIFT
247	int
248	default "12" if X86_VSMP
249	default X86_L1_CACHE_SHIFT
250
251config X86_L1_CACHE_SHIFT
252	int
253	default "7" if MPENTIUM4
254	default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64
255	default "4" if MGEODEGX1
256	default "5" if MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MGEODE_LX
257
258config X86_F00F_BUG
259	def_bool y
260	depends on M586MMX || M586TSC || M586
261
262config X86_ALIGNMENT_16
263	def_bool y
264	depends on MCYRIXIII || MK6 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
265
266config X86_INTEL_USERCOPY
267	def_bool y
268	depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK7 || MEFFICEON
269
270config X86_USE_PPRO_CHECKSUM
271	def_bool y
272	depends on MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MATOM
273
274config X86_TSC
275	def_bool y
276
277config X86_HAVE_PAE
278	def_bool y
279	depends on MCRUSOE || MEFFICEON || MCYRIXIII || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC7 || MATOM || X86_64
280
281config X86_CX8
282	def_bool y
283
284# this should be set for all -march=.. options where the compiler
285# generates cmov.
286config X86_CMOV
287	def_bool y
288	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || MATOM || MGEODE_LX || X86_64)
289
290config X86_MINIMUM_CPU_FAMILY
291	int
292	default "64" if X86_64
293	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
294	default "5"
295
296config X86_DEBUGCTLMSR
297	def_bool y
298	depends on !(MK6 || MCYRIXIII || M586MMX || M586TSC || M586) && !UML
299
300config IA32_FEAT_CTL
301	def_bool y
302	depends on CPU_SUP_INTEL || CPU_SUP_CENTAUR || CPU_SUP_ZHAOXIN
303
304config X86_VMX_FEATURE_NAMES
305	def_bool y
306	depends on IA32_FEAT_CTL
307
308menuconfig PROCESSOR_SELECT
309	bool "Supported processor vendors" if EXPERT
310	help
311	  This lets you choose what x86 vendor support code your kernel
312	  will include.
313
314config CPU_SUP_INTEL
315	default y
316	bool "Support Intel processors" if PROCESSOR_SELECT
317	help
318	  This enables detection, tunings and quirks for Intel processors
319
320	  You need this enabled if you want your kernel to run on an
321	  Intel CPU. Disabling this option on other types of CPUs
322	  makes the kernel a tiny bit smaller. Disabling it on an Intel
323	  CPU might render the kernel unbootable.
324
325	  If unsure, say N.
326
327config CPU_SUP_CYRIX_32
328	default y
329	bool "Support Cyrix processors" if PROCESSOR_SELECT
330	depends on M586 || M586TSC || M586MMX || (EXPERT && !64BIT)
331	help
332	  This enables detection, tunings and quirks for Cyrix processors
333
334	  You need this enabled if you want your kernel to run on a
335	  Cyrix CPU. Disabling this option on other types of CPUs
336	  makes the kernel a tiny bit smaller. Disabling it on a Cyrix
337	  CPU might render the kernel unbootable.
338
339	  If unsure, say N.
340
341config CPU_SUP_AMD
342	default y
343	bool "Support AMD processors" if PROCESSOR_SELECT
344	help
345	  This enables detection, tunings and quirks for AMD processors
346
347	  You need this enabled if you want your kernel to run on an
348	  AMD CPU. Disabling this option on other types of CPUs
349	  makes the kernel a tiny bit smaller. Disabling it on an AMD
350	  CPU might render the kernel unbootable.
351
352	  If unsure, say N.
353
354config CPU_SUP_HYGON
355	default y
356	bool "Support Hygon processors" if PROCESSOR_SELECT
357	select CPU_SUP_AMD
358	help
359	  This enables detection, tunings and quirks for Hygon processors
360
361	  You need this enabled if you want your kernel to run on an
362	  Hygon CPU. Disabling this option on other types of CPUs
363	  makes the kernel a tiny bit smaller. Disabling it on an Hygon
364	  CPU might render the kernel unbootable.
365
366	  If unsure, say N.
367
368config CPU_SUP_CENTAUR
369	default y
370	bool "Support Centaur processors" if PROCESSOR_SELECT
371	help
372	  This enables detection, tunings and quirks for Centaur processors
373
374	  You need this enabled if you want your kernel to run on a
375	  Centaur CPU. Disabling this option on other types of CPUs
376	  makes the kernel a tiny bit smaller. Disabling it on a Centaur
377	  CPU might render the kernel unbootable.
378
379	  If unsure, say N.
380
381config CPU_SUP_TRANSMETA_32
382	default y
383	bool "Support Transmeta processors" if PROCESSOR_SELECT
384	depends on !64BIT
385	help
386	  This enables detection, tunings and quirks for Transmeta processors
387
388	  You need this enabled if you want your kernel to run on a
389	  Transmeta CPU. Disabling this option on other types of CPUs
390	  makes the kernel a tiny bit smaller. Disabling it on a Transmeta
391	  CPU might render the kernel unbootable.
392
393	  If unsure, say N.
394
395config CPU_SUP_ZHAOXIN
396	default y
397	bool "Support Zhaoxin processors" if PROCESSOR_SELECT
398	help
399	  This enables detection, tunings and quirks for Zhaoxin processors
400
401	  You need this enabled if you want your kernel to run on a
402	  Zhaoxin CPU. Disabling this option on other types of CPUs
403	  makes the kernel a tiny bit smaller. Disabling it on a Zhaoxin
404	  CPU might render the kernel unbootable.
405
406	  If unsure, say N.
407
408config CPU_SUP_VORTEX_32
409	default y
410	bool "Support Vortex processors" if PROCESSOR_SELECT
411	depends on X86_32
412	help
413	  This enables detection, tunings and quirks for Vortex processors
414
415	  You need this enabled if you want your kernel to run on a
416	  Vortex CPU. Disabling this option on other types of CPUs
417	  makes the kernel a tiny bit smaller.
418
419	  If unsure, say N.
420
421config BROADCAST_TLB_FLUSH
422	def_bool y
423	depends on CPU_SUP_AMD && 64BIT
424