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