xref: /linux/arch/x86/Kconfig (revision 37b33c68b00089a574ebd0a856a5d554eb3001b7)
1# SPDX-License-Identifier: GPL-2.0
2# Select 32 or 64 bit
3config 64BIT
4	bool "64-bit kernel" if "$(ARCH)" = "x86"
5	default "$(ARCH)" != "i386"
6	help
7	  Say yes to build a 64-bit kernel - formerly known as x86_64
8	  Say no to build a 32-bit kernel - formerly known as i386
9
10config X86_32
11	def_bool y
12	depends on !64BIT
13	# Options that are inherently 32-bit kernel only:
14	select ARCH_WANT_IPC_PARSE_VERSION
15	select CLKSRC_I8253
16	select CLONE_BACKWARDS
17	select GENERIC_VDSO_32
18	select HAVE_DEBUG_STACKOVERFLOW
19	select KMAP_LOCAL
20	select MODULES_USE_ELF_REL
21	select OLD_SIGACTION
22	select ARCH_SPLIT_ARG64
23
24config X86_64
25	def_bool y
26	depends on 64BIT
27	# Options that are inherently 64-bit kernel only:
28	select ARCH_HAS_GIGANTIC_PAGE
29	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
30	select ARCH_SUPPORTS_PER_VMA_LOCK
31	select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
32	select HAVE_ARCH_SOFT_DIRTY
33	select MODULES_USE_ELF_RELA
34	select NEED_DMA_MAP_STATE
35	select SWIOTLB
36	select ARCH_HAS_ELFCORE_COMPAT
37	select ZONE_DMA32
38	select EXECMEM if DYNAMIC_FTRACE
39
40config FORCE_DYNAMIC_FTRACE
41	def_bool y
42	depends on X86_32
43	depends on FUNCTION_TRACER
44	select DYNAMIC_FTRACE
45	help
46	  We keep the static function tracing (!DYNAMIC_FTRACE) around
47	  in order to test the non static function tracing in the
48	  generic code, as other architectures still use it. But we
49	  only need to keep it around for x86_64. No need to keep it
50	  for x86_32. For x86_32, force DYNAMIC_FTRACE.
51#
52# Arch settings
53#
54# ( Note that options that are marked 'if X86_64' could in principle be
55#   ported to 32-bit as well. )
56#
57config X86
58	def_bool y
59	#
60	# Note: keep this list sorted alphabetically
61	#
62	select ACPI_LEGACY_TABLES_LOOKUP	if ACPI
63	select ACPI_SYSTEM_POWER_STATES_SUPPORT	if ACPI
64	select ACPI_HOTPLUG_CPU			if ACPI_PROCESSOR && HOTPLUG_CPU
65	select ARCH_32BIT_OFF_T			if X86_32
66	select ARCH_CLOCKSOURCE_INIT
67	select ARCH_CONFIGURES_CPU_MITIGATIONS
68	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
69	select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION
70	select ARCH_ENABLE_MEMORY_HOTPLUG if X86_64
71	select ARCH_ENABLE_MEMORY_HOTREMOVE if MEMORY_HOTPLUG
72	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if (PGTABLE_LEVELS > 2) && (X86_64 || X86_PAE)
73	select ARCH_ENABLE_THP_MIGRATION if X86_64 && TRANSPARENT_HUGEPAGE
74	select ARCH_HAS_ACPI_TABLE_UPGRADE	if ACPI
75	select ARCH_HAS_CACHE_LINE_SIZE
76	select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
77	select ARCH_HAS_CPU_FINALIZE_INIT
78	select ARCH_HAS_CPU_PASID		if IOMMU_SVA
79	select ARCH_HAS_CRC32
80	select ARCH_HAS_CRC_T10DIF		if X86_64
81	select ARCH_HAS_CURRENT_STACK_POINTER
82	select ARCH_HAS_DEBUG_VIRTUAL
83	select ARCH_HAS_DEBUG_VM_PGTABLE	if !X86_PAE
84	select ARCH_HAS_DEVMEM_IS_ALLOWED
85	select ARCH_HAS_DMA_OPS			if GART_IOMMU || XEN
86	select ARCH_HAS_EARLY_DEBUG		if KGDB
87	select ARCH_HAS_ELF_RANDOMIZE
88	select ARCH_HAS_FAST_MULTIPLIER
89	select ARCH_HAS_FORTIFY_SOURCE
90	select ARCH_HAS_GCOV_PROFILE_ALL
91	select ARCH_HAS_KCOV			if X86_64
92	select ARCH_HAS_KERNEL_FPU_SUPPORT
93	select ARCH_HAS_MEM_ENCRYPT
94	select ARCH_HAS_MEMBARRIER_SYNC_CORE
95	select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
96	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
97	select ARCH_HAS_PMEM_API		if X86_64
98	select ARCH_HAS_PREEMPT_LAZY
99	select ARCH_HAS_PTE_DEVMAP		if X86_64
100	select ARCH_HAS_PTE_SPECIAL
101	select ARCH_HAS_HW_PTE_YOUNG
102	select ARCH_HAS_NONLEAF_PMD_YOUNG	if PGTABLE_LEVELS > 2
103	select ARCH_HAS_UACCESS_FLUSHCACHE	if X86_64
104	select ARCH_HAS_COPY_MC			if X86_64
105	select ARCH_HAS_SET_MEMORY
106	select ARCH_HAS_SET_DIRECT_MAP
107	select ARCH_HAS_STRICT_KERNEL_RWX
108	select ARCH_HAS_STRICT_MODULE_RWX
109	select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
110	select ARCH_HAS_SYSCALL_WRAPPER
111	select ARCH_HAS_UBSAN
112	select ARCH_HAS_DEBUG_WX
113	select ARCH_HAS_ZONE_DMA_SET if EXPERT
114	select ARCH_HAVE_NMI_SAFE_CMPXCHG
115	select ARCH_HAVE_EXTRA_ELF_NOTES
116	select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
117	select ARCH_MIGHT_HAVE_ACPI_PDC		if ACPI
118	select ARCH_MIGHT_HAVE_PC_PARPORT
119	select ARCH_MIGHT_HAVE_PC_SERIO
120	select ARCH_STACKWALK
121	select ARCH_SUPPORTS_ACPI
122	select ARCH_SUPPORTS_ATOMIC_RMW
123	select ARCH_SUPPORTS_DEBUG_PAGEALLOC
124	select ARCH_SUPPORTS_PAGE_TABLE_CHECK	if X86_64
125	select ARCH_SUPPORTS_NUMA_BALANCING	if X86_64
126	select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP	if NR_CPUS <= 4096
127	select ARCH_SUPPORTS_CFI_CLANG		if X86_64
128	select ARCH_USES_CFI_TRAPS		if X86_64 && CFI_CLANG
129	select ARCH_SUPPORTS_LTO_CLANG
130	select ARCH_SUPPORTS_LTO_CLANG_THIN
131	select ARCH_SUPPORTS_RT
132	select ARCH_SUPPORTS_AUTOFDO_CLANG
133	select ARCH_SUPPORTS_PROPELLER_CLANG    if X86_64
134	select ARCH_USE_BUILTIN_BSWAP
135	select ARCH_USE_CMPXCHG_LOCKREF		if X86_CMPXCHG64
136	select ARCH_USE_MEMTEST
137	select ARCH_USE_QUEUED_RWLOCKS
138	select ARCH_USE_QUEUED_SPINLOCKS
139	select ARCH_USE_SYM_ANNOTATIONS
140	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
141	select ARCH_WANT_DEFAULT_BPF_JIT	if X86_64
142	select ARCH_WANTS_DYNAMIC_TASK_STRUCT
143	select ARCH_WANTS_NO_INSTR
144	select ARCH_WANT_GENERAL_HUGETLB
145	select ARCH_WANT_HUGE_PMD_SHARE
146	select ARCH_WANT_LD_ORPHAN_WARN
147	select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP	if X86_64
148	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP	if X86_64
149	select ARCH_WANTS_THP_SWAP		if X86_64
150	select ARCH_HAS_PARANOID_L1D_FLUSH
151	select BUILDTIME_TABLE_SORT
152	select CLKEVT_I8253
153	select CLOCKSOURCE_WATCHDOG
154	# Word-size accesses may read uninitialized data past the trailing \0
155	# in strings and cause false KMSAN reports.
156	select DCACHE_WORD_ACCESS		if !KMSAN
157	select DYNAMIC_SIGFRAME
158	select EDAC_ATOMIC_SCRUB
159	select EDAC_SUPPORT
160	select GENERIC_CLOCKEVENTS_BROADCAST	if X86_64 || (X86_32 && X86_LOCAL_APIC)
161	select GENERIC_CLOCKEVENTS_BROADCAST_IDLE	if GENERIC_CLOCKEVENTS_BROADCAST
162	select GENERIC_CLOCKEVENTS_MIN_ADJUST
163	select GENERIC_CMOS_UPDATE
164	select GENERIC_CPU_AUTOPROBE
165	select GENERIC_CPU_DEVICES
166	select GENERIC_CPU_VULNERABILITIES
167	select GENERIC_EARLY_IOREMAP
168	select GENERIC_ENTRY
169	select GENERIC_IOMAP
170	select GENERIC_IRQ_EFFECTIVE_AFF_MASK	if SMP
171	select GENERIC_IRQ_MATRIX_ALLOCATOR	if X86_LOCAL_APIC
172	select GENERIC_IRQ_MIGRATION		if SMP
173	select GENERIC_IRQ_PROBE
174	select GENERIC_IRQ_RESERVATION_MODE
175	select GENERIC_IRQ_SHOW
176	select GENERIC_PENDING_IRQ		if SMP
177	select GENERIC_PTDUMP
178	select GENERIC_SMP_IDLE_THREAD
179	select GENERIC_TIME_VSYSCALL
180	select GENERIC_GETTIMEOFDAY
181	select GENERIC_VDSO_TIME_NS
182	select GENERIC_VDSO_OVERFLOW_PROTECT
183	select GUP_GET_PXX_LOW_HIGH		if X86_PAE
184	select HARDIRQS_SW_RESEND
185	select HARDLOCKUP_CHECK_TIMESTAMP	if X86_64
186	select HAS_IOPORT
187	select HAVE_ACPI_APEI			if ACPI
188	select HAVE_ACPI_APEI_NMI		if ACPI
189	select HAVE_ALIGNED_STRUCT_PAGE
190	select HAVE_ARCH_AUDITSYSCALL
191	select HAVE_ARCH_HUGE_VMAP		if X86_64 || X86_PAE
192	select HAVE_ARCH_HUGE_VMALLOC		if X86_64
193	select HAVE_ARCH_JUMP_LABEL
194	select HAVE_ARCH_JUMP_LABEL_RELATIVE
195	select HAVE_ARCH_KASAN			if X86_64
196	select HAVE_ARCH_KASAN_VMALLOC		if X86_64
197	select HAVE_ARCH_KFENCE
198	select HAVE_ARCH_KMSAN			if X86_64
199	select HAVE_ARCH_KGDB
200	select HAVE_ARCH_MMAP_RND_BITS		if MMU
201	select HAVE_ARCH_MMAP_RND_COMPAT_BITS	if MMU && COMPAT
202	select HAVE_ARCH_COMPAT_MMAP_BASES	if MMU && COMPAT
203	select HAVE_ARCH_PREL32_RELOCATIONS
204	select HAVE_ARCH_SECCOMP_FILTER
205	select HAVE_ARCH_THREAD_STRUCT_WHITELIST
206	select HAVE_ARCH_STACKLEAK
207	select HAVE_ARCH_TRACEHOOK
208	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
209	select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64
210	select HAVE_ARCH_USERFAULTFD_WP         if X86_64 && USERFAULTFD
211	select HAVE_ARCH_USERFAULTFD_MINOR	if X86_64 && USERFAULTFD
212	select HAVE_ARCH_VMAP_STACK		if X86_64
213	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
214	select HAVE_ARCH_WITHIN_STACK_FRAMES
215	select HAVE_ASM_MODVERSIONS
216	select HAVE_CMPXCHG_DOUBLE
217	select HAVE_CMPXCHG_LOCAL
218	select HAVE_CONTEXT_TRACKING_USER		if X86_64
219	select HAVE_CONTEXT_TRACKING_USER_OFFSTACK	if HAVE_CONTEXT_TRACKING_USER
220	select HAVE_C_RECORDMCOUNT
221	select HAVE_OBJTOOL_MCOUNT		if HAVE_OBJTOOL
222	select HAVE_OBJTOOL_NOP_MCOUNT		if HAVE_OBJTOOL_MCOUNT
223	select HAVE_BUILDTIME_MCOUNT_SORT
224	select HAVE_DEBUG_KMEMLEAK
225	select HAVE_DMA_CONTIGUOUS
226	select HAVE_DYNAMIC_FTRACE
227	select HAVE_DYNAMIC_FTRACE_WITH_REGS
228	select HAVE_DYNAMIC_FTRACE_WITH_ARGS	if X86_64
229	select HAVE_FTRACE_REGS_HAVING_PT_REGS	if X86_64
230	select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
231	select HAVE_SAMPLE_FTRACE_DIRECT	if X86_64
232	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI	if X86_64
233	select HAVE_EBPF_JIT
234	select HAVE_EFFICIENT_UNALIGNED_ACCESS
235	select HAVE_EISA
236	select HAVE_EXIT_THREAD
237	select HAVE_GUP_FAST
238	select HAVE_FENTRY			if X86_64 || DYNAMIC_FTRACE
239	select HAVE_FTRACE_GRAPH_FUNC		if HAVE_FUNCTION_GRAPH_TRACER
240	select HAVE_FTRACE_MCOUNT_RECORD
241	select HAVE_FUNCTION_GRAPH_FREGS	if HAVE_FUNCTION_GRAPH_TRACER
242	select HAVE_FUNCTION_GRAPH_TRACER	if X86_32 || (X86_64 && DYNAMIC_FTRACE)
243	select HAVE_FUNCTION_TRACER
244	select HAVE_GCC_PLUGINS
245	select HAVE_HW_BREAKPOINT
246	select HAVE_IOREMAP_PROT
247	select HAVE_IRQ_EXIT_ON_IRQ_STACK	if X86_64
248	select HAVE_IRQ_TIME_ACCOUNTING
249	select HAVE_JUMP_LABEL_HACK		if HAVE_OBJTOOL
250	select HAVE_KERNEL_BZIP2
251	select HAVE_KERNEL_GZIP
252	select HAVE_KERNEL_LZ4
253	select HAVE_KERNEL_LZMA
254	select HAVE_KERNEL_LZO
255	select HAVE_KERNEL_XZ
256	select HAVE_KERNEL_ZSTD
257	select HAVE_KPROBES
258	select HAVE_KPROBES_ON_FTRACE
259	select HAVE_FUNCTION_ERROR_INJECTION
260	select HAVE_KRETPROBES
261	select HAVE_RETHOOK
262	select HAVE_LIVEPATCH			if X86_64
263	select HAVE_MIXED_BREAKPOINTS_REGS
264	select HAVE_MOD_ARCH_SPECIFIC
265	select HAVE_MOVE_PMD
266	select HAVE_MOVE_PUD
267	select HAVE_NOINSTR_HACK		if HAVE_OBJTOOL
268	select HAVE_NMI
269	select HAVE_NOINSTR_VALIDATION		if HAVE_OBJTOOL
270	select HAVE_OBJTOOL			if X86_64
271	select HAVE_OPTPROBES
272	select HAVE_PAGE_SIZE_4KB
273	select HAVE_PCSPKR_PLATFORM
274	select HAVE_PERF_EVENTS
275	select HAVE_PERF_EVENTS_NMI
276	select HAVE_HARDLOCKUP_DETECTOR_PERF	if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
277	select HAVE_PCI
278	select HAVE_PERF_REGS
279	select HAVE_PERF_USER_STACK_DUMP
280	select MMU_GATHER_RCU_TABLE_FREE	if PARAVIRT
281	select MMU_GATHER_MERGE_VMAS
282	select HAVE_POSIX_CPU_TIMERS_TASK_WORK
283	select HAVE_REGS_AND_STACK_ACCESS_API
284	select HAVE_RELIABLE_STACKTRACE		if UNWINDER_ORC || STACK_VALIDATION
285	select HAVE_FUNCTION_ARG_ACCESS_API
286	select HAVE_SETUP_PER_CPU_AREA
287	select HAVE_SOFTIRQ_ON_OWN_STACK
288	select HAVE_STACKPROTECTOR		if CC_HAS_SANE_STACKPROTECTOR
289	select HAVE_STACK_VALIDATION		if HAVE_OBJTOOL
290	select HAVE_STATIC_CALL
291	select HAVE_STATIC_CALL_INLINE		if HAVE_OBJTOOL
292	select HAVE_PREEMPT_DYNAMIC_CALL
293	select HAVE_RSEQ
294	select HAVE_RUST			if X86_64
295	select HAVE_SYSCALL_TRACEPOINTS
296	select HAVE_UACCESS_VALIDATION		if HAVE_OBJTOOL
297	select HAVE_UNSTABLE_SCHED_CLOCK
298	select HAVE_USER_RETURN_NOTIFIER
299	select HAVE_GENERIC_VDSO
300	select VDSO_GETRANDOM			if X86_64
301	select HOTPLUG_PARALLEL			if SMP && X86_64
302	select HOTPLUG_SMT			if SMP
303	select HOTPLUG_SPLIT_STARTUP		if SMP && X86_32
304	select IRQ_FORCED_THREADING
305	select LOCK_MM_AND_FIND_VMA
306	select NEED_PER_CPU_EMBED_FIRST_CHUNK
307	select NEED_PER_CPU_PAGE_FIRST_CHUNK
308	select NEED_SG_DMA_LENGTH
309	select NUMA_MEMBLKS			if NUMA
310	select PCI_DOMAINS			if PCI
311	select PCI_LOCKLESS_CONFIG		if PCI
312	select PERF_EVENTS
313	select RTC_LIB
314	select RTC_MC146818_LIB
315	select SPARSE_IRQ
316	select SYSCTL_EXCEPTION_TRACE
317	select THREAD_INFO_IN_TASK
318	select TRACE_IRQFLAGS_SUPPORT
319	select TRACE_IRQFLAGS_NMI_SUPPORT
320	select USER_STACKTRACE_SUPPORT
321	select HAVE_ARCH_KCSAN			if X86_64
322	select PROC_PID_ARCH_STATUS		if PROC_FS
323	select HAVE_ARCH_NODE_DEV_GROUP		if X86_SGX
324	select FUNCTION_ALIGNMENT_16B		if X86_64 || X86_ALIGNMENT_16
325	select FUNCTION_ALIGNMENT_4B
326	imply IMA_SECURE_AND_OR_TRUSTED_BOOT    if EFI
327	select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
328
329config INSTRUCTION_DECODER
330	def_bool y
331	depends on KPROBES || PERF_EVENTS || UPROBES
332
333config OUTPUT_FORMAT
334	string
335	default "elf32-i386" if X86_32
336	default "elf64-x86-64" if X86_64
337
338config LOCKDEP_SUPPORT
339	def_bool y
340
341config STACKTRACE_SUPPORT
342	def_bool y
343
344config MMU
345	def_bool y
346
347config ARCH_MMAP_RND_BITS_MIN
348	default 28 if 64BIT
349	default 8
350
351config ARCH_MMAP_RND_BITS_MAX
352	default 32 if 64BIT
353	default 16
354
355config ARCH_MMAP_RND_COMPAT_BITS_MIN
356	default 8
357
358config ARCH_MMAP_RND_COMPAT_BITS_MAX
359	default 16
360
361config SBUS
362	bool
363
364config GENERIC_ISA_DMA
365	def_bool y
366	depends on ISA_DMA_API
367
368config GENERIC_CSUM
369	bool
370	default y if KMSAN || KASAN
371
372config GENERIC_BUG
373	def_bool y
374	depends on BUG
375	select GENERIC_BUG_RELATIVE_POINTERS if X86_64
376
377config GENERIC_BUG_RELATIVE_POINTERS
378	bool
379
380config ARCH_MAY_HAVE_PC_FDC
381	def_bool y
382	depends on ISA_DMA_API
383
384config GENERIC_CALIBRATE_DELAY
385	def_bool y
386
387config ARCH_HAS_CPU_RELAX
388	def_bool y
389
390config ARCH_HIBERNATION_POSSIBLE
391	def_bool y
392
393config ARCH_SUSPEND_POSSIBLE
394	def_bool y
395
396config AUDIT_ARCH
397	def_bool y if X86_64
398
399config KASAN_SHADOW_OFFSET
400	hex
401	depends on KASAN
402	default 0xdffffc0000000000
403
404config HAVE_INTEL_TXT
405	def_bool y
406	depends on INTEL_IOMMU && ACPI
407
408config X86_64_SMP
409	def_bool y
410	depends on X86_64 && SMP
411
412config ARCH_SUPPORTS_UPROBES
413	def_bool y
414
415config FIX_EARLYCON_MEM
416	def_bool y
417
418config DYNAMIC_PHYSICAL_MASK
419	bool
420
421config PGTABLE_LEVELS
422	int
423	default 5 if X86_5LEVEL
424	default 4 if X86_64
425	default 3 if X86_PAE
426	default 2
427
428config CC_HAS_SANE_STACKPROTECTOR
429	bool
430	default $(success,$(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC) $(CLANG_FLAGS)) if 64BIT
431	default $(success,$(srctree)/scripts/gcc-x86_32-has-stack-protector.sh $(CC) $(CLANG_FLAGS))
432	help
433	  We have to make sure stack protector is unconditionally disabled if
434	  the compiler produces broken code or if it does not let us control
435	  the segment on 32-bit kernels.
436
437menu "Processor type and features"
438
439config SMP
440	bool "Symmetric multi-processing support"
441	help
442	  This enables support for systems with more than one CPU. If you have
443	  a system with only one CPU, say N. If you have a system with more
444	  than one CPU, say Y.
445
446	  If you say N here, the kernel will run on uni- and multiprocessor
447	  machines, but will use only one CPU of a multiprocessor machine. If
448	  you say Y here, the kernel will run on many, but not all,
449	  uniprocessor machines. On a uniprocessor machine, the kernel
450	  will run faster if you say N here.
451
452	  Note that if you say Y here and choose architecture "586" or
453	  "Pentium" under "Processor family", the kernel will not work on 486
454	  architectures. Similarly, multiprocessor kernels for the "PPro"
455	  architecture may not work on all Pentium based boards.
456
457	  People using multiprocessor machines who say Y here should also say
458	  Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
459	  Management" code will be disabled if you say Y here.
460
461	  See also <file:Documentation/arch/x86/i386/IO-APIC.rst>,
462	  <file:Documentation/admin-guide/lockup-watchdogs.rst> and the SMP-HOWTO available at
463	  <http://www.tldp.org/docs.html#howto>.
464
465	  If you don't know what to do here, say N.
466
467config X86_X2APIC
468	bool "Support x2apic"
469	depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST)
470	help
471	  This enables x2apic support on CPUs that have this feature.
472
473	  This allows 32-bit apic IDs (so it can support very large systems),
474	  and accesses the local apic via MSRs not via mmio.
475
476	  Some Intel systems circa 2022 and later are locked into x2APIC mode
477	  and can not fall back to the legacy APIC modes if SGX or TDX are
478	  enabled in the BIOS. They will boot with very reduced functionality
479	  without enabling this option.
480
481	  If you don't know what to do here, say N.
482
483config X86_POSTED_MSI
484	bool "Enable MSI and MSI-x delivery by posted interrupts"
485	depends on X86_64 && IRQ_REMAP
486	help
487	  This enables MSIs that are under interrupt remapping to be delivered as
488	  posted interrupts to the host kernel. Interrupt throughput can
489	  potentially be improved by coalescing CPU notifications during high
490	  frequency bursts.
491
492	  If you don't know what to do here, say N.
493
494config X86_MPPARSE
495	bool "Enable MPS table" if ACPI
496	default y
497	depends on X86_LOCAL_APIC
498	help
499	  For old smp systems that do not have proper acpi support. Newer systems
500	  (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
501
502config X86_CPU_RESCTRL
503	bool "x86 CPU resource control support"
504	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
505	select KERNFS
506	select PROC_CPU_RESCTRL		if PROC_FS
507	help
508	  Enable x86 CPU resource control support.
509
510	  Provide support for the allocation and monitoring of system resources
511	  usage by the CPU.
512
513	  Intel calls this Intel Resource Director Technology
514	  (Intel(R) RDT). More information about RDT can be found in the
515	  Intel x86 Architecture Software Developer Manual.
516
517	  AMD calls this AMD Platform Quality of Service (AMD QoS).
518	  More information about AMD QoS can be found in the AMD64 Technology
519	  Platform Quality of Service Extensions manual.
520
521	  Say N if unsure.
522
523config X86_FRED
524	bool "Flexible Return and Event Delivery"
525	depends on X86_64
526	help
527	  When enabled, try to use Flexible Return and Event Delivery
528	  instead of the legacy SYSCALL/SYSENTER/IDT architecture for
529	  ring transitions and exception/interrupt handling if the
530	  system supports it.
531
532config X86_BIGSMP
533	bool "Support for big SMP systems with more than 8 CPUs"
534	depends on SMP && X86_32
535	help
536	  This option is needed for the systems that have more than 8 CPUs.
537
538config X86_EXTENDED_PLATFORM
539	bool "Support for extended (non-PC) x86 platforms"
540	default y
541	help
542	  If you disable this option then the kernel will only support
543	  standard PC platforms. (which covers the vast majority of
544	  systems out there.)
545
546	  If you enable this option then you'll be able to select support
547	  for the following non-PC x86 platforms, depending on the value of
548	  CONFIG_64BIT.
549
550	  32-bit platforms (CONFIG_64BIT=n):
551		Goldfish (Android emulator)
552		AMD Elan
553		RDC R-321x SoC
554		SGI 320/540 (Visual Workstation)
555		STA2X11-based (e.g. Northville)
556		Moorestown MID devices
557
558	  64-bit platforms (CONFIG_64BIT=y):
559		Numascale NumaChip
560		ScaleMP vSMP
561		SGI Ultraviolet
562
563	  If you have one of these systems, or if you want to build a
564	  generic distribution kernel, say Y here - otherwise say N.
565
566# This is an alphabetically sorted list of 64 bit extended platforms
567# Please maintain the alphabetic order if and when there are additions
568config X86_NUMACHIP
569	bool "Numascale NumaChip"
570	depends on X86_64
571	depends on X86_EXTENDED_PLATFORM
572	depends on NUMA
573	depends on SMP
574	depends on X86_X2APIC
575	depends on PCI_MMCONFIG
576	help
577	  Adds support for Numascale NumaChip large-SMP systems. Needed to
578	  enable more than ~168 cores.
579	  If you don't have one of these, you should say N here.
580
581config X86_VSMP
582	bool "ScaleMP vSMP"
583	select HYPERVISOR_GUEST
584	select PARAVIRT
585	depends on X86_64 && PCI
586	depends on X86_EXTENDED_PLATFORM
587	depends on SMP
588	help
589	  Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
590	  supposed to run on these EM64T-based machines.  Only choose this option
591	  if you have one of these machines.
592
593config X86_UV
594	bool "SGI Ultraviolet"
595	depends on X86_64
596	depends on X86_EXTENDED_PLATFORM
597	depends on NUMA
598	depends on EFI
599	depends on KEXEC_CORE
600	depends on X86_X2APIC
601	depends on PCI
602	help
603	  This option is needed in order to support SGI Ultraviolet systems.
604	  If you don't have one of these, you should say N here.
605
606# Following is an alphabetically sorted list of 32 bit extended platforms
607# Please maintain the alphabetic order if and when there are additions
608
609config X86_GOLDFISH
610	bool "Goldfish (Virtual Platform)"
611	depends on X86_EXTENDED_PLATFORM
612	help
613	  Enable support for the Goldfish virtual platform used primarily
614	  for Android development. Unless you are building for the Android
615	  Goldfish emulator say N here.
616
617config X86_INTEL_CE
618	bool "CE4100 TV platform"
619	depends on PCI
620	depends on PCI_GODIRECT
621	depends on X86_IO_APIC
622	depends on X86_32
623	depends on X86_EXTENDED_PLATFORM
624	select X86_REBOOTFIXUPS
625	select OF
626	select OF_EARLY_FLATTREE
627	help
628	  Select for the Intel CE media processor (CE4100) SOC.
629	  This option compiles in support for the CE4100 SOC for settop
630	  boxes and media devices.
631
632config X86_INTEL_MID
633	bool "Intel MID platform support"
634	depends on X86_EXTENDED_PLATFORM
635	depends on X86_PLATFORM_DEVICES
636	depends on PCI
637	depends on X86_64 || (PCI_GOANY && X86_32)
638	depends on X86_IO_APIC
639	select I2C
640	select DW_APB_TIMER
641	select INTEL_SCU_PCI
642	help
643	  Select to build a kernel capable of supporting Intel MID (Mobile
644	  Internet Device) platform systems which do not have the PCI legacy
645	  interfaces. If you are building for a PC class system say N here.
646
647	  Intel MID platforms are based on an Intel processor and chipset which
648	  consume less power than most of the x86 derivatives.
649
650config X86_INTEL_QUARK
651	bool "Intel Quark platform support"
652	depends on X86_32
653	depends on X86_EXTENDED_PLATFORM
654	depends on X86_PLATFORM_DEVICES
655	depends on X86_TSC
656	depends on PCI
657	depends on PCI_GOANY
658	depends on X86_IO_APIC
659	select IOSF_MBI
660	select INTEL_IMR
661	select COMMON_CLK
662	help
663	  Select to include support for Quark X1000 SoC.
664	  Say Y here if you have a Quark based system such as the Arduino
665	  compatible Intel Galileo.
666
667config X86_INTEL_LPSS
668	bool "Intel Low Power Subsystem Support"
669	depends on X86 && ACPI && PCI
670	select COMMON_CLK
671	select PINCTRL
672	select IOSF_MBI
673	help
674	  Select to build support for Intel Low Power Subsystem such as
675	  found on Intel Lynxpoint PCH. Selecting this option enables
676	  things like clock tree (common clock framework) and pincontrol
677	  which are needed by the LPSS peripheral drivers.
678
679config X86_AMD_PLATFORM_DEVICE
680	bool "AMD ACPI2Platform devices support"
681	depends on ACPI
682	select COMMON_CLK
683	select PINCTRL
684	help
685	  Select to interpret AMD specific ACPI device to platform device
686	  such as I2C, UART, GPIO found on AMD Carrizo and later chipsets.
687	  I2C and UART depend on COMMON_CLK to set clock. GPIO driver is
688	  implemented under PINCTRL subsystem.
689
690config IOSF_MBI
691	tristate "Intel SoC IOSF Sideband support for SoC platforms"
692	depends on PCI
693	help
694	  This option enables sideband register access support for Intel SoC
695	  platforms. On these platforms the IOSF sideband is used in lieu of
696	  MSR's for some register accesses, mostly but not limited to thermal
697	  and power. Drivers may query the availability of this device to
698	  determine if they need the sideband in order to work on these
699	  platforms. The sideband is available on the following SoC products.
700	  This list is not meant to be exclusive.
701	   - BayTrail
702	   - Braswell
703	   - Quark
704
705	  You should say Y if you are running a kernel on one of these SoC's.
706
707config IOSF_MBI_DEBUG
708	bool "Enable IOSF sideband access through debugfs"
709	depends on IOSF_MBI && DEBUG_FS
710	help
711	  Select this option to expose the IOSF sideband access registers (MCR,
712	  MDR, MCRX) through debugfs to write and read register information from
713	  different units on the SoC. This is most useful for obtaining device
714	  state information for debug and analysis. As this is a general access
715	  mechanism, users of this option would have specific knowledge of the
716	  device they want to access.
717
718	  If you don't require the option or are in doubt, say N.
719
720config X86_RDC321X
721	bool "RDC R-321x SoC"
722	depends on X86_32
723	depends on X86_EXTENDED_PLATFORM
724	select M486
725	select X86_REBOOTFIXUPS
726	help
727	  This option is needed for RDC R-321x system-on-chip, also known
728	  as R-8610-(G).
729	  If you don't have one of these chips, you should say N here.
730
731config X86_32_NON_STANDARD
732	bool "Support non-standard 32-bit SMP architectures"
733	depends on X86_32 && SMP
734	depends on X86_EXTENDED_PLATFORM
735	help
736	  This option compiles in the bigsmp and STA2X11 default
737	  subarchitectures.  It is intended for a generic binary
738	  kernel. If you select them all, kernel will probe it one by
739	  one and will fallback to default.
740
741# Alphabetically sorted list of Non standard 32 bit platforms
742
743config X86_SUPPORTS_MEMORY_FAILURE
744	def_bool y
745	# MCE code calls memory_failure():
746	depends on X86_MCE
747	# On 32-bit this adds too big of NODES_SHIFT and we run out of page flags:
748	# On 32-bit SPARSEMEM adds too big of SECTIONS_WIDTH:
749	depends on X86_64 || !SPARSEMEM
750	select ARCH_SUPPORTS_MEMORY_FAILURE
751
752config STA2X11
753	bool "STA2X11 Companion Chip Support"
754	depends on X86_32_NON_STANDARD && PCI
755	select SWIOTLB
756	select MFD_STA2X11
757	select GPIOLIB
758	help
759	  This adds support for boards based on the STA2X11 IO-Hub,
760	  a.k.a. "ConneXt". The chip is used in place of the standard
761	  PC chipset, so all "standard" peripherals are missing. If this
762	  option is selected the kernel will still be able to boot on
763	  standard PC machines.
764
765config X86_32_IRIS
766	tristate "Eurobraille/Iris poweroff module"
767	depends on X86_32
768	help
769	  The Iris machines from EuroBraille do not have APM or ACPI support
770	  to shut themselves down properly.  A special I/O sequence is
771	  needed to do so, which is what this module does at
772	  kernel shutdown.
773
774	  This is only for Iris machines from EuroBraille.
775
776	  If unused, say N.
777
778config SCHED_OMIT_FRAME_POINTER
779	def_bool y
780	prompt "Single-depth WCHAN output"
781	depends on X86
782	help
783	  Calculate simpler /proc/<PID>/wchan values. If this option
784	  is disabled then wchan values will recurse back to the
785	  caller function. This provides more accurate wchan values,
786	  at the expense of slightly more scheduling overhead.
787
788	  If in doubt, say "Y".
789
790menuconfig HYPERVISOR_GUEST
791	bool "Linux guest support"
792	help
793	  Say Y here to enable options for running Linux under various hyper-
794	  visors. This option enables basic hypervisor detection and platform
795	  setup.
796
797	  If you say N, all options in this submenu will be skipped and
798	  disabled, and Linux guest support won't be built in.
799
800if HYPERVISOR_GUEST
801
802config PARAVIRT
803	bool "Enable paravirtualization code"
804	depends on HAVE_STATIC_CALL
805	help
806	  This changes the kernel so it can modify itself when it is run
807	  under a hypervisor, potentially improving performance significantly
808	  over full virtualization.  However, when run without a hypervisor
809	  the kernel is theoretically slower and slightly larger.
810
811config PARAVIRT_XXL
812	bool
813
814config PARAVIRT_DEBUG
815	bool "paravirt-ops debugging"
816	depends on PARAVIRT && DEBUG_KERNEL
817	help
818	  Enable to debug paravirt_ops internals.  Specifically, BUG if
819	  a paravirt_op is missing when it is called.
820
821config PARAVIRT_SPINLOCKS
822	bool "Paravirtualization layer for spinlocks"
823	depends on PARAVIRT && SMP
824	help
825	  Paravirtualized spinlocks allow a pvops backend to replace the
826	  spinlock implementation with something virtualization-friendly
827	  (for example, block the virtual CPU rather than spinning).
828
829	  It has a minimal impact on native kernels and gives a nice performance
830	  benefit on paravirtualized KVM / Xen kernels.
831
832	  If you are unsure how to answer this question, answer Y.
833
834config X86_HV_CALLBACK_VECTOR
835	def_bool n
836
837source "arch/x86/xen/Kconfig"
838
839config KVM_GUEST
840	bool "KVM Guest support (including kvmclock)"
841	depends on PARAVIRT
842	select PARAVIRT_CLOCK
843	select ARCH_CPUIDLE_HALTPOLL
844	select X86_HV_CALLBACK_VECTOR
845	default y
846	help
847	  This option enables various optimizations for running under the KVM
848	  hypervisor. It includes a paravirtualized clock, so that instead
849	  of relying on a PIT (or probably other) emulation by the
850	  underlying device model, the host provides the guest with
851	  timing infrastructure such as time of day, and system time
852
853config ARCH_CPUIDLE_HALTPOLL
854	def_bool n
855	prompt "Disable host haltpoll when loading haltpoll driver"
856	help
857	  If virtualized under KVM, disable host haltpoll.
858
859config PVH
860	bool "Support for running PVH guests"
861	help
862	  This option enables the PVH entry point for guest virtual machines
863	  as specified in the x86/HVM direct boot ABI.
864
865config PARAVIRT_TIME_ACCOUNTING
866	bool "Paravirtual steal time accounting"
867	depends on PARAVIRT
868	help
869	  Select this option to enable fine granularity task steal time
870	  accounting. Time spent executing other tasks in parallel with
871	  the current vCPU is discounted from the vCPU power. To account for
872	  that, there can be a small performance impact.
873
874	  If in doubt, say N here.
875
876config PARAVIRT_CLOCK
877	bool
878
879config JAILHOUSE_GUEST
880	bool "Jailhouse non-root cell support"
881	depends on X86_64 && PCI
882	select X86_PM_TIMER
883	help
884	  This option allows to run Linux as guest in a Jailhouse non-root
885	  cell. You can leave this option disabled if you only want to start
886	  Jailhouse and run Linux afterwards in the root cell.
887
888config ACRN_GUEST
889	bool "ACRN Guest support"
890	depends on X86_64
891	select X86_HV_CALLBACK_VECTOR
892	help
893	  This option allows to run Linux as guest in the ACRN hypervisor. ACRN is
894	  a flexible, lightweight reference open-source hypervisor, built with
895	  real-time and safety-criticality in mind. It is built for embedded
896	  IOT with small footprint and real-time features. More details can be
897	  found in https://projectacrn.org/.
898
899config INTEL_TDX_GUEST
900	bool "Intel TDX (Trust Domain Extensions) - Guest Support"
901	depends on X86_64 && CPU_SUP_INTEL
902	depends on X86_X2APIC
903	depends on EFI_STUB
904	select ARCH_HAS_CC_PLATFORM
905	select X86_MEM_ENCRYPT
906	select X86_MCE
907	select UNACCEPTED_MEMORY
908	help
909	  Support running as a guest under Intel TDX.  Without this support,
910	  the guest kernel can not boot or run under TDX.
911	  TDX includes memory encryption and integrity capabilities
912	  which protect the confidentiality and integrity of guest
913	  memory contents and CPU state. TDX guests are protected from
914	  some attacks from the VMM.
915
916endif # HYPERVISOR_GUEST
917
918source "arch/x86/Kconfig.cpu"
919
920config HPET_TIMER
921	def_bool X86_64
922	prompt "HPET Timer Support" if X86_32
923	help
924	  Use the IA-PC HPET (High Precision Event Timer) to manage
925	  time in preference to the PIT and RTC, if a HPET is
926	  present.
927	  HPET is the next generation timer replacing legacy 8254s.
928	  The HPET provides a stable time base on SMP
929	  systems, unlike the TSC, but it is more expensive to access,
930	  as it is off-chip.  The interface used is documented
931	  in the HPET spec, revision 1.
932
933	  You can safely choose Y here.  However, HPET will only be
934	  activated if the platform and the BIOS support this feature.
935	  Otherwise the 8254 will be used for timing services.
936
937	  Choose N to continue using the legacy 8254 timer.
938
939config HPET_EMULATE_RTC
940	def_bool y
941	depends on HPET_TIMER && (RTC_DRV_CMOS=m || RTC_DRV_CMOS=y)
942
943# Mark as expert because too many people got it wrong.
944# The code disables itself when not needed.
945config DMI
946	default y
947	select DMI_SCAN_MACHINE_NON_EFI_FALLBACK
948	bool "Enable DMI scanning" if EXPERT
949	help
950	  Enabled scanning of DMI to identify machine quirks. Say Y
951	  here unless you have verified that your setup is not
952	  affected by entries in the DMI blacklist. Required by PNP
953	  BIOS code.
954
955config GART_IOMMU
956	bool "Old AMD GART IOMMU support"
957	select IOMMU_HELPER
958	select SWIOTLB
959	depends on X86_64 && PCI && AMD_NB
960	help
961	  Provides a driver for older AMD Athlon64/Opteron/Turion/Sempron
962	  GART based hardware IOMMUs.
963
964	  The GART supports full DMA access for devices with 32-bit access
965	  limitations, on systems with more than 3 GB. This is usually needed
966	  for USB, sound, many IDE/SATA chipsets and some other devices.
967
968	  Newer systems typically have a modern AMD IOMMU, supported via
969	  the CONFIG_AMD_IOMMU=y config option.
970
971	  In normal configurations this driver is only active when needed:
972	  there's more than 3 GB of memory and the system contains a
973	  32-bit limited device.
974
975	  If unsure, say Y.
976
977config BOOT_VESA_SUPPORT
978	bool
979	help
980	  If true, at least one selected framebuffer driver can take advantage
981	  of VESA video modes set at an early boot stage via the vga= parameter.
982
983config MAXSMP
984	bool "Enable Maximum number of SMP Processors and NUMA Nodes"
985	depends on X86_64 && SMP && DEBUG_KERNEL
986	select CPUMASK_OFFSTACK
987	help
988	  Enable maximum number of CPUS and NUMA Nodes for this architecture.
989	  If unsure, say N.
990
991#
992# The maximum number of CPUs supported:
993#
994# The main config value is NR_CPUS, which defaults to NR_CPUS_DEFAULT,
995# and which can be configured interactively in the
996# [NR_CPUS_RANGE_BEGIN ... NR_CPUS_RANGE_END] range.
997#
998# The ranges are different on 32-bit and 64-bit kernels, depending on
999# hardware capabilities and scalability features of the kernel.
1000#
1001# ( If MAXSMP is enabled we just use the highest possible value and disable
1002#   interactive configuration. )
1003#
1004
1005config NR_CPUS_RANGE_BEGIN
1006	int
1007	default NR_CPUS_RANGE_END if MAXSMP
1008	default    1 if !SMP
1009	default    2
1010
1011config NR_CPUS_RANGE_END
1012	int
1013	depends on X86_32
1014	default   64 if  SMP &&  X86_BIGSMP
1015	default    8 if  SMP && !X86_BIGSMP
1016	default    1 if !SMP
1017
1018config NR_CPUS_RANGE_END
1019	int
1020	depends on X86_64
1021	default 8192 if  SMP && CPUMASK_OFFSTACK
1022	default  512 if  SMP && !CPUMASK_OFFSTACK
1023	default    1 if !SMP
1024
1025config NR_CPUS_DEFAULT
1026	int
1027	depends on X86_32
1028	default   32 if  X86_BIGSMP
1029	default    8 if  SMP
1030	default    1 if !SMP
1031
1032config NR_CPUS_DEFAULT
1033	int
1034	depends on X86_64
1035	default 8192 if  MAXSMP
1036	default   64 if  SMP
1037	default    1 if !SMP
1038
1039config NR_CPUS
1040	int "Maximum number of CPUs" if SMP && !MAXSMP
1041	range NR_CPUS_RANGE_BEGIN NR_CPUS_RANGE_END
1042	default NR_CPUS_DEFAULT
1043	help
1044	  This allows you to specify the maximum number of CPUs which this
1045	  kernel will support.  If CPUMASK_OFFSTACK is enabled, the maximum
1046	  supported value is 8192, otherwise the maximum value is 512.  The
1047	  minimum value which makes sense is 2.
1048
1049	  This is purely to save memory: each supported CPU adds about 8KB
1050	  to the kernel image.
1051
1052config SCHED_CLUSTER
1053	bool "Cluster scheduler support"
1054	depends on SMP
1055	default y
1056	help
1057	  Cluster scheduler support improves the CPU scheduler's decision
1058	  making when dealing with machines that have clusters of CPUs.
1059	  Cluster usually means a couple of CPUs which are placed closely
1060	  by sharing mid-level caches, last-level cache tags or internal
1061	  busses.
1062
1063config SCHED_SMT
1064	def_bool y if SMP
1065
1066config SCHED_MC
1067	def_bool y
1068	prompt "Multi-core scheduler support"
1069	depends on SMP
1070	help
1071	  Multi-core scheduler support improves the CPU scheduler's decision
1072	  making when dealing with multi-core CPU chips at a cost of slightly
1073	  increased overhead in some places. If unsure say N here.
1074
1075config SCHED_MC_PRIO
1076	bool "CPU core priorities scheduler support"
1077	depends on SCHED_MC
1078	select X86_INTEL_PSTATE if CPU_SUP_INTEL
1079	select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI
1080	select CPU_FREQ
1081	default y
1082	help
1083	  Intel Turbo Boost Max Technology 3.0 enabled CPUs have a
1084	  core ordering determined at manufacturing time, which allows
1085	  certain cores to reach higher turbo frequencies (when running
1086	  single threaded workloads) than others.
1087
1088	  Enabling this kernel feature teaches the scheduler about
1089	  the TBM3 (aka ITMT) priority order of the CPU cores and adjusts the
1090	  scheduler's CPU selection logic accordingly, so that higher
1091	  overall system performance can be achieved.
1092
1093	  This feature will have no effect on CPUs without this feature.
1094
1095	  If unsure say Y here.
1096
1097config UP_LATE_INIT
1098	def_bool y
1099	depends on !SMP && X86_LOCAL_APIC
1100
1101config X86_UP_APIC
1102	bool "Local APIC support on uniprocessors" if !PCI_MSI
1103	default PCI_MSI
1104	depends on X86_32 && !SMP && !X86_32_NON_STANDARD
1105	help
1106	  A local APIC (Advanced Programmable Interrupt Controller) is an
1107	  integrated interrupt controller in the CPU. If you have a single-CPU
1108	  system which has a processor with a local APIC, you can say Y here to
1109	  enable and use it. If you say Y here even though your machine doesn't
1110	  have a local APIC, then the kernel will still run with no slowdown at
1111	  all. The local APIC supports CPU-generated self-interrupts (timer,
1112	  performance counters), and the NMI watchdog which detects hard
1113	  lockups.
1114
1115config X86_UP_IOAPIC
1116	bool "IO-APIC support on uniprocessors"
1117	depends on X86_UP_APIC
1118	help
1119	  An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
1120	  SMP-capable replacement for PC-style interrupt controllers. Most
1121	  SMP systems and many recent uniprocessor systems have one.
1122
1123	  If you have a single-CPU system with an IO-APIC, you can say Y here
1124	  to use it. If you say Y here even though your machine doesn't have
1125	  an IO-APIC, then the kernel will still run with no slowdown at all.
1126
1127config X86_LOCAL_APIC
1128	def_bool y
1129	depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
1130	select IRQ_DOMAIN_HIERARCHY
1131
1132config ACPI_MADT_WAKEUP
1133	def_bool y
1134	depends on X86_64
1135	depends on ACPI
1136	depends on SMP
1137	depends on X86_LOCAL_APIC
1138
1139config X86_IO_APIC
1140	def_bool y
1141	depends on X86_LOCAL_APIC || X86_UP_IOAPIC
1142
1143config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
1144	bool "Reroute for broken boot IRQs"
1145	depends on X86_IO_APIC
1146	help
1147	  This option enables a workaround that fixes a source of
1148	  spurious interrupts. This is recommended when threaded
1149	  interrupt handling is used on systems where the generation of
1150	  superfluous "boot interrupts" cannot be disabled.
1151
1152	  Some chipsets generate a legacy INTx "boot IRQ" when the IRQ
1153	  entry in the chipset's IO-APIC is masked (as, e.g. the RT
1154	  kernel does during interrupt handling). On chipsets where this
1155	  boot IRQ generation cannot be disabled, this workaround keeps
1156	  the original IRQ line masked so that only the equivalent "boot
1157	  IRQ" is delivered to the CPUs. The workaround also tells the
1158	  kernel to set up the IRQ handler on the boot IRQ line. In this
1159	  way only one interrupt is delivered to the kernel. Otherwise
1160	  the spurious second interrupt may cause the kernel to bring
1161	  down (vital) interrupt lines.
1162
1163	  Only affects "broken" chipsets. Interrupt sharing may be
1164	  increased on these systems.
1165
1166config X86_MCE
1167	bool "Machine Check / overheating reporting"
1168	select GENERIC_ALLOCATOR
1169	default y
1170	help
1171	  Machine Check support allows the processor to notify the
1172	  kernel if it detects a problem (e.g. overheating, data corruption).
1173	  The action the kernel takes depends on the severity of the problem,
1174	  ranging from warning messages to halting the machine.
1175
1176config X86_MCELOG_LEGACY
1177	bool "Support for deprecated /dev/mcelog character device"
1178	depends on X86_MCE
1179	help
1180	  Enable support for /dev/mcelog which is needed by the old mcelog
1181	  userspace logging daemon. Consider switching to the new generation
1182	  rasdaemon solution.
1183
1184config X86_MCE_INTEL
1185	def_bool y
1186	prompt "Intel MCE features"
1187	depends on X86_MCE && X86_LOCAL_APIC
1188	help
1189	  Additional support for intel specific MCE features such as
1190	  the thermal monitor.
1191
1192config X86_MCE_AMD
1193	def_bool y
1194	prompt "AMD MCE features"
1195	depends on X86_MCE && X86_LOCAL_APIC
1196	help
1197	  Additional support for AMD specific MCE features such as
1198	  the DRAM Error Threshold.
1199
1200config X86_ANCIENT_MCE
1201	bool "Support for old Pentium 5 / WinChip machine checks"
1202	depends on X86_32 && X86_MCE
1203	help
1204	  Include support for machine check handling on old Pentium 5 or WinChip
1205	  systems. These typically need to be enabled explicitly on the command
1206	  line.
1207
1208config X86_MCE_THRESHOLD
1209	depends on X86_MCE_AMD || X86_MCE_INTEL
1210	def_bool y
1211
1212config X86_MCE_INJECT
1213	depends on X86_MCE && X86_LOCAL_APIC && DEBUG_FS
1214	tristate "Machine check injector support"
1215	help
1216	  Provide support for injecting machine checks for testing purposes.
1217	  If you don't know what a machine check is and you don't do kernel
1218	  QA it is safe to say n.
1219
1220source "arch/x86/events/Kconfig"
1221
1222config X86_LEGACY_VM86
1223	bool "Legacy VM86 support"
1224	depends on X86_32
1225	help
1226	  This option allows user programs to put the CPU into V8086
1227	  mode, which is an 80286-era approximation of 16-bit real mode.
1228
1229	  Some very old versions of X and/or vbetool require this option
1230	  for user mode setting.  Similarly, DOSEMU will use it if
1231	  available to accelerate real mode DOS programs.  However, any
1232	  recent version of DOSEMU, X, or vbetool should be fully
1233	  functional even without kernel VM86 support, as they will all
1234	  fall back to software emulation. Nevertheless, if you are using
1235	  a 16-bit DOS program where 16-bit performance matters, vm86
1236	  mode might be faster than emulation and you might want to
1237	  enable this option.
1238
1239	  Note that any app that works on a 64-bit kernel is unlikely to
1240	  need this option, as 64-bit kernels don't, and can't, support
1241	  V8086 mode. This option is also unrelated to 16-bit protected
1242	  mode and is not needed to run most 16-bit programs under Wine.
1243
1244	  Enabling this option increases the complexity of the kernel
1245	  and slows down exception handling a tiny bit.
1246
1247	  If unsure, say N here.
1248
1249config VM86
1250	bool
1251	default X86_LEGACY_VM86
1252
1253config X86_16BIT
1254	bool "Enable support for 16-bit segments" if EXPERT
1255	default y
1256	depends on MODIFY_LDT_SYSCALL
1257	help
1258	  This option is required by programs like Wine to run 16-bit
1259	  protected mode legacy code on x86 processors.  Disabling
1260	  this option saves about 300 bytes on i386, or around 6K text
1261	  plus 16K runtime memory on x86-64,
1262
1263config X86_ESPFIX32
1264	def_bool y
1265	depends on X86_16BIT && X86_32
1266
1267config X86_ESPFIX64
1268	def_bool y
1269	depends on X86_16BIT && X86_64
1270
1271config X86_VSYSCALL_EMULATION
1272	bool "Enable vsyscall emulation" if EXPERT
1273	default y
1274	depends on X86_64
1275	help
1276	  This enables emulation of the legacy vsyscall page.  Disabling
1277	  it is roughly equivalent to booting with vsyscall=none, except
1278	  that it will also disable the helpful warning if a program
1279	  tries to use a vsyscall.  With this option set to N, offending
1280	  programs will just segfault, citing addresses of the form
1281	  0xffffffffff600?00.
1282
1283	  This option is required by many programs built before 2013, and
1284	  care should be used even with newer programs if set to N.
1285
1286	  Disabling this option saves about 7K of kernel size and
1287	  possibly 4K of additional runtime pagetable memory.
1288
1289config X86_IOPL_IOPERM
1290	bool "IOPERM and IOPL Emulation"
1291	default y
1292	help
1293	  This enables the ioperm() and iopl() syscalls which are necessary
1294	  for legacy applications.
1295
1296	  Legacy IOPL support is an overbroad mechanism which allows user
1297	  space aside of accessing all 65536 I/O ports also to disable
1298	  interrupts. To gain this access the caller needs CAP_SYS_RAWIO
1299	  capabilities and permission from potentially active security
1300	  modules.
1301
1302	  The emulation restricts the functionality of the syscall to
1303	  only allowing the full range I/O port access, but prevents the
1304	  ability to disable interrupts from user space which would be
1305	  granted if the hardware IOPL mechanism would be used.
1306
1307config TOSHIBA
1308	tristate "Toshiba Laptop support"
1309	depends on X86_32
1310	help
1311	  This adds a driver to safely access the System Management Mode of
1312	  the CPU on Toshiba portables with a genuine Toshiba BIOS. It does
1313	  not work on models with a Phoenix BIOS. The System Management Mode
1314	  is used to set the BIOS and power saving options on Toshiba portables.
1315
1316	  For information on utilities to make use of this driver see the
1317	  Toshiba Linux utilities web site at:
1318	  <http://www.buzzard.org.uk/toshiba/>.
1319
1320	  Say Y if you intend to run this kernel on a Toshiba portable.
1321	  Say N otherwise.
1322
1323config X86_REBOOTFIXUPS
1324	bool "Enable X86 board specific fixups for reboot"
1325	depends on X86_32
1326	help
1327	  This enables chipset and/or board specific fixups to be done
1328	  in order to get reboot to work correctly. This is only needed on
1329	  some combinations of hardware and BIOS. The symptom, for which
1330	  this config is intended, is when reboot ends with a stalled/hung
1331	  system.
1332
1333	  Currently, the only fixup is for the Geode machines using
1334	  CS5530A and CS5536 chipsets and the RDC R-321x SoC.
1335
1336	  Say Y if you want to enable the fixup. Currently, it's safe to
1337	  enable this option even if you don't need it.
1338	  Say N otherwise.
1339
1340config MICROCODE
1341	def_bool y
1342	depends on CPU_SUP_AMD || CPU_SUP_INTEL
1343
1344config MICROCODE_INITRD32
1345	def_bool y
1346	depends on MICROCODE && X86_32 && BLK_DEV_INITRD
1347
1348config MICROCODE_LATE_LOADING
1349	bool "Late microcode loading (DANGEROUS)"
1350	default n
1351	depends on MICROCODE && SMP
1352	help
1353	  Loading microcode late, when the system is up and executing instructions
1354	  is a tricky business and should be avoided if possible. Just the sequence
1355	  of synchronizing all cores and SMT threads is one fragile dance which does
1356	  not guarantee that cores might not softlock after the loading. Therefore,
1357	  use this at your own risk. Late loading taints the kernel unless the
1358	  microcode header indicates that it is safe for late loading via the
1359	  minimal revision check. This minimal revision check can be enforced on
1360	  the kernel command line with "microcode.minrev=Y".
1361
1362config MICROCODE_LATE_FORCE_MINREV
1363	bool "Enforce late microcode loading minimal revision check"
1364	default n
1365	depends on MICROCODE_LATE_LOADING
1366	help
1367	  To prevent that users load microcode late which modifies already
1368	  in use features, newer microcode patches have a minimum revision field
1369	  in the microcode header, which tells the kernel which minimum
1370	  revision must be active in the CPU to safely load that new microcode
1371	  late into the running system. If disabled the check will not
1372	  be enforced but the kernel will be tainted when the minimal
1373	  revision check fails.
1374
1375	  This minimal revision check can also be controlled via the
1376	  "microcode.minrev" parameter on the kernel command line.
1377
1378	  If unsure say Y.
1379
1380config X86_MSR
1381	tristate "/dev/cpu/*/msr - Model-specific register support"
1382	help
1383	  This device gives privileged processes access to the x86
1384	  Model-Specific Registers (MSRs).  It is a character device with
1385	  major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr.
1386	  MSR accesses are directed to a specific CPU on multi-processor
1387	  systems.
1388
1389config X86_CPUID
1390	tristate "/dev/cpu/*/cpuid - CPU information support"
1391	help
1392	  This device gives processes access to the x86 CPUID instruction to
1393	  be executed on a specific processor.  It is a character device
1394	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
1395	  /dev/cpu/31/cpuid.
1396
1397choice
1398	prompt "High Memory Support"
1399	default HIGHMEM4G
1400	depends on X86_32
1401
1402config NOHIGHMEM
1403	bool "off"
1404	help
1405	  Linux can use up to 64 Gigabytes of physical memory on x86 systems.
1406	  However, the address space of 32-bit x86 processors is only 4
1407	  Gigabytes large. That means that, if you have a large amount of
1408	  physical memory, not all of it can be "permanently mapped" by the
1409	  kernel. The physical memory that's not permanently mapped is called
1410	  "high memory".
1411
1412	  If you are compiling a kernel which will never run on a machine with
1413	  more than 1 Gigabyte total physical RAM, answer "off" here (default
1414	  choice and suitable for most users). This will result in a "3GB/1GB"
1415	  split: 3GB are mapped so that each process sees a 3GB virtual memory
1416	  space and the remaining part of the 4GB virtual memory space is used
1417	  by the kernel to permanently map as much physical memory as
1418	  possible.
1419
1420	  If the machine has between 1 and 4 Gigabytes physical RAM, then
1421	  answer "4GB" here.
1422
1423	  If more than 4 Gigabytes is used then answer "64GB" here. This
1424	  selection turns Intel PAE (Physical Address Extension) mode on.
1425	  PAE implements 3-level paging on IA32 processors. PAE is fully
1426	  supported by Linux, PAE mode is implemented on all recent Intel
1427	  processors (Pentium Pro and better). NOTE: If you say "64GB" here,
1428	  then the kernel will not boot on CPUs that don't support PAE!
1429
1430	  The actual amount of total physical memory will either be
1431	  auto detected or can be forced by using a kernel command line option
1432	  such as "mem=256M". (Try "man bootparam" or see the documentation of
1433	  your boot loader (lilo or loadlin) about how to pass options to the
1434	  kernel at boot time.)
1435
1436	  If unsure, say "off".
1437
1438config HIGHMEM4G
1439	bool "4GB"
1440	help
1441	  Select this if you have a 32-bit processor and between 1 and 4
1442	  gigabytes of physical RAM.
1443
1444config HIGHMEM64G
1445	bool "64GB"
1446	depends on X86_HAVE_PAE
1447	select X86_PAE
1448	help
1449	  Select this if you have a 32-bit processor and more than 4
1450	  gigabytes of physical RAM.
1451
1452endchoice
1453
1454choice
1455	prompt "Memory split" if EXPERT
1456	default VMSPLIT_3G
1457	depends on X86_32
1458	help
1459	  Select the desired split between kernel and user memory.
1460
1461	  If the address range available to the kernel is less than the
1462	  physical memory installed, the remaining memory will be available
1463	  as "high memory". Accessing high memory is a little more costly
1464	  than low memory, as it needs to be mapped into the kernel first.
1465	  Note that increasing the kernel address space limits the range
1466	  available to user programs, making the address space there
1467	  tighter.  Selecting anything other than the default 3G/1G split
1468	  will also likely make your kernel incompatible with binary-only
1469	  kernel modules.
1470
1471	  If you are not absolutely sure what you are doing, leave this
1472	  option alone!
1473
1474	config VMSPLIT_3G
1475		bool "3G/1G user/kernel split"
1476	config VMSPLIT_3G_OPT
1477		depends on !X86_PAE
1478		bool "3G/1G user/kernel split (for full 1G low memory)"
1479	config VMSPLIT_2G
1480		bool "2G/2G user/kernel split"
1481	config VMSPLIT_2G_OPT
1482		depends on !X86_PAE
1483		bool "2G/2G user/kernel split (for full 2G low memory)"
1484	config VMSPLIT_1G
1485		bool "1G/3G user/kernel split"
1486endchoice
1487
1488config PAGE_OFFSET
1489	hex
1490	default 0xB0000000 if VMSPLIT_3G_OPT
1491	default 0x80000000 if VMSPLIT_2G
1492	default 0x78000000 if VMSPLIT_2G_OPT
1493	default 0x40000000 if VMSPLIT_1G
1494	default 0xC0000000
1495	depends on X86_32
1496
1497config HIGHMEM
1498	def_bool y
1499	depends on X86_32 && (HIGHMEM64G || HIGHMEM4G)
1500
1501config X86_PAE
1502	bool "PAE (Physical Address Extension) Support"
1503	depends on X86_32 && X86_HAVE_PAE
1504	select PHYS_ADDR_T_64BIT
1505	select SWIOTLB
1506	help
1507	  PAE is required for NX support, and furthermore enables
1508	  larger swapspace support for non-overcommit purposes. It
1509	  has the cost of more pagetable lookup overhead, and also
1510	  consumes more pagetable space per process.
1511
1512config X86_5LEVEL
1513	bool "Enable 5-level page tables support"
1514	default y
1515	select DYNAMIC_MEMORY_LAYOUT
1516	select SPARSEMEM_VMEMMAP
1517	depends on X86_64
1518	help
1519	  5-level paging enables access to larger address space:
1520	  up to 128 PiB of virtual address space and 4 PiB of
1521	  physical address space.
1522
1523	  It will be supported by future Intel CPUs.
1524
1525	  A kernel with the option enabled can be booted on machines that
1526	  support 4- or 5-level paging.
1527
1528	  See Documentation/arch/x86/x86_64/5level-paging.rst for more
1529	  information.
1530
1531	  Say N if unsure.
1532
1533config X86_DIRECT_GBPAGES
1534	def_bool y
1535	depends on X86_64
1536	help
1537	  Certain kernel features effectively disable kernel
1538	  linear 1 GB mappings (even if the CPU otherwise
1539	  supports them), so don't confuse the user by printing
1540	  that we have them enabled.
1541
1542config X86_CPA_STATISTICS
1543	bool "Enable statistic for Change Page Attribute"
1544	depends on DEBUG_FS
1545	help
1546	  Expose statistics about the Change Page Attribute mechanism, which
1547	  helps to determine the effectiveness of preserving large and huge
1548	  page mappings when mapping protections are changed.
1549
1550config X86_MEM_ENCRYPT
1551	select ARCH_HAS_FORCE_DMA_UNENCRYPTED
1552	select DYNAMIC_PHYSICAL_MASK
1553	def_bool n
1554
1555config AMD_MEM_ENCRYPT
1556	bool "AMD Secure Memory Encryption (SME) support"
1557	depends on X86_64 && CPU_SUP_AMD
1558	depends on EFI_STUB
1559	select DMA_COHERENT_POOL
1560	select ARCH_USE_MEMREMAP_PROT
1561	select INSTRUCTION_DECODER
1562	select ARCH_HAS_CC_PLATFORM
1563	select X86_MEM_ENCRYPT
1564	select UNACCEPTED_MEMORY
1565	select CRYPTO_LIB_AESGCM
1566	help
1567	  Say yes to enable support for the encryption of system memory.
1568	  This requires an AMD processor that supports Secure Memory
1569	  Encryption (SME).
1570
1571# Common NUMA Features
1572config NUMA
1573	bool "NUMA Memory Allocation and Scheduler Support"
1574	depends on SMP
1575	depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
1576	default y if X86_BIGSMP
1577	select USE_PERCPU_NUMA_NODE_ID
1578	select OF_NUMA if OF
1579	help
1580	  Enable NUMA (Non-Uniform Memory Access) support.
1581
1582	  The kernel will try to allocate memory used by a CPU on the
1583	  local memory controller of the CPU and add some more
1584	  NUMA awareness to the kernel.
1585
1586	  For 64-bit this is recommended if the system is Intel Core i7
1587	  (or later), AMD Opteron, or EM64T NUMA.
1588
1589	  For 32-bit this is only needed if you boot a 32-bit
1590	  kernel on a 64-bit NUMA platform.
1591
1592	  Otherwise, you should say N.
1593
1594config AMD_NUMA
1595	def_bool y
1596	prompt "Old style AMD Opteron NUMA detection"
1597	depends on X86_64 && NUMA && PCI
1598	help
1599	  Enable AMD NUMA node topology detection.  You should say Y here if
1600	  you have a multi processor AMD system. This uses an old method to
1601	  read the NUMA configuration directly from the builtin Northbridge
1602	  of Opteron. It is recommended to use X86_64_ACPI_NUMA instead,
1603	  which also takes priority if both are compiled in.
1604
1605config X86_64_ACPI_NUMA
1606	def_bool y
1607	prompt "ACPI NUMA detection"
1608	depends on X86_64 && NUMA && ACPI && PCI
1609	select ACPI_NUMA
1610	help
1611	  Enable ACPI SRAT based node topology detection.
1612
1613config NODES_SHIFT
1614	int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP
1615	range 1 10
1616	default "10" if MAXSMP
1617	default "6" if X86_64
1618	default "3"
1619	depends on NUMA
1620	help
1621	  Specify the maximum number of NUMA Nodes available on the target
1622	  system.  Increases memory reserved to accommodate various tables.
1623
1624config ARCH_FLATMEM_ENABLE
1625	def_bool y
1626	depends on X86_32 && !NUMA
1627
1628config ARCH_SPARSEMEM_ENABLE
1629	def_bool y
1630	depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD
1631	select SPARSEMEM_STATIC if X86_32
1632	select SPARSEMEM_VMEMMAP_ENABLE if X86_64
1633
1634config ARCH_SPARSEMEM_DEFAULT
1635	def_bool X86_64 || (NUMA && X86_32)
1636
1637config ARCH_SELECT_MEMORY_MODEL
1638	def_bool y
1639	depends on ARCH_SPARSEMEM_ENABLE && ARCH_FLATMEM_ENABLE
1640
1641config ARCH_MEMORY_PROBE
1642	bool "Enable sysfs memory/probe interface"
1643	depends on MEMORY_HOTPLUG
1644	help
1645	  This option enables a sysfs memory/probe interface for testing.
1646	  See Documentation/admin-guide/mm/memory-hotplug.rst for more information.
1647	  If you are unsure how to answer this question, answer N.
1648
1649config ARCH_PROC_KCORE_TEXT
1650	def_bool y
1651	depends on X86_64 && PROC_KCORE
1652
1653config ILLEGAL_POINTER_VALUE
1654	hex
1655	default 0 if X86_32
1656	default 0xdead000000000000 if X86_64
1657
1658config X86_PMEM_LEGACY_DEVICE
1659	bool
1660
1661config X86_PMEM_LEGACY
1662	tristate "Support non-standard NVDIMMs and ADR protected memory"
1663	depends on PHYS_ADDR_T_64BIT
1664	depends on BLK_DEV
1665	select X86_PMEM_LEGACY_DEVICE
1666	select NUMA_KEEP_MEMINFO if NUMA
1667	select LIBNVDIMM
1668	help
1669	  Treat memory marked using the non-standard e820 type of 12 as used
1670	  by the Intel Sandy Bridge-EP reference BIOS as protected memory.
1671	  The kernel will offer these regions to the 'pmem' driver so
1672	  they can be used for persistent storage.
1673
1674	  Say Y if unsure.
1675
1676config HIGHPTE
1677	bool "Allocate 3rd-level pagetables from highmem"
1678	depends on HIGHMEM
1679	help
1680	  The VM uses one page table entry for each page of physical memory.
1681	  For systems with a lot of RAM, this can be wasteful of precious
1682	  low memory.  Setting this option will put user-space page table
1683	  entries in high memory.
1684
1685config X86_CHECK_BIOS_CORRUPTION
1686	bool "Check for low memory corruption"
1687	help
1688	  Periodically check for memory corruption in low memory, which
1689	  is suspected to be caused by BIOS.  Even when enabled in the
1690	  configuration, it is disabled at runtime.  Enable it by
1691	  setting "memory_corruption_check=1" on the kernel command
1692	  line.  By default it scans the low 64k of memory every 60
1693	  seconds; see the memory_corruption_check_size and
1694	  memory_corruption_check_period parameters in
1695	  Documentation/admin-guide/kernel-parameters.rst to adjust this.
1696
1697	  When enabled with the default parameters, this option has
1698	  almost no overhead, as it reserves a relatively small amount
1699	  of memory and scans it infrequently.  It both detects corruption
1700	  and prevents it from affecting the running system.
1701
1702	  It is, however, intended as a diagnostic tool; if repeatable
1703	  BIOS-originated corruption always affects the same memory,
1704	  you can use memmap= to prevent the kernel from using that
1705	  memory.
1706
1707config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
1708	bool "Set the default setting of memory_corruption_check"
1709	depends on X86_CHECK_BIOS_CORRUPTION
1710	default y
1711	help
1712	  Set whether the default state of memory_corruption_check is
1713	  on or off.
1714
1715config MATH_EMULATION
1716	bool
1717	depends on MODIFY_LDT_SYSCALL
1718	prompt "Math emulation" if X86_32 && (M486SX || MELAN)
1719	help
1720	  Linux can emulate a math coprocessor (used for floating point
1721	  operations) if you don't have one. 486DX and Pentium processors have
1722	  a math coprocessor built in, 486SX and 386 do not, unless you added
1723	  a 487DX or 387, respectively. (The messages during boot time can
1724	  give you some hints here ["man dmesg"].) Everyone needs either a
1725	  coprocessor or this emulation.
1726
1727	  If you don't have a math coprocessor, you need to say Y here; if you
1728	  say Y here even though you have a coprocessor, the coprocessor will
1729	  be used nevertheless. (This behavior can be changed with the kernel
1730	  command line option "no387", which comes handy if your coprocessor
1731	  is broken. Try "man bootparam" or see the documentation of your boot
1732	  loader (lilo or loadlin) about how to pass options to the kernel at
1733	  boot time.) This means that it is a good idea to say Y here if you
1734	  intend to use this kernel on different machines.
1735
1736	  More information about the internals of the Linux math coprocessor
1737	  emulation can be found in <file:arch/x86/math-emu/README>.
1738
1739	  If you are not sure, say Y; apart from resulting in a 66 KB bigger
1740	  kernel, it won't hurt.
1741
1742config MTRR
1743	def_bool y
1744	prompt "MTRR (Memory Type Range Register) support" if EXPERT
1745	help
1746	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
1747	  the Memory Type Range Registers (MTRRs) may be used to control
1748	  processor access to memory ranges. This is most useful if you have
1749	  a video (VGA) card on a PCI or AGP bus. Enabling write-combining
1750	  allows bus write transfers to be combined into a larger transfer
1751	  before bursting over the PCI/AGP bus. This can increase performance
1752	  of image write operations 2.5 times or more. Saying Y here creates a
1753	  /proc/mtrr file which may be used to manipulate your processor's
1754	  MTRRs. Typically the X server should use this.
1755
1756	  This code has a reasonably generic interface so that similar
1757	  control registers on other processors can be easily supported
1758	  as well:
1759
1760	  The Cyrix 6x86, 6x86MX and M II processors have Address Range
1761	  Registers (ARRs) which provide a similar functionality to MTRRs. For
1762	  these, the ARRs are used to emulate the MTRRs.
1763	  The AMD K6-2 (stepping 8 and above) and K6-3 processors have two
1764	  MTRRs. The Centaur C6 (WinChip) has 8 MCRs, allowing
1765	  write-combining. All of these processors are supported by this code
1766	  and it makes sense to say Y here if you have one of them.
1767
1768	  Saying Y here also fixes a problem with buggy SMP BIOSes which only
1769	  set the MTRRs for the boot CPU and not for the secondary CPUs. This
1770	  can lead to all sorts of problems, so it's good to say Y here.
1771
1772	  You can safely say Y even if your machine doesn't have MTRRs, you'll
1773	  just add about 9 KB to your kernel.
1774
1775	  See <file:Documentation/arch/x86/mtrr.rst> for more information.
1776
1777config MTRR_SANITIZER
1778	def_bool y
1779	prompt "MTRR cleanup support"
1780	depends on MTRR
1781	help
1782	  Convert MTRR layout from continuous to discrete, so X drivers can
1783	  add writeback entries.
1784
1785	  Can be disabled with disable_mtrr_cleanup on the kernel command line.
1786	  The largest mtrr entry size for a continuous block can be set with
1787	  mtrr_chunk_size.
1788
1789	  If unsure, say Y.
1790
1791config MTRR_SANITIZER_ENABLE_DEFAULT
1792	int "MTRR cleanup enable value (0-1)"
1793	range 0 1
1794	default "0"
1795	depends on MTRR_SANITIZER
1796	help
1797	  Enable mtrr cleanup default value
1798
1799config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
1800	int "MTRR cleanup spare reg num (0-7)"
1801	range 0 7
1802	default "1"
1803	depends on MTRR_SANITIZER
1804	help
1805	  mtrr cleanup spare entries default, it can be changed via
1806	  mtrr_spare_reg_nr=N on the kernel command line.
1807
1808config X86_PAT
1809	def_bool y
1810	prompt "x86 PAT support" if EXPERT
1811	depends on MTRR
1812	select ARCH_USES_PG_ARCH_2
1813	help
1814	  Use PAT attributes to setup page level cache control.
1815
1816	  PATs are the modern equivalents of MTRRs and are much more
1817	  flexible than MTRRs.
1818
1819	  Say N here if you see bootup problems (boot crash, boot hang,
1820	  spontaneous reboots) or a non-working video driver.
1821
1822	  If unsure, say Y.
1823
1824config X86_UMIP
1825	def_bool y
1826	prompt "User Mode Instruction Prevention" if EXPERT
1827	help
1828	  User Mode Instruction Prevention (UMIP) is a security feature in
1829	  some x86 processors. If enabled, a general protection fault is
1830	  issued if the SGDT, SLDT, SIDT, SMSW or STR instructions are
1831	  executed in user mode. These instructions unnecessarily expose
1832	  information about the hardware state.
1833
1834	  The vast majority of applications do not use these instructions.
1835	  For the very few that do, software emulation is provided in
1836	  specific cases in protected and virtual-8086 modes. Emulated
1837	  results are dummy.
1838
1839config CC_HAS_IBT
1840	# GCC >= 9 and binutils >= 2.29
1841	# Retpoline check to work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93654
1842	# Clang/LLVM >= 14
1843	# https://github.com/llvm/llvm-project/commit/e0b89df2e0f0130881bf6c39bf31d7f6aac00e0f
1844	# https://github.com/llvm/llvm-project/commit/dfcf69770bc522b9e411c66454934a37c1f35332
1845	def_bool ((CC_IS_GCC && $(cc-option, -fcf-protection=branch -mindirect-branch-register)) || \
1846		  (CC_IS_CLANG && CLANG_VERSION >= 140000)) && \
1847		  $(as-instr,endbr64)
1848
1849config X86_CET
1850	def_bool n
1851	help
1852	  CET features configured (Shadow stack or IBT)
1853
1854config X86_KERNEL_IBT
1855	prompt "Indirect Branch Tracking"
1856	def_bool y
1857	depends on X86_64 && CC_HAS_IBT && HAVE_OBJTOOL
1858	# https://github.com/llvm/llvm-project/commit/9d7001eba9c4cb311e03cd8cdc231f9e579f2d0f
1859	depends on !LD_IS_LLD || LLD_VERSION >= 140000
1860	select OBJTOOL
1861	select X86_CET
1862	help
1863	  Build the kernel with support for Indirect Branch Tracking, a
1864	  hardware support course-grain forward-edge Control Flow Integrity
1865	  protection. It enforces that all indirect calls must land on
1866	  an ENDBR instruction, as such, the compiler will instrument the
1867	  code with them to make this happen.
1868
1869	  In addition to building the kernel with IBT, seal all functions that
1870	  are not indirect call targets, avoiding them ever becoming one.
1871
1872	  This requires LTO like objtool runs and will slow down the build. It
1873	  does significantly reduce the number of ENDBR instructions in the
1874	  kernel image.
1875
1876config X86_INTEL_MEMORY_PROTECTION_KEYS
1877	prompt "Memory Protection Keys"
1878	def_bool y
1879	# Note: only available in 64-bit mode
1880	depends on X86_64 && (CPU_SUP_INTEL || CPU_SUP_AMD)
1881	select ARCH_USES_HIGH_VMA_FLAGS
1882	select ARCH_HAS_PKEYS
1883	help
1884	  Memory Protection Keys provides a mechanism for enforcing
1885	  page-based protections, but without requiring modification of the
1886	  page tables when an application changes protection domains.
1887
1888	  For details, see Documentation/core-api/protection-keys.rst
1889
1890	  If unsure, say y.
1891
1892config ARCH_PKEY_BITS
1893	int
1894	default 4
1895
1896choice
1897	prompt "TSX enable mode"
1898	depends on CPU_SUP_INTEL
1899	default X86_INTEL_TSX_MODE_OFF
1900	help
1901	  Intel's TSX (Transactional Synchronization Extensions) feature
1902	  allows to optimize locking protocols through lock elision which
1903	  can lead to a noticeable performance boost.
1904
1905	  On the other hand it has been shown that TSX can be exploited
1906	  to form side channel attacks (e.g. TAA) and chances are there
1907	  will be more of those attacks discovered in the future.
1908
1909	  Therefore TSX is not enabled by default (aka tsx=off). An admin
1910	  might override this decision by tsx=on the command line parameter.
1911	  Even with TSX enabled, the kernel will attempt to enable the best
1912	  possible TAA mitigation setting depending on the microcode available
1913	  for the particular machine.
1914
1915	  This option allows to set the default tsx mode between tsx=on, =off
1916	  and =auto. See Documentation/admin-guide/kernel-parameters.txt for more
1917	  details.
1918
1919	  Say off if not sure, auto if TSX is in use but it should be used on safe
1920	  platforms or on if TSX is in use and the security aspect of tsx is not
1921	  relevant.
1922
1923config X86_INTEL_TSX_MODE_OFF
1924	bool "off"
1925	help
1926	  TSX is disabled if possible - equals to tsx=off command line parameter.
1927
1928config X86_INTEL_TSX_MODE_ON
1929	bool "on"
1930	help
1931	  TSX is always enabled on TSX capable HW - equals the tsx=on command
1932	  line parameter.
1933
1934config X86_INTEL_TSX_MODE_AUTO
1935	bool "auto"
1936	help
1937	  TSX is enabled on TSX capable HW that is believed to be safe against
1938	  side channel attacks- equals the tsx=auto command line parameter.
1939endchoice
1940
1941config X86_SGX
1942	bool "Software Guard eXtensions (SGX)"
1943	depends on X86_64 && CPU_SUP_INTEL && X86_X2APIC
1944	depends on CRYPTO=y
1945	depends on CRYPTO_SHA256=y
1946	select MMU_NOTIFIER
1947	select NUMA_KEEP_MEMINFO if NUMA
1948	select XARRAY_MULTI
1949	help
1950	  Intel(R) Software Guard eXtensions (SGX) is a set of CPU instructions
1951	  that can be used by applications to set aside private regions of code
1952	  and data, referred to as enclaves. An enclave's private memory can
1953	  only be accessed by code running within the enclave. Accesses from
1954	  outside the enclave, including other enclaves, are disallowed by
1955	  hardware.
1956
1957	  If unsure, say N.
1958
1959config X86_USER_SHADOW_STACK
1960	bool "X86 userspace shadow stack"
1961	depends on AS_WRUSS
1962	depends on X86_64
1963	select ARCH_USES_HIGH_VMA_FLAGS
1964	select ARCH_HAS_USER_SHADOW_STACK
1965	select X86_CET
1966	help
1967	  Shadow stack protection is a hardware feature that detects function
1968	  return address corruption.  This helps mitigate ROP attacks.
1969	  Applications must be enabled to use it, and old userspace does not
1970	  get protection "for free".
1971
1972	  CPUs supporting shadow stacks were first released in 2020.
1973
1974	  See Documentation/arch/x86/shstk.rst for more information.
1975
1976	  If unsure, say N.
1977
1978config INTEL_TDX_HOST
1979	bool "Intel Trust Domain Extensions (TDX) host support"
1980	depends on CPU_SUP_INTEL
1981	depends on X86_64
1982	depends on KVM_INTEL
1983	depends on X86_X2APIC
1984	select ARCH_KEEP_MEMBLOCK
1985	depends on CONTIG_ALLOC
1986	depends on !KEXEC_CORE
1987	depends on X86_MCE
1988	help
1989	  Intel Trust Domain Extensions (TDX) protects guest VMs from malicious
1990	  host and certain physical attacks.  This option enables necessary TDX
1991	  support in the host kernel to run confidential VMs.
1992
1993	  If unsure, say N.
1994
1995config EFI
1996	bool "EFI runtime service support"
1997	depends on ACPI
1998	select UCS2_STRING
1999	select EFI_RUNTIME_WRAPPERS
2000	select ARCH_USE_MEMREMAP_PROT
2001	select EFI_RUNTIME_MAP if KEXEC_CORE
2002	help
2003	  This enables the kernel to use EFI runtime services that are
2004	  available (such as the EFI variable services).
2005
2006	  This option is only useful on systems that have EFI firmware.
2007	  In addition, you should use the latest ELILO loader available
2008	  at <http://elilo.sourceforge.net> in order to take advantage
2009	  of EFI runtime services. However, even with this option, the
2010	  resultant kernel should continue to boot on existing non-EFI
2011	  platforms.
2012
2013config EFI_STUB
2014	bool "EFI stub support"
2015	depends on EFI
2016	select RELOCATABLE
2017	help
2018	  This kernel feature allows a bzImage to be loaded directly
2019	  by EFI firmware without the use of a bootloader.
2020
2021	  See Documentation/admin-guide/efi-stub.rst for more information.
2022
2023config EFI_HANDOVER_PROTOCOL
2024	bool "EFI handover protocol (DEPRECATED)"
2025	depends on EFI_STUB
2026	default y
2027	help
2028	  Select this in order to include support for the deprecated EFI
2029	  handover protocol, which defines alternative entry points into the
2030	  EFI stub.  This is a practice that has no basis in the UEFI
2031	  specification, and requires a priori knowledge on the part of the
2032	  bootloader about Linux/x86 specific ways of passing the command line
2033	  and initrd, and where in memory those assets may be loaded.
2034
2035	  If in doubt, say Y. Even though the corresponding support is not
2036	  present in upstream GRUB or other bootloaders, most distros build
2037	  GRUB with numerous downstream patches applied, and may rely on the
2038	  handover protocol as as result.
2039
2040config EFI_MIXED
2041	bool "EFI mixed-mode support"
2042	depends on EFI_STUB && X86_64
2043	help
2044	  Enabling this feature allows a 64-bit kernel to be booted
2045	  on a 32-bit firmware, provided that your CPU supports 64-bit
2046	  mode.
2047
2048	  Note that it is not possible to boot a mixed-mode enabled
2049	  kernel via the EFI boot stub - a bootloader that supports
2050	  the EFI handover protocol must be used.
2051
2052	  If unsure, say N.
2053
2054config EFI_RUNTIME_MAP
2055	bool "Export EFI runtime maps to sysfs" if EXPERT
2056	depends on EFI
2057	help
2058	  Export EFI runtime memory regions to /sys/firmware/efi/runtime-map.
2059	  That memory map is required by the 2nd kernel to set up EFI virtual
2060	  mappings after kexec, but can also be used for debugging purposes.
2061
2062	  See also Documentation/ABI/testing/sysfs-firmware-efi-runtime-map.
2063
2064source "kernel/Kconfig.hz"
2065
2066config ARCH_SUPPORTS_KEXEC
2067	def_bool y
2068
2069config ARCH_SUPPORTS_KEXEC_FILE
2070	def_bool X86_64
2071
2072config ARCH_SELECTS_KEXEC_FILE
2073	def_bool y
2074	depends on KEXEC_FILE
2075	select HAVE_IMA_KEXEC if IMA
2076
2077config ARCH_SUPPORTS_KEXEC_PURGATORY
2078	def_bool y
2079
2080config ARCH_SUPPORTS_KEXEC_SIG
2081	def_bool y
2082
2083config ARCH_SUPPORTS_KEXEC_SIG_FORCE
2084	def_bool y
2085
2086config ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG
2087	def_bool y
2088
2089config ARCH_SUPPORTS_KEXEC_JUMP
2090	def_bool y
2091
2092config ARCH_SUPPORTS_CRASH_DUMP
2093	def_bool X86_64 || (X86_32 && HIGHMEM)
2094
2095config ARCH_DEFAULT_CRASH_DUMP
2096	def_bool y
2097
2098config ARCH_SUPPORTS_CRASH_HOTPLUG
2099	def_bool y
2100
2101config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
2102	def_bool CRASH_RESERVE
2103
2104config PHYSICAL_START
2105	hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
2106	default "0x1000000"
2107	help
2108	  This gives the physical address where the kernel is loaded.
2109
2110	  If the kernel is not relocatable (CONFIG_RELOCATABLE=n) then bzImage
2111	  will decompress itself to above physical address and run from there.
2112	  Otherwise, bzImage will run from the address where it has been loaded
2113	  by the boot loader. The only exception is if it is loaded below the
2114	  above physical address, in which case it will relocate itself there.
2115
2116	  In normal kdump cases one does not have to set/change this option
2117	  as now bzImage can be compiled as a completely relocatable image
2118	  (CONFIG_RELOCATABLE=y) and be used to load and run from a different
2119	  address. This option is mainly useful for the folks who don't want
2120	  to use a bzImage for capturing the crash dump and want to use a
2121	  vmlinux instead. vmlinux is not relocatable hence a kernel needs
2122	  to be specifically compiled to run from a specific memory area
2123	  (normally a reserved region) and this option comes handy.
2124
2125	  So if you are using bzImage for capturing the crash dump,
2126	  leave the value here unchanged to 0x1000000 and set
2127	  CONFIG_RELOCATABLE=y.  Otherwise if you plan to use vmlinux
2128	  for capturing the crash dump change this value to start of
2129	  the reserved region.  In other words, it can be set based on
2130	  the "X" value as specified in the "crashkernel=YM@XM"
2131	  command line boot parameter passed to the panic-ed
2132	  kernel. Please take a look at Documentation/admin-guide/kdump/kdump.rst
2133	  for more details about crash dumps.
2134
2135	  Usage of bzImage for capturing the crash dump is recommended as
2136	  one does not have to build two kernels. Same kernel can be used
2137	  as production kernel and capture kernel. Above option should have
2138	  gone away after relocatable bzImage support is introduced. But it
2139	  is present because there are users out there who continue to use
2140	  vmlinux for dump capture. This option should go away down the
2141	  line.
2142
2143	  Don't change this unless you know what you are doing.
2144
2145config RELOCATABLE
2146	bool "Build a relocatable kernel"
2147	default y
2148	help
2149	  This builds a kernel image that retains relocation information
2150	  so it can be loaded someplace besides the default 1MB.
2151	  The relocations tend to make the kernel binary about 10% larger,
2152	  but are discarded at runtime.
2153
2154	  One use is for the kexec on panic case where the recovery kernel
2155	  must live at a different physical address than the primary
2156	  kernel.
2157
2158	  Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address
2159	  it has been loaded at and the compile time physical address
2160	  (CONFIG_PHYSICAL_START) is used as the minimum location.
2161
2162config RANDOMIZE_BASE
2163	bool "Randomize the address of the kernel image (KASLR)"
2164	depends on RELOCATABLE
2165	default y
2166	help
2167	  In support of Kernel Address Space Layout Randomization (KASLR),
2168	  this randomizes the physical address at which the kernel image
2169	  is decompressed and the virtual address where the kernel
2170	  image is mapped, as a security feature that deters exploit
2171	  attempts relying on knowledge of the location of kernel
2172	  code internals.
2173
2174	  On 64-bit, the kernel physical and virtual addresses are
2175	  randomized separately. The physical address will be anywhere
2176	  between 16MB and the top of physical memory (up to 64TB). The
2177	  virtual address will be randomized from 16MB up to 1GB (9 bits
2178	  of entropy). Note that this also reduces the memory space
2179	  available to kernel modules from 1.5GB to 1GB.
2180
2181	  On 32-bit, the kernel physical and virtual addresses are
2182	  randomized together. They will be randomized from 16MB up to
2183	  512MB (8 bits of entropy).
2184
2185	  Entropy is generated using the RDRAND instruction if it is
2186	  supported. If RDTSC is supported, its value is mixed into
2187	  the entropy pool as well. If neither RDRAND nor RDTSC are
2188	  supported, then entropy is read from the i8254 timer. The
2189	  usable entropy is limited by the kernel being built using
2190	  2GB addressing, and that PHYSICAL_ALIGN must be at a
2191	  minimum of 2MB. As a result, only 10 bits of entropy are
2192	  theoretically possible, but the implementations are further
2193	  limited due to memory layouts.
2194
2195	  If unsure, say Y.
2196
2197# Relocation on x86 needs some additional build support
2198config X86_NEED_RELOCS
2199	def_bool y
2200	depends on RANDOMIZE_BASE || (X86_32 && RELOCATABLE)
2201
2202config PHYSICAL_ALIGN
2203	hex "Alignment value to which kernel should be aligned"
2204	default "0x200000"
2205	range 0x2000 0x1000000 if X86_32
2206	range 0x200000 0x1000000 if X86_64
2207	help
2208	  This value puts the alignment restrictions on physical address
2209	  where kernel is loaded and run from. Kernel is compiled for an
2210	  address which meets above alignment restriction.
2211
2212	  If bootloader loads the kernel at a non-aligned address and
2213	  CONFIG_RELOCATABLE is set, kernel will move itself to nearest
2214	  address aligned to above value and run from there.
2215
2216	  If bootloader loads the kernel at a non-aligned address and
2217	  CONFIG_RELOCATABLE is not set, kernel will ignore the run time
2218	  load address and decompress itself to the address it has been
2219	  compiled for and run from there. The address for which kernel is
2220	  compiled already meets above alignment restrictions. Hence the
2221	  end result is that kernel runs from a physical address meeting
2222	  above alignment restrictions.
2223
2224	  On 32-bit this value must be a multiple of 0x2000. On 64-bit
2225	  this value must be a multiple of 0x200000.
2226
2227	  Don't change this unless you know what you are doing.
2228
2229config DYNAMIC_MEMORY_LAYOUT
2230	bool
2231	help
2232	  This option makes base addresses of vmalloc and vmemmap as well as
2233	  __PAGE_OFFSET movable during boot.
2234
2235config RANDOMIZE_MEMORY
2236	bool "Randomize the kernel memory sections"
2237	depends on X86_64
2238	depends on RANDOMIZE_BASE
2239	select DYNAMIC_MEMORY_LAYOUT
2240	default RANDOMIZE_BASE
2241	help
2242	  Randomizes the base virtual address of kernel memory sections
2243	  (physical memory mapping, vmalloc & vmemmap). This security feature
2244	  makes exploits relying on predictable memory locations less reliable.
2245
2246	  The order of allocations remains unchanged. Entropy is generated in
2247	  the same way as RANDOMIZE_BASE. Current implementation in the optimal
2248	  configuration have in average 30,000 different possible virtual
2249	  addresses for each memory section.
2250
2251	  If unsure, say Y.
2252
2253config RANDOMIZE_MEMORY_PHYSICAL_PADDING
2254	hex "Physical memory mapping padding" if EXPERT
2255	depends on RANDOMIZE_MEMORY
2256	default "0xa" if MEMORY_HOTPLUG
2257	default "0x0"
2258	range 0x1 0x40 if MEMORY_HOTPLUG
2259	range 0x0 0x40
2260	help
2261	  Define the padding in terabytes added to the existing physical
2262	  memory size during kernel memory randomization. It is useful
2263	  for memory hotplug support but reduces the entropy available for
2264	  address randomization.
2265
2266	  If unsure, leave at the default value.
2267
2268config ADDRESS_MASKING
2269	bool "Linear Address Masking support"
2270	depends on X86_64
2271	depends on COMPILE_TEST || !CPU_MITIGATIONS # wait for LASS
2272	help
2273	  Linear Address Masking (LAM) modifies the checking that is applied
2274	  to 64-bit linear addresses, allowing software to use of the
2275	  untranslated address bits for metadata.
2276
2277	  The capability can be used for efficient address sanitizers (ASAN)
2278	  implementation and for optimizations in JITs.
2279
2280config HOTPLUG_CPU
2281	def_bool y
2282	depends on SMP
2283
2284config COMPAT_VDSO
2285	def_bool n
2286	prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
2287	depends on COMPAT_32
2288	help
2289	  Certain buggy versions of glibc will crash if they are
2290	  presented with a 32-bit vDSO that is not mapped at the address
2291	  indicated in its segment table.
2292
2293	  The bug was introduced by f866314b89d56845f55e6f365e18b31ec978ec3a
2294	  and fixed by 3b3ddb4f7db98ec9e912ccdf54d35df4aa30e04a and
2295	  49ad572a70b8aeb91e57483a11dd1b77e31c4468.  Glibc 2.3.3 is
2296	  the only released version with the bug, but OpenSUSE 9
2297	  contains a buggy "glibc 2.3.2".
2298
2299	  The symptom of the bug is that everything crashes on startup, saying:
2300	  dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
2301
2302	  Saying Y here changes the default value of the vdso32 boot
2303	  option from 1 to 0, which turns off the 32-bit vDSO entirely.
2304	  This works around the glibc bug but hurts performance.
2305
2306	  If unsure, say N: if you are compiling your own kernel, you
2307	  are unlikely to be using a buggy version of glibc.
2308
2309choice
2310	prompt "vsyscall table for legacy applications"
2311	depends on X86_64
2312	default LEGACY_VSYSCALL_XONLY
2313	help
2314	  Legacy user code that does not know how to find the vDSO expects
2315	  to be able to issue three syscalls by calling fixed addresses in
2316	  kernel space. Since this location is not randomized with ASLR,
2317	  it can be used to assist security vulnerability exploitation.
2318
2319	  This setting can be changed at boot time via the kernel command
2320	  line parameter vsyscall=[emulate|xonly|none].  Emulate mode
2321	  is deprecated and can only be enabled using the kernel command
2322	  line.
2323
2324	  On a system with recent enough glibc (2.14 or newer) and no
2325	  static binaries, you can say None without a performance penalty
2326	  to improve security.
2327
2328	  If unsure, select "Emulate execution only".
2329
2330	config LEGACY_VSYSCALL_XONLY
2331		bool "Emulate execution only"
2332		help
2333		  The kernel traps and emulates calls into the fixed vsyscall
2334		  address mapping and does not allow reads.  This
2335		  configuration is recommended when userspace might use the
2336		  legacy vsyscall area but support for legacy binary
2337		  instrumentation of legacy code is not needed.  It mitigates
2338		  certain uses of the vsyscall area as an ASLR-bypassing
2339		  buffer.
2340
2341	config LEGACY_VSYSCALL_NONE
2342		bool "None"
2343		help
2344		  There will be no vsyscall mapping at all. This will
2345		  eliminate any risk of ASLR bypass due to the vsyscall
2346		  fixed address mapping. Attempts to use the vsyscalls
2347		  will be reported to dmesg, so that either old or
2348		  malicious userspace programs can be identified.
2349
2350endchoice
2351
2352config CMDLINE_BOOL
2353	bool "Built-in kernel command line"
2354	help
2355	  Allow for specifying boot arguments to the kernel at
2356	  build time.  On some systems (e.g. embedded ones), it is
2357	  necessary or convenient to provide some or all of the
2358	  kernel boot arguments with the kernel itself (that is,
2359	  to not rely on the boot loader to provide them.)
2360
2361	  To compile command line arguments into the kernel,
2362	  set this option to 'Y', then fill in the
2363	  boot arguments in CONFIG_CMDLINE.
2364
2365	  Systems with fully functional boot loaders (i.e. non-embedded)
2366	  should leave this option set to 'N'.
2367
2368config CMDLINE
2369	string "Built-in kernel command string"
2370	depends on CMDLINE_BOOL
2371	default ""
2372	help
2373	  Enter arguments here that should be compiled into the kernel
2374	  image and used at boot time.  If the boot loader provides a
2375	  command line at boot time, it is appended to this string to
2376	  form the full kernel command line, when the system boots.
2377
2378	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
2379	  change this behavior.
2380
2381	  In most cases, the command line (whether built-in or provided
2382	  by the boot loader) should specify the device for the root
2383	  file system.
2384
2385config CMDLINE_OVERRIDE
2386	bool "Built-in command line overrides boot loader arguments"
2387	depends on CMDLINE_BOOL && CMDLINE != ""
2388	help
2389	  Set this option to 'Y' to have the kernel ignore the boot loader
2390	  command line, and use ONLY the built-in command line.
2391
2392	  This is used to work around broken boot loaders.  This should
2393	  be set to 'N' under normal conditions.
2394
2395config MODIFY_LDT_SYSCALL
2396	bool "Enable the LDT (local descriptor table)" if EXPERT
2397	default y
2398	help
2399	  Linux can allow user programs to install a per-process x86
2400	  Local Descriptor Table (LDT) using the modify_ldt(2) system
2401	  call.  This is required to run 16-bit or segmented code such as
2402	  DOSEMU or some Wine programs.  It is also used by some very old
2403	  threading libraries.
2404
2405	  Enabling this feature adds a small amount of overhead to
2406	  context switches and increases the low-level kernel attack
2407	  surface.  Disabling it removes the modify_ldt(2) system call.
2408
2409	  Saying 'N' here may make sense for embedded or server kernels.
2410
2411config STRICT_SIGALTSTACK_SIZE
2412	bool "Enforce strict size checking for sigaltstack"
2413	depends on DYNAMIC_SIGFRAME
2414	help
2415	  For historical reasons MINSIGSTKSZ is a constant which became
2416	  already too small with AVX512 support. Add a mechanism to
2417	  enforce strict checking of the sigaltstack size against the
2418	  real size of the FPU frame. This option enables the check
2419	  by default. It can also be controlled via the kernel command
2420	  line option 'strict_sas_size' independent of this config
2421	  switch. Enabling it might break existing applications which
2422	  allocate a too small sigaltstack but 'work' because they
2423	  never get a signal delivered.
2424
2425	  Say 'N' unless you want to really enforce this check.
2426
2427config CFI_AUTO_DEFAULT
2428	bool "Attempt to use FineIBT by default at boot time"
2429	depends on FINEIBT
2430	default y
2431	help
2432	  Attempt to use FineIBT by default at boot time. If enabled,
2433	  this is the same as booting with "cfi=auto". If disabled,
2434	  this is the same as booting with "cfi=kcfi".
2435
2436source "kernel/livepatch/Kconfig"
2437
2438config X86_BUS_LOCK_DETECT
2439	bool "Split Lock Detect and Bus Lock Detect support"
2440	depends on CPU_SUP_INTEL || CPU_SUP_AMD
2441	default y
2442	help
2443	  Enable Split Lock Detect and Bus Lock Detect functionalities.
2444	  See <file:Documentation/arch/x86/buslock.rst> for more information.
2445
2446endmenu
2447
2448config CC_HAS_NAMED_AS
2449	def_bool $(success,echo 'int __seg_fs fs; int __seg_gs gs;' | $(CC) -x c - -S -o /dev/null)
2450	depends on CC_IS_GCC
2451
2452config CC_HAS_NAMED_AS_FIXED_SANITIZERS
2453	def_bool CC_IS_GCC && GCC_VERSION >= 130300
2454
2455config USE_X86_SEG_SUPPORT
2456	def_bool y
2457	depends on CC_HAS_NAMED_AS
2458	#
2459	# -fsanitize=kernel-address (KASAN) and -fsanitize=thread
2460	# (KCSAN) are incompatible with named address spaces with
2461	# GCC < 13.3 - see GCC PR sanitizer/111736.
2462	#
2463	depends on !(KASAN || KCSAN) || CC_HAS_NAMED_AS_FIXED_SANITIZERS
2464
2465config CC_HAS_SLS
2466	def_bool $(cc-option,-mharden-sls=all)
2467
2468config CC_HAS_RETURN_THUNK
2469	def_bool $(cc-option,-mfunction-return=thunk-extern)
2470
2471config CC_HAS_ENTRY_PADDING
2472	def_bool $(cc-option,-fpatchable-function-entry=16,16)
2473
2474config FUNCTION_PADDING_CFI
2475	int
2476	default 59 if FUNCTION_ALIGNMENT_64B
2477	default 27 if FUNCTION_ALIGNMENT_32B
2478	default 11 if FUNCTION_ALIGNMENT_16B
2479	default  3 if FUNCTION_ALIGNMENT_8B
2480	default  0
2481
2482# Basically: FUNCTION_ALIGNMENT - 5*CFI_CLANG
2483# except Kconfig can't do arithmetic :/
2484config FUNCTION_PADDING_BYTES
2485	int
2486	default FUNCTION_PADDING_CFI if CFI_CLANG
2487	default FUNCTION_ALIGNMENT
2488
2489config CALL_PADDING
2490	def_bool n
2491	depends on CC_HAS_ENTRY_PADDING && OBJTOOL
2492	select FUNCTION_ALIGNMENT_16B
2493
2494config FINEIBT
2495	def_bool y
2496	depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE
2497	select CALL_PADDING
2498
2499config HAVE_CALL_THUNKS
2500	def_bool y
2501	depends on CC_HAS_ENTRY_PADDING && MITIGATION_RETHUNK && OBJTOOL
2502
2503config CALL_THUNKS
2504	def_bool n
2505	select CALL_PADDING
2506
2507config PREFIX_SYMBOLS
2508	def_bool y
2509	depends on CALL_PADDING && !CFI_CLANG
2510
2511menuconfig CPU_MITIGATIONS
2512	bool "Mitigations for CPU vulnerabilities"
2513	default y
2514	help
2515	  Say Y here to enable options which enable mitigations for hardware
2516	  vulnerabilities (usually related to speculative execution).
2517	  Mitigations can be disabled or restricted to SMT systems at runtime
2518	  via the "mitigations" kernel parameter.
2519
2520	  If you say N, all mitigations will be disabled.  This CANNOT be
2521	  overridden at runtime.
2522
2523	  Say 'Y', unless you really know what you are doing.
2524
2525if CPU_MITIGATIONS
2526
2527config MITIGATION_PAGE_TABLE_ISOLATION
2528	bool "Remove the kernel mapping in user mode"
2529	default y
2530	depends on (X86_64 || X86_PAE)
2531	help
2532	  This feature reduces the number of hardware side channels by
2533	  ensuring that the majority of kernel addresses are not mapped
2534	  into userspace.
2535
2536	  See Documentation/arch/x86/pti.rst for more details.
2537
2538config MITIGATION_RETPOLINE
2539	bool "Avoid speculative indirect branches in kernel"
2540	select OBJTOOL if HAVE_OBJTOOL
2541	default y
2542	help
2543	  Compile kernel with the retpoline compiler options to guard against
2544	  kernel-to-user data leaks by avoiding speculative indirect
2545	  branches. Requires a compiler with -mindirect-branch=thunk-extern
2546	  support for full protection. The kernel may run slower.
2547
2548config MITIGATION_RETHUNK
2549	bool "Enable return-thunks"
2550	depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
2551	select OBJTOOL if HAVE_OBJTOOL
2552	default y if X86_64
2553	help
2554	  Compile the kernel with the return-thunks compiler option to guard
2555	  against kernel-to-user data leaks by avoiding return speculation.
2556	  Requires a compiler with -mfunction-return=thunk-extern
2557	  support for full protection. The kernel may run slower.
2558
2559config MITIGATION_UNRET_ENTRY
2560	bool "Enable UNRET on kernel entry"
2561	depends on CPU_SUP_AMD && MITIGATION_RETHUNK && X86_64
2562	default y
2563	help
2564	  Compile the kernel with support for the retbleed=unret mitigation.
2565
2566config MITIGATION_CALL_DEPTH_TRACKING
2567	bool "Mitigate RSB underflow with call depth tracking"
2568	depends on CPU_SUP_INTEL && HAVE_CALL_THUNKS
2569	select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
2570	select CALL_THUNKS
2571	default y
2572	help
2573	  Compile the kernel with call depth tracking to mitigate the Intel
2574	  SKL Return-Stack-Buffer (RSB) underflow issue. The mitigation is off
2575	  by default and needs to be enabled on the kernel command line via the
2576	  retbleed=stuff option. For non-affected systems the overhead of this
2577	  option is marginal as the call depth tracking is using run-time
2578	  generated call thunks in a compiler generated padding area and call
2579	  patching. This increases text size by ~5%. For non affected systems
2580	  this space is unused. On affected SKL systems this results in a
2581	  significant performance gain over the IBRS mitigation.
2582
2583config CALL_THUNKS_DEBUG
2584	bool "Enable call thunks and call depth tracking debugging"
2585	depends on MITIGATION_CALL_DEPTH_TRACKING
2586	select FUNCTION_ALIGNMENT_32B
2587	default n
2588	help
2589	  Enable call/ret counters for imbalance detection and build in
2590	  a noisy dmesg about callthunks generation and call patching for
2591	  trouble shooting. The debug prints need to be enabled on the
2592	  kernel command line with 'debug-callthunks'.
2593	  Only enable this when you are debugging call thunks as this
2594	  creates a noticeable runtime overhead. If unsure say N.
2595
2596config MITIGATION_IBPB_ENTRY
2597	bool "Enable IBPB on kernel entry"
2598	depends on CPU_SUP_AMD && X86_64
2599	default y
2600	help
2601	  Compile the kernel with support for the retbleed=ibpb mitigation.
2602
2603config MITIGATION_IBRS_ENTRY
2604	bool "Enable IBRS on kernel entry"
2605	depends on CPU_SUP_INTEL && X86_64
2606	default y
2607	help
2608	  Compile the kernel with support for the spectre_v2=ibrs mitigation.
2609	  This mitigates both spectre_v2 and retbleed at great cost to
2610	  performance.
2611
2612config MITIGATION_SRSO
2613	bool "Mitigate speculative RAS overflow on AMD"
2614	depends on CPU_SUP_AMD && X86_64 && MITIGATION_RETHUNK
2615	default y
2616	help
2617	  Enable the SRSO mitigation needed on AMD Zen1-4 machines.
2618
2619config MITIGATION_SLS
2620	bool "Mitigate Straight-Line-Speculation"
2621	depends on CC_HAS_SLS && X86_64
2622	select OBJTOOL if HAVE_OBJTOOL
2623	default n
2624	help
2625	  Compile the kernel with straight-line-speculation options to guard
2626	  against straight line speculation. The kernel image might be slightly
2627	  larger.
2628
2629config MITIGATION_GDS
2630	bool "Mitigate Gather Data Sampling"
2631	depends on CPU_SUP_INTEL
2632	default y
2633	help
2634	  Enable mitigation for Gather Data Sampling (GDS). GDS is a hardware
2635	  vulnerability which allows unprivileged speculative access to data
2636	  which was previously stored in vector registers. The attacker uses gather
2637	  instructions to infer the stale vector register data.
2638
2639config MITIGATION_RFDS
2640	bool "RFDS Mitigation"
2641	depends on CPU_SUP_INTEL
2642	default y
2643	help
2644	  Enable mitigation for Register File Data Sampling (RFDS) by default.
2645	  RFDS is a hardware vulnerability which affects Intel Atom CPUs. It
2646	  allows unprivileged speculative access to stale data previously
2647	  stored in floating point, vector and integer registers.
2648	  See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
2649
2650config MITIGATION_SPECTRE_BHI
2651	bool "Mitigate Spectre-BHB (Branch History Injection)"
2652	depends on CPU_SUP_INTEL
2653	default y
2654	help
2655	  Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks
2656	  where the branch history buffer is poisoned to speculatively steer
2657	  indirect branches.
2658	  See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
2659
2660config MITIGATION_MDS
2661	bool "Mitigate Microarchitectural Data Sampling (MDS) hardware bug"
2662	depends on CPU_SUP_INTEL
2663	default y
2664	help
2665	  Enable mitigation for Microarchitectural Data Sampling (MDS). MDS is
2666	  a hardware vulnerability which allows unprivileged speculative access
2667	  to data which is available in various CPU internal buffers.
2668	  See also <file:Documentation/admin-guide/hw-vuln/mds.rst>
2669
2670config MITIGATION_TAA
2671	bool "Mitigate TSX Asynchronous Abort (TAA) hardware bug"
2672	depends on CPU_SUP_INTEL
2673	default y
2674	help
2675	  Enable mitigation for TSX Asynchronous Abort (TAA). TAA is a hardware
2676	  vulnerability that allows unprivileged speculative access to data
2677	  which is available in various CPU internal buffers by using
2678	  asynchronous aborts within an Intel TSX transactional region.
2679	  See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
2680
2681config MITIGATION_MMIO_STALE_DATA
2682	bool "Mitigate MMIO Stale Data hardware bug"
2683	depends on CPU_SUP_INTEL
2684	default y
2685	help
2686	  Enable mitigation for MMIO Stale Data hardware bugs.  Processor MMIO
2687	  Stale Data Vulnerabilities are a class of memory-mapped I/O (MMIO)
2688	  vulnerabilities that can expose data. The vulnerabilities require the
2689	  attacker to have access to MMIO.
2690	  See also
2691	  <file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
2692
2693config MITIGATION_L1TF
2694	bool "Mitigate L1 Terminal Fault (L1TF) hardware bug"
2695	depends on CPU_SUP_INTEL
2696	default y
2697	help
2698	  Mitigate L1 Terminal Fault (L1TF) hardware bug. L1 Terminal Fault is a
2699	  hardware vulnerability which allows unprivileged speculative access to data
2700	  available in the Level 1 Data Cache.
2701	  See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
2702
2703config MITIGATION_RETBLEED
2704	bool "Mitigate RETBleed hardware bug"
2705	depends on (CPU_SUP_INTEL && MITIGATION_SPECTRE_V2) || MITIGATION_UNRET_ENTRY || MITIGATION_IBPB_ENTRY
2706	default y
2707	help
2708	  Enable mitigation for RETBleed (Arbitrary Speculative Code Execution
2709	  with Return Instructions) vulnerability.  RETBleed is a speculative
2710	  execution attack which takes advantage of microarchitectural behavior
2711	  in many modern microprocessors, similar to Spectre v2. An
2712	  unprivileged attacker can use these flaws to bypass conventional
2713	  memory security restrictions to gain read access to privileged memory
2714	  that would otherwise be inaccessible.
2715
2716config MITIGATION_SPECTRE_V1
2717	bool "Mitigate SPECTRE V1 hardware bug"
2718	default y
2719	help
2720	  Enable mitigation for Spectre V1 (Bounds Check Bypass). Spectre V1 is a
2721	  class of side channel attacks that takes advantage of speculative
2722	  execution that bypasses conditional branch instructions used for
2723	  memory access bounds check.
2724	  See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
2725
2726config MITIGATION_SPECTRE_V2
2727	bool "Mitigate SPECTRE V2 hardware bug"
2728	default y
2729	help
2730	  Enable mitigation for Spectre V2 (Branch Target Injection). Spectre
2731	  V2 is a class of side channel attacks that takes advantage of
2732	  indirect branch predictors inside the processor. In Spectre variant 2
2733	  attacks, the attacker can steer speculative indirect branches in the
2734	  victim to gadget code by poisoning the branch target buffer of a CPU
2735	  used for predicting indirect branch addresses.
2736	  See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
2737
2738config MITIGATION_SRBDS
2739	bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
2740	depends on CPU_SUP_INTEL
2741	default y
2742	help
2743	  Enable mitigation for Special Register Buffer Data Sampling (SRBDS).
2744	  SRBDS is a hardware vulnerability that allows Microarchitectural Data
2745	  Sampling (MDS) techniques to infer values returned from special
2746	  register accesses. An unprivileged user can extract values returned
2747	  from RDRAND and RDSEED executed on another core or sibling thread
2748	  using MDS techniques.
2749	  See also
2750	  <file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
2751
2752config MITIGATION_SSB
2753	bool "Mitigate Speculative Store Bypass (SSB) hardware bug"
2754	default y
2755	help
2756	  Enable mitigation for Speculative Store Bypass (SSB). SSB is a
2757	  hardware security vulnerability and its exploitation takes advantage
2758	  of speculative execution in a similar way to the Meltdown and Spectre
2759	  security vulnerabilities.
2760
2761endif
2762
2763config ARCH_HAS_ADD_PAGES
2764	def_bool y
2765	depends on ARCH_ENABLE_MEMORY_HOTPLUG
2766
2767menu "Power management and ACPI options"
2768
2769config ARCH_HIBERNATION_HEADER
2770	def_bool y
2771	depends on HIBERNATION
2772
2773source "kernel/power/Kconfig"
2774
2775source "drivers/acpi/Kconfig"
2776
2777config X86_APM_BOOT
2778	def_bool y
2779	depends on APM
2780
2781menuconfig APM
2782	tristate "APM (Advanced Power Management) BIOS support"
2783	depends on X86_32 && PM_SLEEP
2784	help
2785	  APM is a BIOS specification for saving power using several different
2786	  techniques. This is mostly useful for battery powered laptops with
2787	  APM compliant BIOSes. If you say Y here, the system time will be
2788	  reset after a RESUME operation, the /proc/apm device will provide
2789	  battery status information, and user-space programs will receive
2790	  notification of APM "events" (e.g. battery status change).
2791
2792	  If you select "Y" here, you can disable actual use of the APM
2793	  BIOS by passing the "apm=off" option to the kernel at boot time.
2794
2795	  Note that the APM support is almost completely disabled for
2796	  machines with more than one CPU.
2797
2798	  In order to use APM, you will need supporting software. For location
2799	  and more information, read <file:Documentation/power/apm-acpi.rst>
2800	  and the Battery Powered Linux mini-HOWTO, available from
2801	  <http://www.tldp.org/docs.html#howto>.
2802
2803	  This driver does not spin down disk drives (see the hdparm(8)
2804	  manpage ("man 8 hdparm") for that), and it doesn't turn off
2805	  VESA-compliant "green" monitors.
2806
2807	  This driver does not support the TI 4000M TravelMate and the ACER
2808	  486/DX4/75 because they don't have compliant BIOSes. Many "green"
2809	  desktop machines also don't have compliant BIOSes, and this driver
2810	  may cause those machines to panic during the boot phase.
2811
2812	  Generally, if you don't have a battery in your machine, there isn't
2813	  much point in using this driver and you should say N. If you get
2814	  random kernel OOPSes or reboots that don't seem to be related to
2815	  anything, try disabling/enabling this option (or disabling/enabling
2816	  APM in your BIOS).
2817
2818	  Some other things you should try when experiencing seemingly random,
2819	  "weird" problems:
2820
2821	  1) make sure that you have enough swap space and that it is
2822	  enabled.
2823	  2) pass the "idle=poll" option to the kernel
2824	  3) switch on floating point emulation in the kernel and pass
2825	  the "no387" option to the kernel
2826	  4) pass the "floppy=nodma" option to the kernel
2827	  5) pass the "mem=4M" option to the kernel (thereby disabling
2828	  all but the first 4 MB of RAM)
2829	  6) make sure that the CPU is not over clocked.
2830	  7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
2831	  8) disable the cache from your BIOS settings
2832	  9) install a fan for the video card or exchange video RAM
2833	  10) install a better fan for the CPU
2834	  11) exchange RAM chips
2835	  12) exchange the motherboard.
2836
2837	  To compile this driver as a module, choose M here: the
2838	  module will be called apm.
2839
2840if APM
2841
2842config APM_IGNORE_USER_SUSPEND
2843	bool "Ignore USER SUSPEND"
2844	help
2845	  This option will ignore USER SUSPEND requests. On machines with a
2846	  compliant APM BIOS, you want to say N. However, on the NEC Versa M
2847	  series notebooks, it is necessary to say Y because of a BIOS bug.
2848
2849config APM_DO_ENABLE
2850	bool "Enable PM at boot time"
2851	help
2852	  Enable APM features at boot time. From page 36 of the APM BIOS
2853	  specification: "When disabled, the APM BIOS does not automatically
2854	  power manage devices, enter the Standby State, enter the Suspend
2855	  State, or take power saving steps in response to CPU Idle calls."
2856	  This driver will make CPU Idle calls when Linux is idle (unless this
2857	  feature is turned off -- see "Do CPU IDLE calls", below). This
2858	  should always save battery power, but more complicated APM features
2859	  will be dependent on your BIOS implementation. You may need to turn
2860	  this option off if your computer hangs at boot time when using APM
2861	  support, or if it beeps continuously instead of suspending. Turn
2862	  this off if you have a NEC UltraLite Versa 33/C or a Toshiba
2863	  T400CDT. This is off by default since most machines do fine without
2864	  this feature.
2865
2866config APM_CPU_IDLE
2867	depends on CPU_IDLE
2868	bool "Make CPU Idle calls when idle"
2869	help
2870	  Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop.
2871	  On some machines, this can activate improved power savings, such as
2872	  a slowed CPU clock rate, when the machine is idle. These idle calls
2873	  are made after the idle loop has run for some length of time (e.g.,
2874	  333 mS). On some machines, this will cause a hang at boot time or
2875	  whenever the CPU becomes idle. (On machines with more than one CPU,
2876	  this option does nothing.)
2877
2878config APM_DISPLAY_BLANK
2879	bool "Enable console blanking using APM"
2880	help
2881	  Enable console blanking using the APM. Some laptops can use this to
2882	  turn off the LCD backlight when the screen blanker of the Linux
2883	  virtual console blanks the screen. Note that this is only used by
2884	  the virtual console screen blanker, and won't turn off the backlight
2885	  when using the X Window system. This also doesn't have anything to
2886	  do with your VESA-compliant power-saving monitor. Further, this
2887	  option doesn't work for all laptops -- it might not turn off your
2888	  backlight at all, or it might print a lot of errors to the console,
2889	  especially if you are using gpm.
2890
2891config APM_ALLOW_INTS
2892	bool "Allow interrupts during APM BIOS calls"
2893	help
2894	  Normally we disable external interrupts while we are making calls to
2895	  the APM BIOS as a measure to lessen the effects of a badly behaving
2896	  BIOS implementation.  The BIOS should reenable interrupts if it
2897	  needs to.  Unfortunately, some BIOSes do not -- especially those in
2898	  many of the newer IBM Thinkpads.  If you experience hangs when you
2899	  suspend, try setting this to Y.  Otherwise, say N.
2900
2901endif # APM
2902
2903source "drivers/cpufreq/Kconfig"
2904
2905source "drivers/cpuidle/Kconfig"
2906
2907source "drivers/idle/Kconfig"
2908
2909endmenu
2910
2911menu "Bus options (PCI etc.)"
2912
2913choice
2914	prompt "PCI access mode"
2915	depends on X86_32 && PCI
2916	default PCI_GOANY
2917	help
2918	  On PCI systems, the BIOS can be used to detect the PCI devices and
2919	  determine their configuration. However, some old PCI motherboards
2920	  have BIOS bugs and may crash if this is done. Also, some embedded
2921	  PCI-based systems don't have any BIOS at all. Linux can also try to
2922	  detect the PCI hardware directly without using the BIOS.
2923
2924	  With this option, you can specify how Linux should detect the
2925	  PCI devices. If you choose "BIOS", the BIOS will be used,
2926	  if you choose "Direct", the BIOS won't be used, and if you
2927	  choose "MMConfig", then PCI Express MMCONFIG will be used.
2928	  If you choose "Any", the kernel will try MMCONFIG, then the
2929	  direct access method and falls back to the BIOS if that doesn't
2930	  work. If unsure, go with the default, which is "Any".
2931
2932config PCI_GOBIOS
2933	bool "BIOS"
2934
2935config PCI_GOMMCONFIG
2936	bool "MMConfig"
2937
2938config PCI_GODIRECT
2939	bool "Direct"
2940
2941config PCI_GOOLPC
2942	bool "OLPC XO-1"
2943	depends on OLPC
2944
2945config PCI_GOANY
2946	bool "Any"
2947
2948endchoice
2949
2950config PCI_BIOS
2951	def_bool y
2952	depends on X86_32 && PCI && (PCI_GOBIOS || PCI_GOANY)
2953
2954# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
2955config PCI_DIRECT
2956	def_bool y
2957	depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC || PCI_GOMMCONFIG))
2958
2959config PCI_MMCONFIG
2960	bool "Support mmconfig PCI config space access" if X86_64
2961	default y
2962	depends on PCI && (ACPI || JAILHOUSE_GUEST)
2963	depends on X86_64 || (PCI_GOANY || PCI_GOMMCONFIG)
2964
2965config PCI_OLPC
2966	def_bool y
2967	depends on PCI && OLPC && (PCI_GOOLPC || PCI_GOANY)
2968
2969config PCI_XEN
2970	def_bool y
2971	depends on PCI && XEN
2972
2973config MMCONF_FAM10H
2974	def_bool y
2975	depends on X86_64 && PCI_MMCONFIG && ACPI
2976
2977config PCI_CNB20LE_QUIRK
2978	bool "Read CNB20LE Host Bridge Windows" if EXPERT
2979	depends on PCI
2980	help
2981	  Read the PCI windows out of the CNB20LE host bridge. This allows
2982	  PCI hotplug to work on systems with the CNB20LE chipset which do
2983	  not have ACPI.
2984
2985	  There's no public spec for this chipset, and this functionality
2986	  is known to be incomplete.
2987
2988	  You should say N unless you know you need this.
2989
2990config ISA_BUS
2991	bool "ISA bus support on modern systems" if EXPERT
2992	help
2993	  Expose ISA bus device drivers and options available for selection and
2994	  configuration. Enable this option if your target machine has an ISA
2995	  bus. ISA is an older system, displaced by PCI and newer bus
2996	  architectures -- if your target machine is modern, it probably does
2997	  not have an ISA bus.
2998
2999	  If unsure, say N.
3000
3001# x86_64 have no ISA slots, but can have ISA-style DMA.
3002config ISA_DMA_API
3003	bool "ISA-style DMA support" if (X86_64 && EXPERT)
3004	default y
3005	help
3006	  Enables ISA-style DMA support for devices requiring such controllers.
3007	  If unsure, say Y.
3008
3009if X86_32
3010
3011config ISA
3012	bool "ISA support"
3013	help
3014	  Find out whether you have ISA slots on your motherboard.  ISA is the
3015	  name of a bus system, i.e. the way the CPU talks to the other stuff
3016	  inside your box.  Other bus systems are PCI, EISA, MicroChannel
3017	  (MCA) or VESA.  ISA is an older system, now being displaced by PCI;
3018	  newer boards don't support it.  If you have ISA, say Y, otherwise N.
3019
3020config SCx200
3021	tristate "NatSemi SCx200 support"
3022	help
3023	  This provides basic support for National Semiconductor's
3024	  (now AMD's) Geode processors.  The driver probes for the
3025	  PCI-IDs of several on-chip devices, so its a good dependency
3026	  for other scx200_* drivers.
3027
3028	  If compiled as a module, the driver is named scx200.
3029
3030config SCx200HR_TIMER
3031	tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
3032	depends on SCx200
3033	default y
3034	help
3035	  This driver provides a clocksource built upon the on-chip
3036	  27MHz high-resolution timer.  Its also a workaround for
3037	  NSC Geode SC-1100's buggy TSC, which loses time when the
3038	  processor goes idle (as is done by the scheduler).  The
3039	  other workaround is idle=poll boot option.
3040
3041config OLPC
3042	bool "One Laptop Per Child support"
3043	depends on !X86_PAE
3044	select GPIOLIB
3045	select OF
3046	select OF_PROMTREE
3047	select IRQ_DOMAIN
3048	select OLPC_EC
3049	help
3050	  Add support for detecting the unique features of the OLPC
3051	  XO hardware.
3052
3053config OLPC_XO1_PM
3054	bool "OLPC XO-1 Power Management"
3055	depends on OLPC && MFD_CS5535=y && PM_SLEEP
3056	help
3057	  Add support for poweroff and suspend of the OLPC XO-1 laptop.
3058
3059config OLPC_XO1_RTC
3060	bool "OLPC XO-1 Real Time Clock"
3061	depends on OLPC_XO1_PM && RTC_DRV_CMOS
3062	help
3063	  Add support for the XO-1 real time clock, which can be used as a
3064	  programmable wakeup source.
3065
3066config OLPC_XO1_SCI
3067	bool "OLPC XO-1 SCI extras"
3068	depends on OLPC && OLPC_XO1_PM && GPIO_CS5535=y
3069	depends on INPUT=y
3070	select POWER_SUPPLY
3071	help
3072	  Add support for SCI-based features of the OLPC XO-1 laptop:
3073	   - EC-driven system wakeups
3074	   - Power button
3075	   - Ebook switch
3076	   - Lid switch
3077	   - AC adapter status updates
3078	   - Battery status updates
3079
3080config OLPC_XO15_SCI
3081	bool "OLPC XO-1.5 SCI extras"
3082	depends on OLPC && ACPI
3083	select POWER_SUPPLY
3084	help
3085	  Add support for SCI-based features of the OLPC XO-1.5 laptop:
3086	   - EC-driven system wakeups
3087	   - AC adapter status updates
3088	   - Battery status updates
3089
3090config GEODE_COMMON
3091	bool
3092
3093config ALIX
3094	bool "PCEngines ALIX System Support (LED setup)"
3095	select GPIOLIB
3096	select GEODE_COMMON
3097	help
3098	  This option enables system support for the PCEngines ALIX.
3099	  At present this just sets up LEDs for GPIO control on
3100	  ALIX2/3/6 boards.  However, other system specific setup should
3101	  get added here.
3102
3103	  Note: You must still enable the drivers for GPIO and LED support
3104	  (GPIO_CS5535 & LEDS_GPIO) to actually use the LEDs
3105
3106	  Note: You have to set alix.force=1 for boards with Award BIOS.
3107
3108config NET5501
3109	bool "Soekris Engineering net5501 System Support (LEDS, GPIO, etc)"
3110	select GPIOLIB
3111	select GEODE_COMMON
3112	help
3113	  This option enables system support for the Soekris Engineering net5501.
3114
3115config GEOS
3116	bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"
3117	select GPIOLIB
3118	select GEODE_COMMON
3119	depends on DMI
3120	help
3121	  This option enables system support for the Traverse Technologies GEOS.
3122
3123config TS5500
3124	bool "Technologic Systems TS-5500 platform support"
3125	depends on MELAN
3126	select CHECK_SIGNATURE
3127	select NEW_LEDS
3128	select LEDS_CLASS
3129	help
3130	  This option enables system support for the Technologic Systems TS-5500.
3131
3132endif # X86_32
3133
3134config AMD_NB
3135	def_bool y
3136	depends on AMD_NODE
3137
3138config AMD_NODE
3139	def_bool y
3140	depends on CPU_SUP_AMD && PCI
3141
3142endmenu
3143
3144menu "Binary Emulations"
3145
3146config IA32_EMULATION
3147	bool "IA32 Emulation"
3148	depends on X86_64
3149	select ARCH_WANT_OLD_COMPAT_IPC
3150	select BINFMT_ELF
3151	select COMPAT_OLD_SIGACTION
3152	help
3153	  Include code to run legacy 32-bit programs under a
3154	  64-bit kernel. You should likely turn this on, unless you're
3155	  100% sure that you don't have any 32-bit programs left.
3156
3157config IA32_EMULATION_DEFAULT_DISABLED
3158	bool "IA32 emulation disabled by default"
3159	default n
3160	depends on IA32_EMULATION
3161	help
3162	  Make IA32 emulation disabled by default. This prevents loading 32-bit
3163	  processes and access to 32-bit syscalls. If unsure, leave it to its
3164	  default value.
3165
3166config X86_X32_ABI
3167	bool "x32 ABI for 64-bit mode"
3168	depends on X86_64
3169	# llvm-objcopy does not convert x86_64 .note.gnu.property or
3170	# compressed debug sections to x86_x32 properly:
3171	# https://github.com/ClangBuiltLinux/linux/issues/514
3172	# https://github.com/ClangBuiltLinux/linux/issues/1141
3173	depends on $(success,$(OBJCOPY) --version | head -n1 | grep -qv llvm)
3174	help
3175	  Include code to run binaries for the x32 native 32-bit ABI
3176	  for 64-bit processors.  An x32 process gets access to the
3177	  full 64-bit register file and wide data path while leaving
3178	  pointers at 32 bits for smaller memory footprint.
3179
3180config COMPAT_32
3181	def_bool y
3182	depends on IA32_EMULATION || X86_32
3183	select HAVE_UID16
3184	select OLD_SIGSUSPEND3
3185
3186config COMPAT
3187	def_bool y
3188	depends on IA32_EMULATION || X86_X32_ABI
3189
3190config COMPAT_FOR_U64_ALIGNMENT
3191	def_bool y
3192	depends on COMPAT
3193
3194endmenu
3195
3196config HAVE_ATOMIC_IOMAP
3197	def_bool y
3198	depends on X86_32
3199
3200source "arch/x86/kvm/Kconfig"
3201
3202source "arch/x86/Kconfig.assembler"
3203