xref: /openbmc/linux/arch/Kconfig (revision f0931824)
1# SPDX-License-Identifier: GPL-2.0
2#
3# General architecture dependent options
4#
5
6#
7# Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can
8# override the default values in this file.
9#
10source "arch/$(SRCARCH)/Kconfig"
11
12config ARCH_CONFIGURES_CPU_MITIGATIONS
13	bool
14
15if !ARCH_CONFIGURES_CPU_MITIGATIONS
16config CPU_MITIGATIONS
17	def_bool y
18endif
19
20menu "General architecture-dependent options"
21
22config ARCH_HAS_SUBPAGE_FAULTS
23	bool
24	help
25	  Select if the architecture can check permissions at sub-page
26	  granularity (e.g. arm64 MTE). The probe_user_*() functions
27	  must be implemented.
28
29config HOTPLUG_SMT
30	bool
31
32config SMT_NUM_THREADS_DYNAMIC
33	bool
34
35# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
36config HOTPLUG_CORE_SYNC
37	bool
38
39# Basic CPU dead synchronization selected by architecture
40config HOTPLUG_CORE_SYNC_DEAD
41	bool
42	select HOTPLUG_CORE_SYNC
43
44# Full CPU synchronization with alive state selected by architecture
45config HOTPLUG_CORE_SYNC_FULL
46	bool
47	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
48	select HOTPLUG_CORE_SYNC
49
50config HOTPLUG_SPLIT_STARTUP
51	bool
52	select HOTPLUG_CORE_SYNC_FULL
53
54config HOTPLUG_PARALLEL
55	bool
56	select HOTPLUG_SPLIT_STARTUP
57
58config GENERIC_ENTRY
59	bool
60
61config KPROBES
62	bool "Kprobes"
63	depends on MODULES
64	depends on HAVE_KPROBES
65	select KALLSYMS
66	select TASKS_RCU if PREEMPTION
67	help
68	  Kprobes allows you to trap at almost any kernel address and
69	  execute a callback function.  register_kprobe() establishes
70	  a probepoint and specifies the callback.  Kprobes is useful
71	  for kernel debugging, non-intrusive instrumentation and testing.
72	  If in doubt, say "N".
73
74config JUMP_LABEL
75	bool "Optimize very unlikely/likely branches"
76	depends on HAVE_ARCH_JUMP_LABEL
77	select OBJTOOL if HAVE_JUMP_LABEL_HACK
78	help
79	  This option enables a transparent branch optimization that
80	  makes certain almost-always-true or almost-always-false branch
81	  conditions even cheaper to execute within the kernel.
82
83	  Certain performance-sensitive kernel code, such as trace points,
84	  scheduler functionality, networking code and KVM have such
85	  branches and include support for this optimization technique.
86
87	  If it is detected that the compiler has support for "asm goto",
88	  the kernel will compile such branches with just a nop
89	  instruction. When the condition flag is toggled to true, the
90	  nop will be converted to a jump instruction to execute the
91	  conditional block of instructions.
92
93	  This technique lowers overhead and stress on the branch prediction
94	  of the processor and generally makes the kernel faster. The update
95	  of the condition is slower, but those are always very rare.
96
97	  ( On 32-bit x86, the necessary options added to the compiler
98	    flags may increase the size of the kernel slightly. )
99
100config STATIC_KEYS_SELFTEST
101	bool "Static key selftest"
102	depends on JUMP_LABEL
103	help
104	  Boot time self-test of the branch patching code.
105
106config STATIC_CALL_SELFTEST
107	bool "Static call selftest"
108	depends on HAVE_STATIC_CALL
109	help
110	  Boot time self-test of the call patching code.
111
112config OPTPROBES
113	def_bool y
114	depends on KPROBES && HAVE_OPTPROBES
115	select TASKS_RCU if PREEMPTION
116
117config KPROBES_ON_FTRACE
118	def_bool y
119	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
120	depends on DYNAMIC_FTRACE_WITH_REGS
121	help
122	  If function tracer is enabled and the arch supports full
123	  passing of pt_regs to function tracing, then kprobes can
124	  optimize on top of function tracing.
125
126config UPROBES
127	def_bool n
128	depends on ARCH_SUPPORTS_UPROBES
129	help
130	  Uprobes is the user-space counterpart to kprobes: they
131	  enable instrumentation applications (such as 'perf probe')
132	  to establish unintrusive probes in user-space binaries and
133	  libraries, by executing handler functions when the probes
134	  are hit by user-space applications.
135
136	  ( These probes come in the form of single-byte breakpoints,
137	    managed by the kernel and kept transparent to the probed
138	    application. )
139
140config HAVE_64BIT_ALIGNED_ACCESS
141	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
142	help
143	  Some architectures require 64 bit accesses to be 64 bit
144	  aligned, which also requires structs containing 64 bit values
145	  to be 64 bit aligned too. This includes some 32 bit
146	  architectures which can do 64 bit accesses, as well as 64 bit
147	  architectures without unaligned access.
148
149	  This symbol should be selected by an architecture if 64 bit
150	  accesses are required to be 64 bit aligned in this way even
151	  though it is not a 64 bit architecture.
152
153	  See Documentation/core-api/unaligned-memory-access.rst for
154	  more information on the topic of unaligned memory accesses.
155
156config HAVE_EFFICIENT_UNALIGNED_ACCESS
157	bool
158	help
159	  Some architectures are unable to perform unaligned accesses
160	  without the use of get_unaligned/put_unaligned. Others are
161	  unable to perform such accesses efficiently (e.g. trap on
162	  unaligned access and require fixing it up in the exception
163	  handler.)
164
165	  This symbol should be selected by an architecture if it can
166	  perform unaligned accesses efficiently to allow different
167	  code paths to be selected for these cases. Some network
168	  drivers, for example, could opt to not fix up alignment
169	  problems with received packets if doing so would not help
170	  much.
171
172	  See Documentation/core-api/unaligned-memory-access.rst for more
173	  information on the topic of unaligned memory accesses.
174
175config ARCH_USE_BUILTIN_BSWAP
176	bool
177	help
178	  Modern versions of GCC (since 4.4) have builtin functions
179	  for handling byte-swapping. Using these, instead of the old
180	  inline assembler that the architecture code provides in the
181	  __arch_bswapXX() macros, allows the compiler to see what's
182	  happening and offers more opportunity for optimisation. In
183	  particular, the compiler will be able to combine the byteswap
184	  with a nearby load or store and use load-and-swap or
185	  store-and-swap instructions if the architecture has them. It
186	  should almost *never* result in code which is worse than the
187	  hand-coded assembler in <asm/swab.h>.  But just in case it
188	  does, the use of the builtins is optional.
189
190	  Any architecture with load-and-swap or store-and-swap
191	  instructions should set this. And it shouldn't hurt to set it
192	  on architectures that don't have such instructions.
193
194config KRETPROBES
195	def_bool y
196	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
197
198config KRETPROBE_ON_RETHOOK
199	def_bool y
200	depends on HAVE_RETHOOK
201	depends on KRETPROBES
202	select RETHOOK
203
204config USER_RETURN_NOTIFIER
205	bool
206	depends on HAVE_USER_RETURN_NOTIFIER
207	help
208	  Provide a kernel-internal notification when a cpu is about to
209	  switch to user mode.
210
211config HAVE_IOREMAP_PROT
212	bool
213
214config HAVE_KPROBES
215	bool
216
217config HAVE_KRETPROBES
218	bool
219
220config HAVE_OPTPROBES
221	bool
222
223config HAVE_KPROBES_ON_FTRACE
224	bool
225
226config ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
227	bool
228	help
229	  Since kretprobes modifies return address on the stack, the
230	  stacktrace may see the kretprobe trampoline address instead
231	  of correct one. If the architecture stacktrace code and
232	  unwinder can adjust such entries, select this configuration.
233
234config HAVE_FUNCTION_ERROR_INJECTION
235	bool
236
237config HAVE_NMI
238	bool
239
240config HAVE_FUNCTION_DESCRIPTORS
241	bool
242
243config TRACE_IRQFLAGS_SUPPORT
244	bool
245
246config TRACE_IRQFLAGS_NMI_SUPPORT
247	bool
248
249#
250# An arch should select this if it provides all these things:
251#
252#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
253#	arch_has_single_step()	if there is hardware single-step support
254#	arch_has_block_step()	if there is hardware block-step support
255#	asm/syscall.h		supplying asm-generic/syscall.h interface
256#	linux/regset.h		user_regset interfaces
257#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
258#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
259#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
260#
261config HAVE_ARCH_TRACEHOOK
262	bool
263
264config HAVE_DMA_CONTIGUOUS
265	bool
266
267config GENERIC_SMP_IDLE_THREAD
268	bool
269
270config GENERIC_IDLE_POLL_SETUP
271	bool
272
273config ARCH_HAS_FORTIFY_SOURCE
274	bool
275	help
276	  An architecture should select this when it can successfully
277	  build and run with CONFIG_FORTIFY_SOURCE.
278
279#
280# Select if the arch provides a historic keepinit alias for the retain_initrd
281# command line option
282#
283config ARCH_HAS_KEEPINITRD
284	bool
285
286# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
287config ARCH_HAS_SET_MEMORY
288	bool
289
290# Select if arch has all set_direct_map_invalid/default() functions
291config ARCH_HAS_SET_DIRECT_MAP
292	bool
293
294#
295# Select if the architecture provides the arch_dma_set_uncached symbol to
296# either provide an uncached segment alias for a DMA allocation, or
297# to remap the page tables in place.
298#
299config ARCH_HAS_DMA_SET_UNCACHED
300	bool
301
302#
303# Select if the architectures provides the arch_dma_clear_uncached symbol
304# to undo an in-place page table remap for uncached access.
305#
306config ARCH_HAS_DMA_CLEAR_UNCACHED
307	bool
308
309config ARCH_HAS_CPU_FINALIZE_INIT
310	bool
311
312# Select if arch init_task must go in the __init_task_data section
313config ARCH_TASK_STRUCT_ON_STACK
314	bool
315
316# Select if arch has its private alloc_task_struct() function
317config ARCH_TASK_STRUCT_ALLOCATOR
318	bool
319
320config HAVE_ARCH_THREAD_STRUCT_WHITELIST
321	bool
322	depends on !ARCH_TASK_STRUCT_ALLOCATOR
323	help
324	  An architecture should select this to provide hardened usercopy
325	  knowledge about what region of the thread_struct should be
326	  whitelisted for copying to userspace. Normally this is only the
327	  FPU registers. Specifically, arch_thread_struct_whitelist()
328	  should be implemented. Without this, the entire thread_struct
329	  field in task_struct will be left whitelisted.
330
331# Select if arch has its private alloc_thread_stack() function
332config ARCH_THREAD_STACK_ALLOCATOR
333	bool
334
335# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
336config ARCH_WANTS_DYNAMIC_TASK_STRUCT
337	bool
338
339config ARCH_WANTS_NO_INSTR
340	bool
341	help
342	  An architecture should select this if the noinstr macro is being used on
343	  functions to denote that the toolchain should avoid instrumenting such
344	  functions and is required for correctness.
345
346config ARCH_32BIT_OFF_T
347	bool
348	depends on !64BIT
349	help
350	  All new 32-bit architectures should have 64-bit off_t type on
351	  userspace side which corresponds to the loff_t kernel type. This
352	  is the requirement for modern ABIs. Some existing architectures
353	  still support 32-bit off_t. This option is enabled for all such
354	  architectures explicitly.
355
356# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
357config ARCH_32BIT_USTAT_F_TINODE
358	bool
359
360config HAVE_ASM_MODVERSIONS
361	bool
362	help
363	  This symbol should be selected by an architecture if it provides
364	  <asm/asm-prototypes.h> to support the module versioning for symbols
365	  exported from assembly code.
366
367config HAVE_REGS_AND_STACK_ACCESS_API
368	bool
369	help
370	  This symbol should be selected by an architecture if it supports
371	  the API needed to access registers and stack entries from pt_regs,
372	  declared in asm/ptrace.h
373	  For example the kprobes-based event tracer needs this API.
374
375config HAVE_RSEQ
376	bool
377	depends on HAVE_REGS_AND_STACK_ACCESS_API
378	help
379	  This symbol should be selected by an architecture if it
380	  supports an implementation of restartable sequences.
381
382config HAVE_RUST
383	bool
384	help
385	  This symbol should be selected by an architecture if it
386	  supports Rust.
387
388config HAVE_FUNCTION_ARG_ACCESS_API
389	bool
390	help
391	  This symbol should be selected by an architecture if it supports
392	  the API needed to access function arguments from pt_regs,
393	  declared in asm/ptrace.h
394
395config HAVE_HW_BREAKPOINT
396	bool
397	depends on PERF_EVENTS
398
399config HAVE_MIXED_BREAKPOINTS_REGS
400	bool
401	depends on HAVE_HW_BREAKPOINT
402	help
403	  Depending on the arch implementation of hardware breakpoints,
404	  some of them have separate registers for data and instruction
405	  breakpoints addresses, others have mixed registers to store
406	  them but define the access type in a control register.
407	  Select this option if your arch implements breakpoints under the
408	  latter fashion.
409
410config HAVE_USER_RETURN_NOTIFIER
411	bool
412
413config HAVE_PERF_EVENTS_NMI
414	bool
415	help
416	  System hardware can generate an NMI using the perf event
417	  subsystem.  Also has support for calculating CPU cycle events
418	  to determine how many clock cycles in a given period.
419
420config HAVE_HARDLOCKUP_DETECTOR_PERF
421	bool
422	depends on HAVE_PERF_EVENTS_NMI
423	help
424	  The arch chooses to use the generic perf-NMI-based hardlockup
425	  detector. Must define HAVE_PERF_EVENTS_NMI.
426
427config HAVE_HARDLOCKUP_DETECTOR_ARCH
428	bool
429	help
430	  The arch provides its own hardlockup detector implementation instead
431	  of the generic ones.
432
433	  It uses the same command line parameters, and sysctl interface,
434	  as the generic hardlockup detectors.
435
436config HAVE_PERF_REGS
437	bool
438	help
439	  Support selective register dumps for perf events. This includes
440	  bit-mapping of each registers and a unique architecture id.
441
442config HAVE_PERF_USER_STACK_DUMP
443	bool
444	help
445	  Support user stack dumps for perf event samples. This needs
446	  access to the user stack pointer which is not unified across
447	  architectures.
448
449config HAVE_ARCH_JUMP_LABEL
450	bool
451
452config HAVE_ARCH_JUMP_LABEL_RELATIVE
453	bool
454
455config MMU_GATHER_TABLE_FREE
456	bool
457
458config MMU_GATHER_RCU_TABLE_FREE
459	bool
460	select MMU_GATHER_TABLE_FREE
461
462config MMU_GATHER_PAGE_SIZE
463	bool
464
465config MMU_GATHER_NO_RANGE
466	bool
467	select MMU_GATHER_MERGE_VMAS
468
469config MMU_GATHER_NO_FLUSH_CACHE
470	bool
471
472config MMU_GATHER_MERGE_VMAS
473	bool
474
475config MMU_GATHER_NO_GATHER
476	bool
477	depends on MMU_GATHER_TABLE_FREE
478
479config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
480	bool
481	help
482	  Temporary select until all architectures can be converted to have
483	  irqs disabled over activate_mm. Architectures that do IPI based TLB
484	  shootdowns should enable this.
485
486# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
487# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
488# to/from kernel threads when the same mm is running on a lot of CPUs (a large
489# multi-threaded application), by reducing contention on the mm refcount.
490#
491# This can be disabled if the architecture ensures no CPUs are using an mm as a
492# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
493# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
494# final exit(2) TLB flush, for example.
495#
496# To implement this, an arch *must*:
497# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
498# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
499# converted already).
500config MMU_LAZY_TLB_REFCOUNT
501	def_bool y
502	depends on !MMU_LAZY_TLB_SHOOTDOWN
503
504# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
505# mm as a lazy tlb beyond its last reference count, by shooting down these
506# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
507# be using the mm as a lazy tlb, so that they may switch themselves to using
508# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
509# may be using mm as a lazy tlb mm.
510#
511# To implement this, an arch *must*:
512# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
513#   at least all possible CPUs in which the mm is lazy.
514# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
515config MMU_LAZY_TLB_SHOOTDOWN
516	bool
517
518config ARCH_HAVE_NMI_SAFE_CMPXCHG
519	bool
520
521config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
522	bool
523
524config HAVE_ALIGNED_STRUCT_PAGE
525	bool
526	help
527	  This makes sure that struct pages are double word aligned and that
528	  e.g. the SLUB allocator can perform double word atomic operations
529	  on a struct page for better performance. However selecting this
530	  might increase the size of a struct page by a word.
531
532config HAVE_CMPXCHG_LOCAL
533	bool
534
535config HAVE_CMPXCHG_DOUBLE
536	bool
537
538config ARCH_WEAK_RELEASE_ACQUIRE
539	bool
540
541config ARCH_WANT_IPC_PARSE_VERSION
542	bool
543
544config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
545	bool
546
547config ARCH_WANT_OLD_COMPAT_IPC
548	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
549	bool
550
551config HAVE_ARCH_SECCOMP
552	bool
553	help
554	  An arch should select this symbol to support seccomp mode 1 (the fixed
555	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
556	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
557	  - __NR_seccomp_read_32
558	  - __NR_seccomp_write_32
559	  - __NR_seccomp_exit_32
560	  - __NR_seccomp_sigreturn_32
561
562config HAVE_ARCH_SECCOMP_FILTER
563	bool
564	select HAVE_ARCH_SECCOMP
565	help
566	  An arch should select this symbol if it provides all of these things:
567	  - all the requirements for HAVE_ARCH_SECCOMP
568	  - syscall_get_arch()
569	  - syscall_get_arguments()
570	  - syscall_rollback()
571	  - syscall_set_return_value()
572	  - SIGSYS siginfo_t support
573	  - secure_computing is called from a ptrace_event()-safe context
574	  - secure_computing return value is checked and a return value of -1
575	    results in the system call being skipped immediately.
576	  - seccomp syscall wired up
577	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
578	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
579	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
580
581config SECCOMP
582	prompt "Enable seccomp to safely execute untrusted bytecode"
583	def_bool y
584	depends on HAVE_ARCH_SECCOMP
585	help
586	  This kernel feature is useful for number crunching applications
587	  that may need to handle untrusted bytecode during their
588	  execution. By using pipes or other transports made available
589	  to the process as file descriptors supporting the read/write
590	  syscalls, it's possible to isolate those applications in their
591	  own address space using seccomp. Once seccomp is enabled via
592	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
593	  disabled and the task is only allowed to execute a few safe
594	  syscalls defined by each seccomp mode.
595
596	  If unsure, say Y.
597
598config SECCOMP_FILTER
599	def_bool y
600	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
601	help
602	  Enable tasks to build secure computing environments defined
603	  in terms of Berkeley Packet Filter programs which implement
604	  task-defined system call filtering polices.
605
606	  See Documentation/userspace-api/seccomp_filter.rst for details.
607
608config SECCOMP_CACHE_DEBUG
609	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
610	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
611	depends on PROC_FS
612	help
613	  This enables the /proc/pid/seccomp_cache interface to monitor
614	  seccomp cache data. The file format is subject to change. Reading
615	  the file requires CAP_SYS_ADMIN.
616
617	  This option is for debugging only. Enabling presents the risk that
618	  an adversary may be able to infer the seccomp filter logic.
619
620	  If unsure, say N.
621
622config HAVE_ARCH_STACKLEAK
623	bool
624	help
625	  An architecture should select this if it has the code which
626	  fills the used part of the kernel stack with the STACKLEAK_POISON
627	  value before returning from system calls.
628
629config HAVE_STACKPROTECTOR
630	bool
631	help
632	  An arch should select this symbol if:
633	  - it has implemented a stack canary (e.g. __stack_chk_guard)
634
635config STACKPROTECTOR
636	bool "Stack Protector buffer overflow detection"
637	depends on HAVE_STACKPROTECTOR
638	depends on $(cc-option,-fstack-protector)
639	default y
640	help
641	  This option turns on the "stack-protector" GCC feature. This
642	  feature puts, at the beginning of functions, a canary value on
643	  the stack just before the return address, and validates
644	  the value just before actually returning.  Stack based buffer
645	  overflows (that need to overwrite this return address) now also
646	  overwrite the canary, which gets detected and the attack is then
647	  neutralized via a kernel panic.
648
649	  Functions will have the stack-protector canary logic added if they
650	  have an 8-byte or larger character array on the stack.
651
652	  This feature requires gcc version 4.2 or above, or a distribution
653	  gcc with the feature backported ("-fstack-protector").
654
655	  On an x86 "defconfig" build, this feature adds canary checks to
656	  about 3% of all kernel functions, which increases kernel code size
657	  by about 0.3%.
658
659config STACKPROTECTOR_STRONG
660	bool "Strong Stack Protector"
661	depends on STACKPROTECTOR
662	depends on $(cc-option,-fstack-protector-strong)
663	default y
664	help
665	  Functions will have the stack-protector canary logic added in any
666	  of the following conditions:
667
668	  - local variable's address used as part of the right hand side of an
669	    assignment or function argument
670	  - local variable is an array (or union containing an array),
671	    regardless of array type or length
672	  - uses register local variables
673
674	  This feature requires gcc version 4.9 or above, or a distribution
675	  gcc with the feature backported ("-fstack-protector-strong").
676
677	  On an x86 "defconfig" build, this feature adds canary checks to
678	  about 20% of all kernel functions, which increases the kernel code
679	  size by about 2%.
680
681config ARCH_SUPPORTS_SHADOW_CALL_STACK
682	bool
683	help
684	  An architecture should select this if it supports the compiler's
685	  Shadow Call Stack and implements runtime support for shadow stack
686	  switching.
687
688config SHADOW_CALL_STACK
689	bool "Shadow Call Stack"
690	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
691	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
692	depends on MMU
693	help
694	  This option enables the compiler's Shadow Call Stack, which
695	  uses a shadow stack to protect function return addresses from
696	  being overwritten by an attacker. More information can be found
697	  in the compiler's documentation:
698
699	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
700	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
701
702	  Note that security guarantees in the kernel differ from the
703	  ones documented for user space. The kernel must store addresses
704	  of shadow stacks in memory, which means an attacker capable of
705	  reading and writing arbitrary memory may be able to locate them
706	  and hijack control flow by modifying the stacks.
707
708config DYNAMIC_SCS
709	bool
710	help
711	  Set by the arch code if it relies on code patching to insert the
712	  shadow call stack push and pop instructions rather than on the
713	  compiler.
714
715config LTO
716	bool
717	help
718	  Selected if the kernel will be built using the compiler's LTO feature.
719
720config LTO_CLANG
721	bool
722	select LTO
723	help
724	  Selected if the kernel will be built using Clang's LTO feature.
725
726config ARCH_SUPPORTS_LTO_CLANG
727	bool
728	help
729	  An architecture should select this option if it supports:
730	  - compiling with Clang,
731	  - compiling inline assembly with Clang's integrated assembler,
732	  - and linking with LLD.
733
734config ARCH_SUPPORTS_LTO_CLANG_THIN
735	bool
736	help
737	  An architecture should select this option if it can support Clang's
738	  ThinLTO mode.
739
740config HAS_LTO_CLANG
741	def_bool y
742	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
743	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
744	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
745	depends on ARCH_SUPPORTS_LTO_CLANG
746	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
747	# https://github.com/ClangBuiltLinux/linux/issues/1721
748	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
749	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
750	depends on !GCOV_KERNEL
751	help
752	  The compiler and Kconfig options support building with Clang's
753	  LTO.
754
755choice
756	prompt "Link Time Optimization (LTO)"
757	default LTO_NONE
758	help
759	  This option enables Link Time Optimization (LTO), which allows the
760	  compiler to optimize binaries globally.
761
762	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
763	  so it's disabled by default.
764
765config LTO_NONE
766	bool "None"
767	help
768	  Build the kernel normally, without Link Time Optimization (LTO).
769
770config LTO_CLANG_FULL
771	bool "Clang Full LTO (EXPERIMENTAL)"
772	depends on HAS_LTO_CLANG
773	depends on !COMPILE_TEST
774	select LTO_CLANG
775	help
776	  This option enables Clang's full Link Time Optimization (LTO), which
777	  allows the compiler to optimize the kernel globally. If you enable
778	  this option, the compiler generates LLVM bitcode instead of ELF
779	  object files, and the actual compilation from bitcode happens at
780	  the LTO link step, which may take several minutes depending on the
781	  kernel configuration. More information can be found from LLVM's
782	  documentation:
783
784	    https://llvm.org/docs/LinkTimeOptimization.html
785
786	  During link time, this option can use a large amount of RAM, and
787	  may take much longer than the ThinLTO option.
788
789config LTO_CLANG_THIN
790	bool "Clang ThinLTO (EXPERIMENTAL)"
791	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
792	select LTO_CLANG
793	help
794	  This option enables Clang's ThinLTO, which allows for parallel
795	  optimization and faster incremental compiles compared to the
796	  CONFIG_LTO_CLANG_FULL option. More information can be found
797	  from Clang's documentation:
798
799	    https://clang.llvm.org/docs/ThinLTO.html
800
801	  If unsure, say Y.
802endchoice
803
804config ARCH_SUPPORTS_CFI_CLANG
805	bool
806	help
807	  An architecture should select this option if it can support Clang's
808	  Control-Flow Integrity (CFI) checking.
809
810config ARCH_USES_CFI_TRAPS
811	bool
812
813config CFI_CLANG
814	bool "Use Clang's Control Flow Integrity (CFI)"
815	depends on ARCH_SUPPORTS_CFI_CLANG
816	depends on $(cc-option,-fsanitize=kcfi)
817	help
818	  This option enables Clang’s forward-edge Control Flow Integrity
819	  (CFI) checking, where the compiler injects a runtime check to each
820	  indirect function call to ensure the target is a valid function with
821	  the correct static type. This restricts possible call targets and
822	  makes it more difficult for an attacker to exploit bugs that allow
823	  the modification of stored function pointers. More information can be
824	  found from Clang's documentation:
825
826	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
827
828config CFI_PERMISSIVE
829	bool "Use CFI in permissive mode"
830	depends on CFI_CLANG
831	help
832	  When selected, Control Flow Integrity (CFI) violations result in a
833	  warning instead of a kernel panic. This option should only be used
834	  for finding indirect call type mismatches during development.
835
836	  If unsure, say N.
837
838config HAVE_ARCH_WITHIN_STACK_FRAMES
839	bool
840	help
841	  An architecture should select this if it can walk the kernel stack
842	  frames to determine if an object is part of either the arguments
843	  or local variables (i.e. that it excludes saved return addresses,
844	  and similar) by implementing an inline arch_within_stack_frames(),
845	  which is used by CONFIG_HARDENED_USERCOPY.
846
847config HAVE_CONTEXT_TRACKING_USER
848	bool
849	help
850	  Provide kernel/user boundaries probes necessary for subsystems
851	  that need it, such as userspace RCU extended quiescent state.
852	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
853	  optimized behind static key or through the slow path using TIF_NOHZ
854	  flag. Exceptions handlers must be wrapped as well. Irqs are already
855	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
856	  handling on irq exit still need to be protected.
857
858config HAVE_CONTEXT_TRACKING_USER_OFFSTACK
859	bool
860	help
861	  Architecture neither relies on exception_enter()/exception_exit()
862	  nor on schedule_user(). Also preempt_schedule_notrace() and
863	  preempt_schedule_irq() can't be called in a preemptible section
864	  while context tracking is CONTEXT_USER. This feature reflects a sane
865	  entry implementation where the following requirements are met on
866	  critical entry code, ie: before user_exit() or after user_enter():
867
868	  - Critical entry code isn't preemptible (or better yet:
869	    not interruptible).
870	  - No use of RCU read side critical sections, unless ct_nmi_enter()
871	    got called.
872	  - No use of instrumentation, unless instrumentation_begin() got
873	    called.
874
875config HAVE_TIF_NOHZ
876	bool
877	help
878	  Arch relies on TIF_NOHZ and syscall slow path to implement context
879	  tracking calls to user_enter()/user_exit().
880
881config HAVE_VIRT_CPU_ACCOUNTING
882	bool
883
884config HAVE_VIRT_CPU_ACCOUNTING_IDLE
885	bool
886	help
887	  Architecture has its own way to account idle CPU time and therefore
888	  doesn't implement vtime_account_idle().
889
890config ARCH_HAS_SCALED_CPUTIME
891	bool
892
893config HAVE_VIRT_CPU_ACCOUNTING_GEN
894	bool
895	default y if 64BIT
896	help
897	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
898	  Before enabling this option, arch code must be audited
899	  to ensure there are no races in concurrent read/write of
900	  cputime_t. For example, reading/writing 64-bit cputime_t on
901	  some 32-bit arches may require multiple accesses, so proper
902	  locking is needed to protect against concurrent accesses.
903
904config HAVE_IRQ_TIME_ACCOUNTING
905	bool
906	help
907	  Archs need to ensure they use a high enough resolution clock to
908	  support irq time accounting and then call enable_sched_clock_irqtime().
909
910config HAVE_MOVE_PUD
911	bool
912	help
913	  Architectures that select this are able to move page tables at the
914	  PUD level. If there are only 3 page table levels, the move effectively
915	  happens at the PGD level.
916
917config HAVE_MOVE_PMD
918	bool
919	help
920	  Archs that select this are able to move page tables at the PMD level.
921
922config HAVE_ARCH_TRANSPARENT_HUGEPAGE
923	bool
924
925config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
926	bool
927
928config HAVE_ARCH_HUGE_VMAP
929	bool
930
931#
932#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
933#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
934#  must be used to enable allocations to use hugepages.
935#
936config HAVE_ARCH_HUGE_VMALLOC
937	depends on HAVE_ARCH_HUGE_VMAP
938	bool
939
940config ARCH_WANT_HUGE_PMD_SHARE
941	bool
942
943# Archs that want to use pmd_mkwrite on kernel memory need it defined even
944# if there are no userspace memory management features that use it
945config ARCH_WANT_KERNEL_PMD_MKWRITE
946	bool
947
948config ARCH_WANT_PMD_MKWRITE
949	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
950
951config HAVE_ARCH_SOFT_DIRTY
952	bool
953
954config HAVE_MOD_ARCH_SPECIFIC
955	bool
956	help
957	  The arch uses struct mod_arch_specific to store data.  Many arches
958	  just need a simple module loader without arch specific data - those
959	  should not enable this.
960
961config MODULES_USE_ELF_RELA
962	bool
963	help
964	  Modules only use ELF RELA relocations.  Modules with ELF REL
965	  relocations will give an error.
966
967config MODULES_USE_ELF_REL
968	bool
969	help
970	  Modules only use ELF REL relocations.  Modules with ELF RELA
971	  relocations will give an error.
972
973config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
974	bool
975	help
976	  For architectures like powerpc/32 which have constraints on module
977	  allocation and need to allocate module data outside of module area.
978
979config HAVE_IRQ_EXIT_ON_IRQ_STACK
980	bool
981	help
982	  Architecture doesn't only execute the irq handler on the irq stack
983	  but also irq_exit(). This way we can process softirqs on this irq
984	  stack instead of switching to a new one when we call __do_softirq()
985	  in the end of an hardirq.
986	  This spares a stack switch and improves cache usage on softirq
987	  processing.
988
989config HAVE_SOFTIRQ_ON_OWN_STACK
990	bool
991	help
992	  Architecture provides a function to run __do_softirq() on a
993	  separate stack.
994
995config SOFTIRQ_ON_OWN_STACK
996	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
997
998config ALTERNATE_USER_ADDRESS_SPACE
999	bool
1000	help
1001	  Architectures set this when the CPU uses separate address
1002	  spaces for kernel and user space pointers. In this case, the
1003	  access_ok() check on a __user pointer is skipped.
1004
1005config PGTABLE_LEVELS
1006	int
1007	default 2
1008
1009config ARCH_HAS_ELF_RANDOMIZE
1010	bool
1011	help
1012	  An architecture supports choosing randomized locations for
1013	  stack, mmap, brk, and ET_DYN. Defined functions:
1014	  - arch_mmap_rnd()
1015	  - arch_randomize_brk()
1016
1017config HAVE_ARCH_MMAP_RND_BITS
1018	bool
1019	help
1020	  An arch should select this symbol if it supports setting a variable
1021	  number of bits for use in establishing the base address for mmap
1022	  allocations, has MMU enabled and provides values for both:
1023	  - ARCH_MMAP_RND_BITS_MIN
1024	  - ARCH_MMAP_RND_BITS_MAX
1025
1026config HAVE_EXIT_THREAD
1027	bool
1028	help
1029	  An architecture implements exit_thread.
1030
1031config ARCH_MMAP_RND_BITS_MIN
1032	int
1033
1034config ARCH_MMAP_RND_BITS_MAX
1035	int
1036
1037config ARCH_MMAP_RND_BITS_DEFAULT
1038	int
1039
1040config ARCH_MMAP_RND_BITS
1041	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1042	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1043	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1044	default ARCH_MMAP_RND_BITS_MIN
1045	depends on HAVE_ARCH_MMAP_RND_BITS
1046	help
1047	  This value can be used to select the number of bits to use to
1048	  determine the random offset to the base address of vma regions
1049	  resulting from mmap allocations. This value will be bounded
1050	  by the architecture's minimum and maximum supported values.
1051
1052	  This value can be changed after boot using the
1053	  /proc/sys/vm/mmap_rnd_bits tunable
1054
1055config HAVE_ARCH_MMAP_RND_COMPAT_BITS
1056	bool
1057	help
1058	  An arch should select this symbol if it supports running applications
1059	  in compatibility mode, supports setting a variable number of bits for
1060	  use in establishing the base address for mmap allocations, has MMU
1061	  enabled and provides values for both:
1062	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1063	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1064
1065config ARCH_MMAP_RND_COMPAT_BITS_MIN
1066	int
1067
1068config ARCH_MMAP_RND_COMPAT_BITS_MAX
1069	int
1070
1071config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1072	int
1073
1074config ARCH_MMAP_RND_COMPAT_BITS
1075	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1076	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1077	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1078	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1079	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1080	help
1081	  This value can be used to select the number of bits to use to
1082	  determine the random offset to the base address of vma regions
1083	  resulting from mmap allocations for compatible applications This
1084	  value will be bounded by the architecture's minimum and maximum
1085	  supported values.
1086
1087	  This value can be changed after boot using the
1088	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1089
1090config HAVE_ARCH_COMPAT_MMAP_BASES
1091	bool
1092	help
1093	  This allows 64bit applications to invoke 32-bit mmap() syscall
1094	  and vice-versa 32-bit applications to call 64-bit mmap().
1095	  Required for applications doing different bitness syscalls.
1096
1097config PAGE_SIZE_LESS_THAN_64KB
1098	def_bool y
1099	depends on !ARM64_64K_PAGES
1100	depends on !IA64_PAGE_SIZE_64KB
1101	depends on !PAGE_SIZE_64KB
1102	depends on !PARISC_PAGE_SIZE_64KB
1103	depends on PAGE_SIZE_LESS_THAN_256KB
1104
1105config PAGE_SIZE_LESS_THAN_256KB
1106	def_bool y
1107	depends on !PAGE_SIZE_256KB
1108
1109# This allows to use a set of generic functions to determine mmap base
1110# address by giving priority to top-down scheme only if the process
1111# is not in legacy mode (compat task, unlimited stack size or
1112# sysctl_legacy_va_layout).
1113# Architecture that selects this option can provide its own version of:
1114# - STACK_RND_MASK
1115config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
1116	bool
1117	depends on MMU
1118	select ARCH_HAS_ELF_RANDOMIZE
1119
1120config HAVE_OBJTOOL
1121	bool
1122
1123config HAVE_JUMP_LABEL_HACK
1124	bool
1125
1126config HAVE_NOINSTR_HACK
1127	bool
1128
1129config HAVE_NOINSTR_VALIDATION
1130	bool
1131
1132config HAVE_UACCESS_VALIDATION
1133	bool
1134	select OBJTOOL
1135
1136config HAVE_STACK_VALIDATION
1137	bool
1138	help
1139	  Architecture supports objtool compile-time frame pointer rule
1140	  validation.
1141
1142config HAVE_RELIABLE_STACKTRACE
1143	bool
1144	help
1145	  Architecture has either save_stack_trace_tsk_reliable() or
1146	  arch_stack_walk_reliable() function which only returns a stack trace
1147	  if it can guarantee the trace is reliable.
1148
1149config HAVE_ARCH_HASH
1150	bool
1151	default n
1152	help
1153	  If this is set, the architecture provides an <asm/hash.h>
1154	  file which provides platform-specific implementations of some
1155	  functions in <linux/hash.h> or fs/namei.c.
1156
1157config HAVE_ARCH_NVRAM_OPS
1158	bool
1159
1160config ISA_BUS_API
1161	def_bool ISA
1162
1163#
1164# ABI hall of shame
1165#
1166config CLONE_BACKWARDS
1167	bool
1168	help
1169	  Architecture has tls passed as the 4th argument of clone(2),
1170	  not the 5th one.
1171
1172config CLONE_BACKWARDS2
1173	bool
1174	help
1175	  Architecture has the first two arguments of clone(2) swapped.
1176
1177config CLONE_BACKWARDS3
1178	bool
1179	help
1180	  Architecture has tls passed as the 3rd argument of clone(2),
1181	  not the 5th one.
1182
1183config ODD_RT_SIGACTION
1184	bool
1185	help
1186	  Architecture has unusual rt_sigaction(2) arguments
1187
1188config OLD_SIGSUSPEND
1189	bool
1190	help
1191	  Architecture has old sigsuspend(2) syscall, of one-argument variety
1192
1193config OLD_SIGSUSPEND3
1194	bool
1195	help
1196	  Even weirder antique ABI - three-argument sigsuspend(2)
1197
1198config OLD_SIGACTION
1199	bool
1200	help
1201	  Architecture has old sigaction(2) syscall.  Nope, not the same
1202	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1203	  but fairly different variant of sigaction(2), thanks to OSF/1
1204	  compatibility...
1205
1206config COMPAT_OLD_SIGACTION
1207	bool
1208
1209config COMPAT_32BIT_TIME
1210	bool "Provide system calls for 32-bit time_t"
1211	default !64BIT || COMPAT
1212	help
1213	  This enables 32 bit time_t support in addition to 64 bit time_t support.
1214	  This is relevant on all 32-bit architectures, and 64-bit architectures
1215	  as part of compat syscall handling.
1216
1217config ARCH_NO_PREEMPT
1218	bool
1219
1220config ARCH_SUPPORTS_RT
1221	bool
1222
1223config CPU_NO_EFFICIENT_FFS
1224	def_bool n
1225
1226config HAVE_ARCH_VMAP_STACK
1227	def_bool n
1228	help
1229	  An arch should select this symbol if it can support kernel stacks
1230	  in vmalloc space.  This means:
1231
1232	  - vmalloc space must be large enough to hold many kernel stacks.
1233	    This may rule out many 32-bit architectures.
1234
1235	  - Stacks in vmalloc space need to work reliably.  For example, if
1236	    vmap page tables are created on demand, either this mechanism
1237	    needs to work while the stack points to a virtual address with
1238	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1239	    most likely) needs to ensure that the stack's page table entries
1240	    are populated before running on a possibly unpopulated stack.
1241
1242	  - If the stack overflows into a guard page, something reasonable
1243	    should happen.  The definition of "reasonable" is flexible, but
1244	    instantly rebooting without logging anything would be unfriendly.
1245
1246config VMAP_STACK
1247	default y
1248	bool "Use a virtually-mapped stack"
1249	depends on HAVE_ARCH_VMAP_STACK
1250	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1251	help
1252	  Enable this if you want the use virtually-mapped kernel stacks
1253	  with guard pages.  This causes kernel stack overflows to be
1254	  caught immediately rather than causing difficult-to-diagnose
1255	  corruption.
1256
1257	  To use this with software KASAN modes, the architecture must support
1258	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
1259	  must be enabled.
1260
1261config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1262	def_bool n
1263	help
1264	  An arch should select this symbol if it can support kernel stack
1265	  offset randomization with calls to add_random_kstack_offset()
1266	  during syscall entry and choose_random_kstack_offset() during
1267	  syscall exit. Careful removal of -fstack-protector-strong and
1268	  -fstack-protector should also be applied to the entry code and
1269	  closely examined, as the artificial stack bump looks like an array
1270	  to the compiler, so it will attempt to add canary checks regardless
1271	  of the static branch state.
1272
1273config RANDOMIZE_KSTACK_OFFSET
1274	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
1275	default y
1276	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1277	depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
1278	help
1279	  The kernel stack offset can be randomized (after pt_regs) by
1280	  roughly 5 bits of entropy, frustrating memory corruption
1281	  attacks that depend on stack address determinism or
1282	  cross-syscall address exposures.
1283
1284	  The feature is controlled via the "randomize_kstack_offset=on/off"
1285	  kernel boot param, and if turned off has zero overhead due to its use
1286	  of static branches (see JUMP_LABEL).
1287
1288	  If unsure, say Y.
1289
1290config RANDOMIZE_KSTACK_OFFSET_DEFAULT
1291	bool "Default state of kernel stack offset randomization"
1292	depends on RANDOMIZE_KSTACK_OFFSET
1293	help
1294	  Kernel stack offset randomization is controlled by kernel boot param
1295	  "randomize_kstack_offset=on/off", and this config chooses the default
1296	  boot state.
1297
1298config ARCH_OPTIONAL_KERNEL_RWX
1299	def_bool n
1300
1301config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1302	def_bool n
1303
1304config ARCH_HAS_STRICT_KERNEL_RWX
1305	def_bool n
1306
1307config STRICT_KERNEL_RWX
1308	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1309	depends on ARCH_HAS_STRICT_KERNEL_RWX
1310	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1311	help
1312	  If this is set, kernel text and rodata memory will be made read-only,
1313	  and non-text memory will be made non-executable. This provides
1314	  protection against certain security exploits (e.g. executing the heap
1315	  or modifying text)
1316
1317	  These features are considered standard security practice these days.
1318	  You should say Y here in almost all cases.
1319
1320config ARCH_HAS_STRICT_MODULE_RWX
1321	def_bool n
1322
1323config STRICT_MODULE_RWX
1324	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1325	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1326	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1327	help
1328	  If this is set, module text and rodata memory will be made read-only,
1329	  and non-text memory will be made non-executable. This provides
1330	  protection against certain security exploits (e.g. writing to text)
1331
1332# select if the architecture provides an asm/dma-direct.h header
1333config ARCH_HAS_PHYS_TO_DMA
1334	bool
1335
1336config HAVE_ARCH_COMPILER_H
1337	bool
1338	help
1339	  An architecture can select this if it provides an
1340	  asm/compiler.h header that should be included after
1341	  linux/compiler-*.h in order to override macro definitions that those
1342	  headers generally provide.
1343
1344config HAVE_ARCH_PREL32_RELOCATIONS
1345	bool
1346	help
1347	  May be selected by an architecture if it supports place-relative
1348	  32-bit relocations, both in the toolchain and in the module loader,
1349	  in which case relative references can be used in special sections
1350	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1351	  architectures, and don't require runtime relocation on relocatable
1352	  kernels.
1353
1354config ARCH_USE_MEMREMAP_PROT
1355	bool
1356
1357config LOCK_EVENT_COUNTS
1358	bool "Locking event counts collection"
1359	depends on DEBUG_FS
1360	help
1361	  Enable light-weight counting of various locking related events
1362	  in the system with minimal performance impact. This reduces
1363	  the chance of application behavior change because of timing
1364	  differences. The counts are reported via debugfs.
1365
1366# Select if the architecture has support for applying RELR relocations.
1367config ARCH_HAS_RELR
1368	bool
1369
1370config RELR
1371	bool "Use RELR relocation packing"
1372	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
1373	default y
1374	help
1375	  Store the kernel's dynamic relocations in the RELR relocation packing
1376	  format. Requires a compatible linker (LLD supports this feature), as
1377	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
1378	  are compatible).
1379
1380config ARCH_HAS_MEM_ENCRYPT
1381	bool
1382
1383config ARCH_HAS_CC_PLATFORM
1384	bool
1385
1386config HAVE_SPARSE_SYSCALL_NR
1387	bool
1388	help
1389	  An architecture should select this if its syscall numbering is sparse
1390	  to save space. For example, MIPS architecture has a syscall array with
1391	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
1392	  related optimizations for a given architecture.
1393
1394config ARCH_HAS_VDSO_DATA
1395	bool
1396
1397config HAVE_STATIC_CALL
1398	bool
1399
1400config HAVE_STATIC_CALL_INLINE
1401	bool
1402	depends on HAVE_STATIC_CALL
1403	select OBJTOOL
1404
1405config HAVE_PREEMPT_DYNAMIC
1406	bool
1407
1408config HAVE_PREEMPT_DYNAMIC_CALL
1409	bool
1410	depends on HAVE_STATIC_CALL
1411	select HAVE_PREEMPT_DYNAMIC
1412	help
1413	  An architecture should select this if it can handle the preemption
1414	  model being selected at boot time using static calls.
1415
1416	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
1417	  preemption function will be patched directly.
1418
1419	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
1420	  call to a preemption function will go through a trampoline, and the
1421	  trampoline will be patched.
1422
1423	  It is strongly advised to support inline static call to avoid any
1424	  overhead.
1425
1426config HAVE_PREEMPT_DYNAMIC_KEY
1427	bool
1428	depends on HAVE_ARCH_JUMP_LABEL
1429	select HAVE_PREEMPT_DYNAMIC
1430	help
1431	  An architecture should select this if it can handle the preemption
1432	  model being selected at boot time using static keys.
1433
1434	  Each preemption function will be given an early return based on a
1435	  static key. This should have slightly lower overhead than non-inline
1436	  static calls, as this effectively inlines each trampoline into the
1437	  start of its callee. This may avoid redundant work, and may
1438	  integrate better with CFI schemes.
1439
1440	  This will have greater overhead than using inline static calls as
1441	  the call to the preemption function cannot be entirely elided.
1442
1443config ARCH_WANT_LD_ORPHAN_WARN
1444	bool
1445	help
1446	  An arch should select this symbol once all linker sections are explicitly
1447	  included, size-asserted, or discarded in the linker scripts. This is
1448	  important because we never want expected sections to be placed heuristically
1449	  by the linker, since the locations of such sections can change between linker
1450	  versions.
1451
1452config HAVE_ARCH_PFN_VALID
1453	bool
1454
1455config ARCH_SUPPORTS_DEBUG_PAGEALLOC
1456	bool
1457
1458config ARCH_SUPPORTS_PAGE_TABLE_CHECK
1459	bool
1460
1461config ARCH_SPLIT_ARG64
1462	bool
1463	help
1464	  If a 32-bit architecture requires 64-bit arguments to be split into
1465	  pairs of 32-bit arguments, select this option.
1466
1467config ARCH_HAS_ELFCORE_COMPAT
1468	bool
1469
1470config ARCH_HAS_PARANOID_L1D_FLUSH
1471	bool
1472
1473config ARCH_HAVE_TRACE_MMIO_ACCESS
1474	bool
1475
1476config DYNAMIC_SIGFRAME
1477	bool
1478
1479# Select, if arch has a named attribute group bound to NUMA device nodes.
1480config HAVE_ARCH_NODE_DEV_GROUP
1481	bool
1482
1483config ARCH_HAS_NONLEAF_PMD_YOUNG
1484	bool
1485	help
1486	  Architectures that select this option are capable of setting the
1487	  accessed bit in non-leaf PMD entries when using them as part of linear
1488	  address translations. Page table walkers that clear the accessed bit
1489	  may use this capability to reduce their search space.
1490
1491source "kernel/gcov/Kconfig"
1492
1493source "scripts/gcc-plugins/Kconfig"
1494
1495config FUNCTION_ALIGNMENT_4B
1496	bool
1497
1498config FUNCTION_ALIGNMENT_8B
1499	bool
1500
1501config FUNCTION_ALIGNMENT_16B
1502	bool
1503
1504config FUNCTION_ALIGNMENT_32B
1505	bool
1506
1507config FUNCTION_ALIGNMENT_64B
1508	bool
1509
1510config FUNCTION_ALIGNMENT
1511	int
1512	default 64 if FUNCTION_ALIGNMENT_64B
1513	default 32 if FUNCTION_ALIGNMENT_32B
1514	default 16 if FUNCTION_ALIGNMENT_16B
1515	default 8 if FUNCTION_ALIGNMENT_8B
1516	default 4 if FUNCTION_ALIGNMENT_4B
1517	default 0
1518
1519endmenu
1520