xref: /linux/arch/x86/Kconfig.cpu (revision 4b99990cdf9560e8a071640baf19f312e6ae02f4)
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
266config X86_HAVE_PAE
267	def_bool y
268	depends on MCRUSOE || MEFFICEON || MCYRIXIII || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC7 || MATOM || X86_64
269
270config X86_CX8
271	def_bool y
272
273# this should be set for all -march=.. options where the compiler
274# generates cmov.
275config X86_CMOV
276	def_bool y
277	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || MATOM || MGEODE_LX || X86_64)
278
279config X86_MINIMUM_CPU_FAMILY
280	int
281	default "64" if X86_64
282	default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7)
283	default "5"
284
285config X86_DEBUGCTLMSR
286	def_bool y
287	depends on !(MK6 || MCYRIXIII || M586MMX || M586TSC || M586) && !UML
288
289config IA32_FEAT_CTL
290	def_bool y
291	depends on CPU_SUP_INTEL || CPU_SUP_CENTAUR || CPU_SUP_ZHAOXIN
292
293config X86_VMX_FEATURE_NAMES
294	def_bool y
295	depends on IA32_FEAT_CTL
296
297menuconfig PROCESSOR_SELECT
298	bool "Supported processor vendors" if EXPERT
299	help
300	  This lets you choose what x86 vendor support code your kernel
301	  will include.
302
303config CPU_SUP_INTEL
304	default y
305	bool "Support Intel processors" if PROCESSOR_SELECT
306	help
307	  This enables detection, tunings and quirks for Intel processors
308
309	  You need this enabled if you want your kernel to run on an
310	  Intel CPU. Disabling this option on other types of CPUs
311	  makes the kernel a tiny bit smaller. Disabling it on an Intel
312	  CPU might render the kernel unbootable.
313
314	  If unsure, say N.
315
316config CPU_SUP_CYRIX_32
317	default y
318	bool "Support Cyrix processors" if PROCESSOR_SELECT
319	depends on M586 || M586TSC || M586MMX || (EXPERT && !64BIT)
320	help
321	  This enables detection, tunings and quirks for Cyrix processors
322
323	  You need this enabled if you want your kernel to run on a
324	  Cyrix CPU. Disabling this option on other types of CPUs
325	  makes the kernel a tiny bit smaller. Disabling it on a Cyrix
326	  CPU might render the kernel unbootable.
327
328	  If unsure, say N.
329
330config CPU_SUP_AMD
331	default y
332	bool "Support AMD processors" if PROCESSOR_SELECT
333	help
334	  This enables detection, tunings and quirks for AMD processors
335
336	  You need this enabled if you want your kernel to run on an
337	  AMD CPU. Disabling this option on other types of CPUs
338	  makes the kernel a tiny bit smaller. Disabling it on an AMD
339	  CPU might render the kernel unbootable.
340
341	  If unsure, say N.
342
343config CPU_SUP_HYGON
344	default y
345	bool "Support Hygon processors" if PROCESSOR_SELECT
346	select CPU_SUP_AMD
347	help
348	  This enables detection, tunings and quirks for Hygon processors
349
350	  You need this enabled if you want your kernel to run on an
351	  Hygon CPU. Disabling this option on other types of CPUs
352	  makes the kernel a tiny bit smaller. Disabling it on an Hygon
353	  CPU might render the kernel unbootable.
354
355	  If unsure, say N.
356
357config CPU_SUP_CENTAUR
358	default y
359	bool "Support Centaur processors" if PROCESSOR_SELECT
360	help
361	  This enables detection, tunings and quirks for Centaur processors
362
363	  You need this enabled if you want your kernel to run on a
364	  Centaur CPU. Disabling this option on other types of CPUs
365	  makes the kernel a tiny bit smaller. Disabling it on a Centaur
366	  CPU might render the kernel unbootable.
367
368	  If unsure, say N.
369
370config CPU_SUP_TRANSMETA_32
371	default y
372	bool "Support Transmeta processors" if PROCESSOR_SELECT
373	depends on !64BIT
374	help
375	  This enables detection, tunings and quirks for Transmeta processors
376
377	  You need this enabled if you want your kernel to run on a
378	  Transmeta CPU. Disabling this option on other types of CPUs
379	  makes the kernel a tiny bit smaller. Disabling it on a Transmeta
380	  CPU might render the kernel unbootable.
381
382	  If unsure, say N.
383
384config CPU_SUP_ZHAOXIN
385	default y
386	bool "Support Zhaoxin processors" if PROCESSOR_SELECT
387	help
388	  This enables detection, tunings and quirks for Zhaoxin processors
389
390	  You need this enabled if you want your kernel to run on a
391	  Zhaoxin CPU. Disabling this option on other types of CPUs
392	  makes the kernel a tiny bit smaller. Disabling it on a Zhaoxin
393	  CPU might render the kernel unbootable.
394
395	  If unsure, say N.
396
397config CPU_SUP_VORTEX_32
398	default y
399	bool "Support Vortex processors" if PROCESSOR_SELECT
400	depends on X86_32
401	help
402	  This enables detection, tunings and quirks for Vortex processors
403
404	  You need this enabled if you want your kernel to run on a
405	  Vortex CPU. Disabling this option on other types of CPUs
406	  makes the kernel a tiny bit smaller.
407
408	  If unsure, say N.
409
410config BROADCAST_TLB_FLUSH
411	def_bool y
412	depends on CPU_SUP_AMD && 64BIT
413