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