xref: /linux/arch/Kconfig (revision a257cacc38718c83cee003487e03197f237f5c3f)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2fb32e03fSMathieu Desnoyers#
3fb32e03fSMathieu Desnoyers# General architecture dependent options
4fb32e03fSMathieu Desnoyers#
5125e5645SMathieu Desnoyers
61572497cSChristoph Hellwig#
71572497cSChristoph Hellwig# Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can
81572497cSChristoph Hellwig# override the default values in this file.
91572497cSChristoph Hellwig#
101572497cSChristoph Hellwigsource "arch/$(SRCARCH)/Kconfig"
111572497cSChristoph Hellwig
1222471e13SRandy Dunlapmenu "General architecture-dependent options"
1322471e13SRandy Dunlap
14692f66f2SHari Bathiniconfig CRASH_CORE
15692f66f2SHari Bathini	bool
16692f66f2SHari Bathini
172965faa5SDave Youngconfig KEXEC_CORE
18692f66f2SHari Bathini	select CRASH_CORE
192965faa5SDave Young	bool
202965faa5SDave Young
21175fca3bSSven Schnelleconfig KEXEC_ELF
22175fca3bSSven Schnelle	bool
23175fca3bSSven Schnelle
24467d2782SThiago Jung Bauermannconfig HAVE_IMA_KEXEC
25467d2782SThiago Jung Bauermann	bool
26467d2782SThiago Jung Bauermann
275e6e9852SChristoph Hellwigconfig SET_FS
285e6e9852SChristoph Hellwig	bool
295e6e9852SChristoph Hellwig
3005736e4aSThomas Gleixnerconfig HOTPLUG_SMT
3105736e4aSThomas Gleixner	bool
3205736e4aSThomas Gleixner
33142781e1SThomas Gleixnerconfig GENERIC_ENTRY
34142781e1SThomas Gleixner       bool
35142781e1SThomas Gleixner
36125e5645SMathieu Desnoyersconfig KPROBES
37125e5645SMathieu Desnoyers	bool "Kprobes"
3805ed160eSMasami Hiramatsu	depends on MODULES
39125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
4005ed160eSMasami Hiramatsu	select KALLSYMS
41125e5645SMathieu Desnoyers	help
42125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
43125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
44125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
45125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
46125e5645SMathieu Desnoyers	  If in doubt, say "N".
47125e5645SMathieu Desnoyers
4845f81b1cSSteven Rostedtconfig JUMP_LABEL
49c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
5045f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
51e9666d10SMasahiro Yamada	depends on CC_HAS_ASM_GOTO
5245f81b1cSSteven Rostedt	help
53c5905afbSIngo Molnar	 This option enables a transparent branch optimization that
54c5905afbSIngo Molnar	 makes certain almost-always-true or almost-always-false branch
55c5905afbSIngo Molnar	 conditions even cheaper to execute within the kernel.
5645f81b1cSSteven Rostedt
57c5905afbSIngo Molnar	 Certain performance-sensitive kernel code, such as trace points,
58c5905afbSIngo Molnar	 scheduler functionality, networking code and KVM have such
59c5905afbSIngo Molnar	 branches and include support for this optimization technique.
60c5905afbSIngo Molnar
61c5905afbSIngo Molnar	 If it is detected that the compiler has support for "asm goto",
62c5905afbSIngo Molnar	 the kernel will compile such branches with just a nop
63c5905afbSIngo Molnar	 instruction. When the condition flag is toggled to true, the
64c5905afbSIngo Molnar	 nop will be converted to a jump instruction to execute the
65c5905afbSIngo Molnar	 conditional block of instructions.
66c5905afbSIngo Molnar
67c5905afbSIngo Molnar	 This technique lowers overhead and stress on the branch prediction
68c5905afbSIngo Molnar	 of the processor and generally makes the kernel faster. The update
69c5905afbSIngo Molnar	 of the condition is slower, but those are always very rare.
70c5905afbSIngo Molnar
71c5905afbSIngo Molnar	 ( On 32-bit x86, the necessary options added to the compiler
72c5905afbSIngo Molnar	   flags may increase the size of the kernel slightly. )
7345f81b1cSSteven Rostedt
741987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
751987c947SPeter Zijlstra	bool "Static key selftest"
761987c947SPeter Zijlstra	depends on JUMP_LABEL
771987c947SPeter Zijlstra	help
781987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
791987c947SPeter Zijlstra
80f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
81f03c4129SPeter Zijlstra	bool "Static call selftest"
82f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
83f03c4129SPeter Zijlstra	help
84f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
85f03c4129SPeter Zijlstra
86afd66255SMasami Hiramatsuconfig OPTPROBES
875cc718b9SMasami Hiramatsu	def_bool y
885cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
8901b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
90afd66255SMasami Hiramatsu
91e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
92e7dbfe34SMasami Hiramatsu	def_bool y
93e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
94e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
95e7dbfe34SMasami Hiramatsu	help
96e7dbfe34SMasami Hiramatsu	 If function tracer is enabled and the arch supports full
97e7dbfe34SMasami Hiramatsu	 passing of pt_regs to function tracing, then kprobes can
98e7dbfe34SMasami Hiramatsu	 optimize on top of function tracing.
99e7dbfe34SMasami Hiramatsu
1002b144498SSrikar Dronamrajuconfig UPROBES
10109294e31SDavid A. Long	def_bool n
102e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1032b144498SSrikar Dronamraju	help
1047b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1057b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1067b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1077b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1087b2d81d4SIngo Molnar	  are hit by user-space applications.
1097b2d81d4SIngo Molnar
1107b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1117b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1127b2d81d4SIngo Molnar	    application. )
1132b144498SSrikar Dronamraju
114adab66b7SSteven Rostedt (VMware)config HAVE_64BIT_ALIGNED_ACCESS
115adab66b7SSteven Rostedt (VMware)	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
116adab66b7SSteven Rostedt (VMware)	help
117adab66b7SSteven Rostedt (VMware)	  Some architectures require 64 bit accesses to be 64 bit
118adab66b7SSteven Rostedt (VMware)	  aligned, which also requires structs containing 64 bit values
119adab66b7SSteven Rostedt (VMware)	  to be 64 bit aligned too. This includes some 32 bit
120adab66b7SSteven Rostedt (VMware)	  architectures which can do 64 bit accesses, as well as 64 bit
121adab66b7SSteven Rostedt (VMware)	  architectures without unaligned access.
122adab66b7SSteven Rostedt (VMware)
123adab66b7SSteven Rostedt (VMware)	  This symbol should be selected by an architecture if 64 bit
124adab66b7SSteven Rostedt (VMware)	  accesses are required to be 64 bit aligned in this way even
125adab66b7SSteven Rostedt (VMware)	  though it is not a 64 bit architecture.
126adab66b7SSteven Rostedt (VMware)
127ba1a297dSLukas Bulwahn	  See Documentation/core-api/unaligned-memory-access.rst for
128ba1a297dSLukas Bulwahn	  more information on the topic of unaligned memory accesses.
129adab66b7SSteven Rostedt (VMware)
13058340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1319ba16087SJan Beulich	bool
13258340a07SJohannes Berg	help
13358340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
13458340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
13558340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
13658340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
13758340a07SJohannes Berg	  handler.)
13858340a07SJohannes Berg
13958340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
14058340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
14158340a07SJohannes Berg	  code paths to be selected for these cases. Some network
14258340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
14358340a07SJohannes Berg	  problems with received packets if doing so would not help
14458340a07SJohannes Berg	  much.
14558340a07SJohannes Berg
146c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
14758340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
14858340a07SJohannes Berg
149cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
150cf66bb93SDavid Woodhouse	bool
151cf66bb93SDavid Woodhouse	help
152cf66bb93SDavid Woodhouse	 Modern versions of GCC (since 4.4) have builtin functions
153cf66bb93SDavid Woodhouse	 for handling byte-swapping. Using these, instead of the old
154cf66bb93SDavid Woodhouse	 inline assembler that the architecture code provides in the
155cf66bb93SDavid Woodhouse	 __arch_bswapXX() macros, allows the compiler to see what's
156cf66bb93SDavid Woodhouse	 happening and offers more opportunity for optimisation. In
157cf66bb93SDavid Woodhouse	 particular, the compiler will be able to combine the byteswap
158cf66bb93SDavid Woodhouse	 with a nearby load or store and use load-and-swap or
159cf66bb93SDavid Woodhouse	 store-and-swap instructions if the architecture has them. It
160cf66bb93SDavid Woodhouse	 should almost *never* result in code which is worse than the
161cf66bb93SDavid Woodhouse	 hand-coded assembler in <asm/swab.h>.  But just in case it
162cf66bb93SDavid Woodhouse	 does, the use of the builtins is optional.
163cf66bb93SDavid Woodhouse
164cf66bb93SDavid Woodhouse	 Any architecture with load-and-swap or store-and-swap
165cf66bb93SDavid Woodhouse	 instructions should set this. And it shouldn't hurt to set it
166cf66bb93SDavid Woodhouse	 on architectures that don't have such instructions.
167cf66bb93SDavid Woodhouse
1689edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
1699edddaa2SAnanth N Mavinakayanahalli	def_bool y
1709edddaa2SAnanth N Mavinakayanahalli	depends on KPROBES && HAVE_KRETPROBES
1719edddaa2SAnanth N Mavinakayanahalli
1727c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
1737c68af6eSAvi Kivity	bool
1747c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
1757c68af6eSAvi Kivity	help
1767c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
1777c68af6eSAvi Kivity	  switch to user mode.
1787c68af6eSAvi Kivity
17928b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
1809ba16087SJan Beulich	bool
18128b2ee20SRik van Riel
182125e5645SMathieu Desnoyersconfig HAVE_KPROBES
1839ba16087SJan Beulich	bool
1849edddaa2SAnanth N Mavinakayanahalli
1859edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
1869ba16087SJan Beulich	bool
18774bc7ceeSArthur Kepner
188afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
189afd66255SMasami Hiramatsu	bool
190d314d74cSCong Wang
191e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
192e7dbfe34SMasami Hiramatsu	bool
193e7dbfe34SMasami Hiramatsu
1941f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
1951f6d3a8fSMasami Hiramatsu	bool
1961f6d3a8fSMasami Hiramatsu	help
1971f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
1981f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
1991f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2001f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2011f6d3a8fSMasami Hiramatsu
202540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2039802d865SJosef Bacik	bool
2049802d865SJosef Bacik
20542a0bb3fSPetr Mladekconfig HAVE_NMI
20642a0bb3fSPetr Mladek	bool
20742a0bb3fSPetr Mladek
208*a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
209*a257caccSChristophe Leroy	bool
210*a257caccSChristophe Leroy
2114aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
2124aae683fSMasahiro Yamada	bool
2134aae683fSMasahiro Yamada
2141f5a4ad9SRoland McGrath#
2151f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2161f5a4ad9SRoland McGrath#
2171f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2181f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2191f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2201f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2211f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2221f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
2231f5a4ad9SRoland McGrath#	TIF_SYSCALL_TRACE	calls tracehook_report_syscall_{entry,exit}
2241f5a4ad9SRoland McGrath#	TIF_NOTIFY_RESUME	calls tracehook_notify_resume()
2251f5a4ad9SRoland McGrath#	signal delivery		calls tracehook_signal_handler()
2261f5a4ad9SRoland McGrath#
2271f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2289ba16087SJan Beulich	bool
2291f5a4ad9SRoland McGrath
230c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
231c64be2bbSMarek Szyprowski	bool
232c64be2bbSMarek Szyprowski
23329d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
23429d5e047SThomas Gleixner	bool
23529d5e047SThomas Gleixner
236485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
237485cf5daSKevin Hilman	bool
238485cf5daSKevin Hilman
2396974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2406974f0c4SDaniel Micay	bool
2416974f0c4SDaniel Micay	help
2426974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2436974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2446974f0c4SDaniel Micay
245d8ae8a37SChristoph Hellwig#
246d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
247d8ae8a37SChristoph Hellwig# command line option
248d8ae8a37SChristoph Hellwig#
249d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
250d8ae8a37SChristoph Hellwig	bool
251d8ae8a37SChristoph Hellwig
252d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
253d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
254d2852a22SDaniel Borkmann	bool
255d2852a22SDaniel Borkmann
256d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
257d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
258d253ca0cSRick Edgecombe	bool
259d253ca0cSRick Edgecombe
260c30700dbSChristoph Hellwig#
261fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
262a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
263fa7e2247SChristoph Hellwig# to remap the page tables in place.
264c30700dbSChristoph Hellwig#
265fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
266c30700dbSChristoph Hellwig	bool
267c30700dbSChristoph Hellwig
268999a5d12SChristoph Hellwig#
269999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
270999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
271999a5d12SChristoph Hellwig#
272999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
273f5e10287SThomas Gleixner	bool
274f5e10287SThomas Gleixner
2755905429aSKees Cook# Select if arch init_task must go in the __init_task_data section
2765905429aSKees Cookconfig ARCH_TASK_STRUCT_ON_STACK
2775905429aSKees Cook	bool
2785905429aSKees Cook
2795905429aSKees Cook# Select if arch has its private alloc_task_struct() function
2805905429aSKees Cookconfig ARCH_TASK_STRUCT_ALLOCATOR
2815905429aSKees Cook	bool
2825905429aSKees Cook
2835905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
2845905429aSKees Cook	bool
2855905429aSKees Cook	depends on !ARCH_TASK_STRUCT_ALLOCATOR
286b235beeaSLinus Torvalds	help
287b235beeaSLinus Torvalds	  An architecture should select this to provide hardened usercopy
288f5e10287SThomas Gleixner	  knowledge about what region of the thread_struct should be
289f5e10287SThomas Gleixner	  whitelisted for copying to userspace. Normally this is only the
2905aaeb5c0SIngo Molnar	  FPU registers. Specifically, arch_thread_struct_whitelist()
2915aaeb5c0SIngo Molnar	  should be implemented. Without this, the entire thread_struct
2925aaeb5c0SIngo Molnar	  field in task_struct will be left whitelisted.
2935aaeb5c0SIngo Molnar
294942fa985SYury Norov# Select if arch has its private alloc_thread_stack() function
295942fa985SYury Norovconfig ARCH_THREAD_STACK_ALLOCATOR
296942fa985SYury Norov	bool
297942fa985SYury Norov
298942fa985SYury Norov# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
299942fa985SYury Norovconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
300942fa985SYury Norov	bool
301942fa985SYury Norov
30251c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
30351c2ee6dSNick Desaulniers	bool
30451c2ee6dSNick Desaulniers	help
30551c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
30651c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
30751c2ee6dSNick Desaulniers	  functions and is required for correctness.
30851c2ee6dSNick Desaulniers
309942fa985SYury Norovconfig ARCH_32BIT_OFF_T
310942fa985SYury Norov	bool
311942fa985SYury Norov	depends on !64BIT
312942fa985SYury Norov	help
313942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
314942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
315942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
316942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
317942fa985SYury Norov	  architectures explicitly.
318942fa985SYury Norov
31996c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
32096c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
32196c0a6a7SHeiko Carstens	bool
32296c0a6a7SHeiko Carstens
3232ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3242ff2b7ecSMasahiro Yamada	bool
3252ff2b7ecSMasahiro Yamada	help
326a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
3272ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3282ff2b7ecSMasahiro Yamada	  exported from assembly code.
3292ff2b7ecSMasahiro Yamada
330f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
331f850c30cSHeiko Carstens	bool
332e01292b1SHeiko Carstens	help
333a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
334e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
335e01292b1SHeiko Carstens	  declared in asm/ptrace.h
336e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
337f850c30cSHeiko Carstens
338d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
339d7822b1eSMathieu Desnoyers	bool
340d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
341d7822b1eSMathieu Desnoyers	help
342d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
343d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
344d7822b1eSMathieu Desnoyers
3453c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3463c88ee19SMasami Hiramatsu	bool
3473c88ee19SMasami Hiramatsu	help
348a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
3493c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3503c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3513c88ee19SMasami Hiramatsu
35262a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
35362a038d3SK.Prasad	bool
35499e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
35562a038d3SK.Prasad
3560102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
3570102752eSFrederic Weisbecker	bool
3580102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
3590102752eSFrederic Weisbecker	help
3600102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
3610102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
3620102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
3630102752eSFrederic Weisbecker	  them but define the access type in a control register.
3640102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3650102752eSFrederic Weisbecker	  latter fashion.
3660102752eSFrederic Weisbecker
3677c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3687c68af6eSAvi Kivity	bool
369a1922ed6SIngo Molnar
370c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
371c01d4323SFrederic Weisbecker	bool
37223637d47SFrederic Weisbecker	help
37323637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
37423637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
37523637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
376c01d4323SFrederic Weisbecker
37705a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
37805a4a952SNicholas Piggin	bool
37905a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
38005a4a952SNicholas Piggin	help
38105a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
38205a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
38305a4a952SNicholas Piggin
38405a4a952SNicholas Pigginconfig HAVE_NMI_WATCHDOG
38505a4a952SNicholas Piggin	depends on HAVE_NMI
38605a4a952SNicholas Piggin	bool
38705a4a952SNicholas Piggin	help
38805a4a952SNicholas Piggin	  The arch provides a low level NMI watchdog. It provides
38905a4a952SNicholas Piggin	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
39005a4a952SNicholas Piggin
39105a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
39205a4a952SNicholas Piggin	bool
39305a4a952SNicholas Piggin	select HAVE_NMI_WATCHDOG
39405a4a952SNicholas Piggin	help
39505a4a952SNicholas Piggin	  The arch chooses to provide its own hardlockup detector, which is
39605a4a952SNicholas Piggin	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
39705a4a952SNicholas Piggin	  interfaces and parameters provided by hardlockup detector subsystem.
39805a4a952SNicholas Piggin
399c5e63197SJiri Olsaconfig HAVE_PERF_REGS
400c5e63197SJiri Olsa	bool
401c5e63197SJiri Olsa	help
402c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
403c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
404c5e63197SJiri Olsa
405c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
406c5ebcedbSJiri Olsa	bool
407c5ebcedbSJiri Olsa	help
408c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
409c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
410c5ebcedbSJiri Olsa	  architectures.
411c5ebcedbSJiri Olsa
412bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
413bf5438fcSJason Baron	bool
414bf5438fcSJason Baron
41550ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
41650ff18abSArd Biesheuvel	bool
41750ff18abSArd Biesheuvel
4180d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4190d6e24d4SPeter Zijlstra	bool
4200d6e24d4SPeter Zijlstra
421ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
42226723911SPeter Zijlstra	bool
4230d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
42426723911SPeter Zijlstra
4253af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
426ed6a7935SPeter Zijlstra	bool
427ed6a7935SPeter Zijlstra
42827796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
42927796d03SPeter Zijlstra	bool
43027796d03SPeter Zijlstra
431580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
432952a31c9SMartin Schwidefsky	bool
4330d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
434952a31c9SMartin Schwidefsky
435d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
436d53c3dfbSNicholas Piggin	bool
437d53c3dfbSNicholas Piggin	help
438d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
439d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
440d53c3dfbSNicholas Piggin	  shootdowns should enable this.
441d53c3dfbSNicholas Piggin
442df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
443df013ffbSHuang Ying	bool
444df013ffbSHuang Ying
44543570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
44643570fd2SHeiko Carstens	bool
44743570fd2SHeiko Carstens	help
44843570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
44943570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
45043570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
45143570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
45243570fd2SHeiko Carstens
4534156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
4544156153cSHeiko Carstens	bool
4554156153cSHeiko Carstens
4562565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
4572565409fSHeiko Carstens	bool
4582565409fSHeiko Carstens
45977e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
46077e58496SPaul E. McKenney	bool
46177e58496SPaul E. McKenney
462c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
463c1d7e01dSWill Deacon	bool
464c1d7e01dSWill Deacon
465c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
466c1d7e01dSWill Deacon	bool
467c1d7e01dSWill Deacon
46848b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
469c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
47048b25c43SChris Metcalf	bool
47148b25c43SChris Metcalf
472282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
473e2cfabdfSWill Drewry	bool
474e2cfabdfSWill Drewry	help
475282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
476282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
477282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
478282a181bSYiFei Zhu	  - __NR_seccomp_read_32
479282a181bSYiFei Zhu	  - __NR_seccomp_write_32
480282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
481282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
482282a181bSYiFei Zhu
483282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
484282a181bSYiFei Zhu	bool
485282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
486282a181bSYiFei Zhu	help
487fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
488282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
489bb6ea430SWill Drewry	  - syscall_get_arch()
490bb6ea430SWill Drewry	  - syscall_get_arguments()
491bb6ea430SWill Drewry	  - syscall_rollback()
492bb6ea430SWill Drewry	  - syscall_set_return_value()
493fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
494fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
495fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
496fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
49748dc92b9SKees Cook	  - seccomp syscall wired up
4980d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
4990d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
5000d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
501e2cfabdfSWill Drewry
502282a181bSYiFei Zhuconfig SECCOMP
503282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
504282a181bSYiFei Zhu	def_bool y
505282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
506282a181bSYiFei Zhu	help
507282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
508282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
509282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
510282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
511282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
512282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
513282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
514282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
515282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
516282a181bSYiFei Zhu
517282a181bSYiFei Zhu	  If unsure, say Y.
518282a181bSYiFei Zhu
519e2cfabdfSWill Drewryconfig SECCOMP_FILTER
520e2cfabdfSWill Drewry	def_bool y
521e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
522e2cfabdfSWill Drewry	help
523e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
524e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
525e2cfabdfSWill Drewry	  task-defined system call filtering polices.
526e2cfabdfSWill Drewry
5275fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
528e2cfabdfSWill Drewry
5290d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
5300d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
5310d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
5320d8315ddSYiFei Zhu	depends on PROC_FS
5330d8315ddSYiFei Zhu	help
5340d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
5350d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
5360d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
5370d8315ddSYiFei Zhu
5380d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
5390d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
5400d8315ddSYiFei Zhu
5410d8315ddSYiFei Zhu	  If unsure, say N.
5420d8315ddSYiFei Zhu
543afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
544afaef01cSAlexander Popov	bool
545afaef01cSAlexander Popov	help
546afaef01cSAlexander Popov	  An architecture should select this if it has the code which
547afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
548afaef01cSAlexander Popov	  value before returning from system calls.
549afaef01cSAlexander Popov
550d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
55119952a92SKees Cook	bool
55219952a92SKees Cook	help
55319952a92SKees Cook	  An arch should select this symbol if:
55419952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
55519952a92SKees Cook
556050e9baaSLinus Torvaldsconfig STACKPROTECTOR
5572a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
558d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
5592a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
5602a61f474SMasahiro Yamada	default y
5618779657dSKees Cook	help
5628779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
56319952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
56419952a92SKees Cook	  the stack just before the return address, and validates
56519952a92SKees Cook	  the value just before actually returning.  Stack based buffer
56619952a92SKees Cook	  overflows (that need to overwrite this return address) now also
56719952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
56819952a92SKees Cook	  neutralized via a kernel panic.
56919952a92SKees Cook
5708779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
5718779657dSKees Cook	  have an 8-byte or larger character array on the stack.
5728779657dSKees Cook
57319952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
5748779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
5758779657dSKees Cook
5768779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5778779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
5788779657dSKees Cook	  by about 0.3%.
5798779657dSKees Cook
580050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
5812a61f474SMasahiro Yamada	bool "Strong Stack Protector"
582050e9baaSLinus Torvalds	depends on STACKPROTECTOR
5832a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
5842a61f474SMasahiro Yamada	default y
5858779657dSKees Cook	help
5868779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
5878779657dSKees Cook	  of the following conditions:
5888779657dSKees Cook
5898779657dSKees Cook	  - local variable's address used as part of the right hand side of an
5908779657dSKees Cook	    assignment or function argument
5918779657dSKees Cook	  - local variable is an array (or union containing an array),
5928779657dSKees Cook	    regardless of array type or length
5938779657dSKees Cook	  - uses register local variables
5948779657dSKees Cook
5958779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
5968779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
5978779657dSKees Cook
5988779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5998779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
6008779657dSKees Cook	  size by about 2%.
6018779657dSKees Cook
602d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
603d08b9f0cSSami Tolvanen	bool
604d08b9f0cSSami Tolvanen	help
605d08b9f0cSSami Tolvanen	  An architecture should select this if it supports Clang's Shadow
606aa7a65aeSWill Deacon	  Call Stack and implements runtime support for shadow stack
607aa7a65aeSWill Deacon	  switching.
608d08b9f0cSSami Tolvanen
609d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
610d08b9f0cSSami Tolvanen	bool "Clang Shadow Call Stack"
611d08b9f0cSSami Tolvanen	depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK
612ddc9863eSSami Tolvanen	depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
613d08b9f0cSSami Tolvanen	help
614d08b9f0cSSami Tolvanen	  This option enables Clang's Shadow Call Stack, which uses a
615d08b9f0cSSami Tolvanen	  shadow stack to protect function return addresses from being
616d08b9f0cSSami Tolvanen	  overwritten by an attacker. More information can be found in
617d08b9f0cSSami Tolvanen	  Clang's documentation:
618d08b9f0cSSami Tolvanen
619d08b9f0cSSami Tolvanen	    https://clang.llvm.org/docs/ShadowCallStack.html
620d08b9f0cSSami Tolvanen
621d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
622d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
623d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
624d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
625d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
626d08b9f0cSSami Tolvanen
627dc5723b0SSami Tolvanenconfig LTO
628dc5723b0SSami Tolvanen	bool
629dc5723b0SSami Tolvanen	help
630dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
631dc5723b0SSami Tolvanen
632dc5723b0SSami Tolvanenconfig LTO_CLANG
633dc5723b0SSami Tolvanen	bool
634dc5723b0SSami Tolvanen	select LTO
635dc5723b0SSami Tolvanen	help
636dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
637dc5723b0SSami Tolvanen
638dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
639dc5723b0SSami Tolvanen	bool
640dc5723b0SSami Tolvanen	help
641dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
642dc5723b0SSami Tolvanen	  - compiling with Clang,
643dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
644dc5723b0SSami Tolvanen	  - and linking with LLD.
645dc5723b0SSami Tolvanen
646dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
647dc5723b0SSami Tolvanen	bool
648dc5723b0SSami Tolvanen	help
649dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
650dc5723b0SSami Tolvanen	  ThinLTO mode.
651dc5723b0SSami Tolvanen
652dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
653dc5723b0SSami Tolvanen	def_bool y
6541e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
655dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
656dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
657dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
658dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
659bf3c2551SSami Tolvanen	depends on !KASAN || KASAN_HW_TAGS
660dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
661dc5723b0SSami Tolvanen	help
662dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
663dc5723b0SSami Tolvanen	  LTO.
664dc5723b0SSami Tolvanen
665dc5723b0SSami Tolvanenchoice
666dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
667dc5723b0SSami Tolvanen	default LTO_NONE
668dc5723b0SSami Tolvanen	help
669dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
670dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
671dc5723b0SSami Tolvanen
672dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
673dc5723b0SSami Tolvanen	  so it's disabled by default.
674dc5723b0SSami Tolvanen
675dc5723b0SSami Tolvanenconfig LTO_NONE
676dc5723b0SSami Tolvanen	bool "None"
677dc5723b0SSami Tolvanen	help
678dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
679dc5723b0SSami Tolvanen
680dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
681dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
682dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
683dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
684dc5723b0SSami Tolvanen	select LTO_CLANG
685dc5723b0SSami Tolvanen	help
686dc5723b0SSami Tolvanen          This option enables Clang's full Link Time Optimization (LTO), which
687dc5723b0SSami Tolvanen          allows the compiler to optimize the kernel globally. If you enable
688dc5723b0SSami Tolvanen          this option, the compiler generates LLVM bitcode instead of ELF
689dc5723b0SSami Tolvanen          object files, and the actual compilation from bitcode happens at
690dc5723b0SSami Tolvanen          the LTO link step, which may take several minutes depending on the
691dc5723b0SSami Tolvanen          kernel configuration. More information can be found from LLVM's
692dc5723b0SSami Tolvanen          documentation:
693dc5723b0SSami Tolvanen
694dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
695dc5723b0SSami Tolvanen
696dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
697dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
698dc5723b0SSami Tolvanen
699dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
700dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
701dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
702dc5723b0SSami Tolvanen	select LTO_CLANG
703dc5723b0SSami Tolvanen	help
704dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
705dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
706dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
707dc5723b0SSami Tolvanen	  from Clang's documentation:
708dc5723b0SSami Tolvanen
709dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
710dc5723b0SSami Tolvanen
711dc5723b0SSami Tolvanen	  If unsure, say Y.
712dc5723b0SSami Tolvanenendchoice
713dc5723b0SSami Tolvanen
714cf68fffbSSami Tolvanenconfig ARCH_SUPPORTS_CFI_CLANG
715cf68fffbSSami Tolvanen	bool
716cf68fffbSSami Tolvanen	help
717cf68fffbSSami Tolvanen	  An architecture should select this option if it can support Clang's
718cf68fffbSSami Tolvanen	  Control-Flow Integrity (CFI) checking.
719cf68fffbSSami Tolvanen
720cf68fffbSSami Tolvanenconfig CFI_CLANG
721cf68fffbSSami Tolvanen	bool "Use Clang's Control Flow Integrity (CFI)"
722cf68fffbSSami Tolvanen	depends on LTO_CLANG && ARCH_SUPPORTS_CFI_CLANG
723cf68fffbSSami Tolvanen	# Clang >= 12:
724cf68fffbSSami Tolvanen	# - https://bugs.llvm.org/show_bug.cgi?id=46258
725cf68fffbSSami Tolvanen	# - https://bugs.llvm.org/show_bug.cgi?id=47479
726cf68fffbSSami Tolvanen	depends on CLANG_VERSION >= 120000
727cf68fffbSSami Tolvanen	select KALLSYMS
728cf68fffbSSami Tolvanen	help
729cf68fffbSSami Tolvanen	  This option enables Clang’s forward-edge Control Flow Integrity
730cf68fffbSSami Tolvanen	  (CFI) checking, where the compiler injects a runtime check to each
731cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
732cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
733cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
734cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
735cf68fffbSSami Tolvanen	  found from Clang's documentation:
736cf68fffbSSami Tolvanen
737cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
738cf68fffbSSami Tolvanen
739cf68fffbSSami Tolvanenconfig CFI_CLANG_SHADOW
740cf68fffbSSami Tolvanen	bool "Use CFI shadow to speed up cross-module checks"
741cf68fffbSSami Tolvanen	default y
742cf68fffbSSami Tolvanen	depends on CFI_CLANG && MODULES
743cf68fffbSSami Tolvanen	help
744cf68fffbSSami Tolvanen	  If you select this option, the kernel builds a fast look-up table of
745cf68fffbSSami Tolvanen	  CFI check functions in loaded modules to reduce performance overhead.
746cf68fffbSSami Tolvanen
747cf68fffbSSami Tolvanen	  If unsure, say Y.
748cf68fffbSSami Tolvanen
749cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
750cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
751cf68fffbSSami Tolvanen	depends on CFI_CLANG
752cf68fffbSSami Tolvanen	help
753cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
754cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
755cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
756cf68fffbSSami Tolvanen
757cf68fffbSSami Tolvanen	  If unsure, say N.
758cf68fffbSSami Tolvanen
7590f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
7600f60a8efSKees Cook	bool
7610f60a8efSKees Cook	help
7620f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
7630f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
7640f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
7650f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
7660f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
7670f60a8efSKees Cook
76891d1aa43SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING
7692b1d5024SFrederic Weisbecker	bool
7702b1d5024SFrederic Weisbecker	help
77191d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
77291d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
773490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
774490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
775490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
776490f561bSFrederic Weisbecker	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
777490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
778490f561bSFrederic Weisbecker
77983c2da2eSFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_OFFSTACK
78083c2da2eSFrederic Weisbecker	bool
78183c2da2eSFrederic Weisbecker	help
78283c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
78383c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
78483c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
78583c2da2eSFrederic Weisbecker	  while context tracking is CONTEXT_USER. This feature reflects a sane
78683c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
78783c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
78883c2da2eSFrederic Weisbecker
78983c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
79083c2da2eSFrederic Weisbecker	    not interruptible).
79183c2da2eSFrederic Weisbecker	  - No use of RCU read side critical sections, unless rcu_nmi_enter()
79283c2da2eSFrederic Weisbecker	    got called.
79383c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
79483c2da2eSFrederic Weisbecker	    called.
79583c2da2eSFrederic Weisbecker
796490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
797490f561bSFrederic Weisbecker	bool
798490f561bSFrederic Weisbecker	help
799490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
800490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
8012b1d5024SFrederic Weisbecker
802b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
803b952741cSFrederic Weisbecker	bool
804b952741cSFrederic Weisbecker
8052b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
8062b91ec9fSFrederic Weisbecker	bool
8072b91ec9fSFrederic Weisbecker	help
8082b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
8092b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
8102b91ec9fSFrederic Weisbecker
81140565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
81240565b5aSStanislaw Gruszka	bool
81340565b5aSStanislaw Gruszka
814554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
815554b0004SKevin Hilman	bool
816554b0004SKevin Hilman	default y if 64BIT
817554b0004SKevin Hilman	help
818554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
819554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
820554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
821554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
822554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
823554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
824554b0004SKevin Hilman
825fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
826fdf9c356SFrederic Weisbecker	bool
827fdf9c356SFrederic Weisbecker	help
828fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
829fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
830fdf9c356SFrederic Weisbecker
831c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
832c49dd340SKalesh Singh	bool
833c49dd340SKalesh Singh	help
834c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
835c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
836c49dd340SKalesh Singh	  happens at the PGD level.
837c49dd340SKalesh Singh
8382c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
8392c91bd4aSJoel Fernandes (Google)	bool
8402c91bd4aSJoel Fernandes (Google)	help
8412c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
8422c91bd4aSJoel Fernandes (Google)
84315626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
84415626062SGerald Schaefer	bool
84515626062SGerald Schaefer
846a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
847a00cc7d9SMatthew Wilcox	bool
848a00cc7d9SMatthew Wilcox
8490ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
8500ddab1d2SToshi Kani	bool
8510ddab1d2SToshi Kani
852121e6f32SNicholas Piggin#
853121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
854121e6f32SNicholas Piggin#  arch_vmap_pmd_supported() returns true), and they must make no assumptions
855121e6f32SNicholas Piggin#  that vmalloc memory is mapped with PAGE_SIZE ptes. The VM_NO_HUGE_VMAP flag
856121e6f32SNicholas Piggin#  can be used to prohibit arch-specific allocations from using hugepages to
857121e6f32SNicholas Piggin#  help with this (e.g., modules may require it).
858121e6f32SNicholas Piggin#
859121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
860121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
861121e6f32SNicholas Piggin	bool
862121e6f32SNicholas Piggin
8633876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
8643876d4a3SAlexandre Ghiti	bool
8653876d4a3SAlexandre Ghiti
8660f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
8670f8975ecSPavel Emelyanov	bool
8680f8975ecSPavel Emelyanov
869786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
870786d35d4SDavid Howells	bool
871786d35d4SDavid Howells	help
872786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
873786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
874786d35d4SDavid Howells	  should not enable this.
875786d35d4SDavid Howells
876786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
877786d35d4SDavid Howells	bool
878786d35d4SDavid Howells	help
879786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
880786d35d4SDavid Howells	  relocations will give an error.
881786d35d4SDavid Howells
882786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
883786d35d4SDavid Howells	bool
884786d35d4SDavid Howells	help
885786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
886786d35d4SDavid Howells	  relocations will give an error.
887786d35d4SDavid Howells
888cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
889cc1f0274SFrederic Weisbecker	bool
890cc1f0274SFrederic Weisbecker	help
891cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
892cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
893cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
894cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
895cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
896cc1f0274SFrederic Weisbecker	  processing.
897cc1f0274SFrederic Weisbecker
898cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
899cd1a41ceSThomas Gleixner	bool
900cd1a41ceSThomas Gleixner	help
901cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
902c226bc3cSColin Ian King	  separate stack.
903cd1a41ceSThomas Gleixner
904235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
905235a8f02SKirill A. Shutemov	int
906235a8f02SKirill A. Shutemov	default 2
907235a8f02SKirill A. Shutemov
9082b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
9092b68f6caSKees Cook	bool
9102b68f6caSKees Cook	help
9112b68f6caSKees Cook	  An architecture supports choosing randomized locations for
9122b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
9132b68f6caSKees Cook	  - arch_mmap_rnd()
914204db6edSKees Cook	  - arch_randomize_brk()
9152b68f6caSKees Cook
916d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
917d07e2259SDaniel Cashman	bool
918d07e2259SDaniel Cashman	help
919d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
920d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
921d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
922d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
923d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
924d07e2259SDaniel Cashman
9255f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
9265f56a5dfSJiri Slaby	bool
9275f56a5dfSJiri Slaby	help
9285f56a5dfSJiri Slaby	  An architecture implements exit_thread.
9295f56a5dfSJiri Slaby
930d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
931d07e2259SDaniel Cashman	int
932d07e2259SDaniel Cashman
933d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
934d07e2259SDaniel Cashman	int
935d07e2259SDaniel Cashman
936d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
937d07e2259SDaniel Cashman	int
938d07e2259SDaniel Cashman
939d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
940d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
941d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
942d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
943d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
944d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
945d07e2259SDaniel Cashman	help
946d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
947d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
948d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
949d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
950d07e2259SDaniel Cashman
951d07e2259SDaniel Cashman	  This value can be changed after boot using the
952d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
953d07e2259SDaniel Cashman
954d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
955d07e2259SDaniel Cashman	bool
956d07e2259SDaniel Cashman	help
957d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
958d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
959d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
960d07e2259SDaniel Cashman	  enabled and provides values for both:
961d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
962d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
963d07e2259SDaniel Cashman
964d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
965d07e2259SDaniel Cashman	int
966d07e2259SDaniel Cashman
967d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
968d07e2259SDaniel Cashman	int
969d07e2259SDaniel Cashman
970d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
971d07e2259SDaniel Cashman	int
972d07e2259SDaniel Cashman
973d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
974d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
975d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
976d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
977d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
978d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
979d07e2259SDaniel Cashman	help
980d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
981d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
982d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
983d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
984d07e2259SDaniel Cashman	  supported values.
985d07e2259SDaniel Cashman
986d07e2259SDaniel Cashman	  This value can be changed after boot using the
987d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
988d07e2259SDaniel Cashman
9891b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
9901b028f78SDmitry Safonov	bool
9911b028f78SDmitry Safonov	help
9921b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
9931b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
9941b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
9951b028f78SDmitry Safonov
9961f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
9971f0e290cSGuenter Roeck	def_bool y
9981f0e290cSGuenter Roeck	depends on !ARM64_64K_PAGES
9991f0e290cSGuenter Roeck	depends on !IA64_PAGE_SIZE_64KB
10001f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
10011f0e290cSGuenter Roeck	depends on !PARISC_PAGE_SIZE_64KB
10021f0e290cSGuenter Roeck	depends on !PPC_64K_PAGES
1003e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1004e4bbd20dSNathan Chancellor
1005e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1006e4bbd20dSNathan Chancellor	def_bool y
10071f0e290cSGuenter Roeck	depends on !PPC_256K_PAGES
10081f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
10091f0e290cSGuenter Roeck
101067f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
101167f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
101267f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
101367f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
101467f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
101567f3977fSAlexandre Ghiti# - STACK_RND_MASK
101667f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
101767f3977fSAlexandre Ghiti	bool
101867f3977fSAlexandre Ghiti	depends on MMU
1019e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
102067f3977fSAlexandre Ghiti
1021b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1022b9ab5ebbSJosh Poimboeuf	bool
1023b9ab5ebbSJosh Poimboeuf	help
1024b9ab5ebbSJosh Poimboeuf	  Architecture supports the 'objtool check' host tool command, which
1025b9ab5ebbSJosh Poimboeuf	  performs compile-time stack metadata validation.
1026b9ab5ebbSJosh Poimboeuf
1027af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1028af085d90SJosh Poimboeuf	bool
1029af085d90SJosh Poimboeuf	help
1030140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1031140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1032140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1033af085d90SJosh Poimboeuf
1034468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1035468a9428SGeorge Spelvin	bool
1036468a9428SGeorge Spelvin	default n
1037468a9428SGeorge Spelvin	help
1038468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1039468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1040468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1041468a9428SGeorge Spelvin
1042666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1043666047feSFinn Thain	bool
1044666047feSFinn Thain
10453a495511SWilliam Breathitt Grayconfig ISA_BUS_API
10463a495511SWilliam Breathitt Gray	def_bool ISA
10473a495511SWilliam Breathitt Gray
1048d2125043SAl Viro#
1049d2125043SAl Viro# ABI hall of shame
1050d2125043SAl Viro#
1051d2125043SAl Viroconfig CLONE_BACKWARDS
1052d2125043SAl Viro	bool
1053d2125043SAl Viro	help
1054d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1055d2125043SAl Viro	  not the 5th one.
1056d2125043SAl Viro
1057d2125043SAl Viroconfig CLONE_BACKWARDS2
1058d2125043SAl Viro	bool
1059d2125043SAl Viro	help
1060d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1061d2125043SAl Viro
1062dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1063dfa9771aSMichal Simek	bool
1064dfa9771aSMichal Simek	help
1065dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1066dfa9771aSMichal Simek	  not the 5th one.
1067dfa9771aSMichal Simek
1068eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1069eaca6eaeSAl Viro	bool
1070eaca6eaeSAl Viro	help
1071eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1072eaca6eaeSAl Viro
10730a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
10740a0e8cdfSAl Viro	bool
10750a0e8cdfSAl Viro	help
10760a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
10770a0e8cdfSAl Viro
10780a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
10790a0e8cdfSAl Viro	bool
10800a0e8cdfSAl Viro	help
10810a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
10820a0e8cdfSAl Viro
1083495dfbf7SAl Viroconfig OLD_SIGACTION
1084495dfbf7SAl Viro	bool
1085495dfbf7SAl Viro	help
1086495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1087495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1088495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1089495dfbf7SAl Viro	  compatibility...
1090495dfbf7SAl Viro
1091495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1092495dfbf7SAl Viro	bool
1093495dfbf7SAl Viro
109417435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1095942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1096942437c9SArnd Bergmann	default !64BIT || COMPAT
109717435e5fSDeepa Dinamani	help
109817435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
109917435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
110017435e5fSDeepa Dinamani	  as part of compat syscall handling.
110117435e5fSDeepa Dinamani
110287a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
110387a4c375SChristoph Hellwig	bool
110487a4c375SChristoph Hellwig
1105cb2c7d1aSMickaël Salaünconfig ARCH_EPHEMERAL_INODES
1106cb2c7d1aSMickaël Salaün	def_bool n
1107cb2c7d1aSMickaël Salaün	help
1108cb2c7d1aSMickaël Salaün	  An arch should select this symbol if it doesn't keep track of inode
1109cb2c7d1aSMickaël Salaün	  instances on its own, but instead relies on something else (e.g. the
1110cb2c7d1aSMickaël Salaün	  host kernel for an UML kernel).
1111cb2c7d1aSMickaël Salaün
1112a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1113a50a3f4bSThomas Gleixner	bool
1114a50a3f4bSThomas Gleixner
1115fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1116fff7fb0bSZhaoxiu Zeng	def_bool n
1117fff7fb0bSZhaoxiu Zeng
1118ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1119ba14a194SAndy Lutomirski	def_bool n
1120ba14a194SAndy Lutomirski	help
1121ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1122ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1123ba14a194SAndy Lutomirski
1124ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1125ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1126ba14a194SAndy Lutomirski
1127ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1128ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1129ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1130ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1131ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1132ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1133ba14a194SAndy Lutomirski
1134ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1135ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1136ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1137ba14a194SAndy Lutomirski
1138ba14a194SAndy Lutomirskiconfig VMAP_STACK
1139ba14a194SAndy Lutomirski	default y
1140ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1141eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
114238dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1143a7f7f624SMasahiro Yamada	help
1144ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1145ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1146ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1147ba14a194SAndy Lutomirski	  corruption.
1148ba14a194SAndy Lutomirski
114938dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
115038dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
115138dd767dSAndrey Konovalov	  must be enabled.
1152ba14a194SAndy Lutomirski
115339218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
115439218ff4SKees Cook	def_bool n
115539218ff4SKees Cook	help
115639218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
115739218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
115839218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
115939218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
116039218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
116139218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
116239218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
116339218ff4SKees Cook	  of the static branch state.
116439218ff4SKees Cook
116539218ff4SKees Cookconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
116639218ff4SKees Cook	bool "Randomize kernel stack offset on syscall entry"
116739218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
116839218ff4SKees Cook	help
116939218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
117039218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
117139218ff4SKees Cook	  attacks that depend on stack address determinism or
117239218ff4SKees Cook	  cross-syscall address exposures. This feature is controlled
117339218ff4SKees Cook	  by kernel boot param "randomize_kstack_offset=on/off", and this
117439218ff4SKees Cook	  config chooses the default boot state.
117539218ff4SKees Cook
1176ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1177ad21fc4fSLaura Abbott	def_bool n
1178ad21fc4fSLaura Abbott
1179ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1180ad21fc4fSLaura Abbott	def_bool n
1181ad21fc4fSLaura Abbott
1182ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1183ad21fc4fSLaura Abbott	def_bool n
1184ad21fc4fSLaura Abbott
11850f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1186ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1187ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1188ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1189ad21fc4fSLaura Abbott	help
1190ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1191ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1192ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1193ad21fc4fSLaura Abbott	  or modifying text)
1194ad21fc4fSLaura Abbott
1195ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1196ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1197ad21fc4fSLaura Abbott
1198ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1199ad21fc4fSLaura Abbott	def_bool n
1200ad21fc4fSLaura Abbott
12010f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1202ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1203ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1204ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1205ad21fc4fSLaura Abbott	help
1206ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1207ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1208ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1209ad21fc4fSLaura Abbott
1210ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1211ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1212ea8c64acSChristoph Hellwig	bool
1213ea8c64acSChristoph Hellwig
121404f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
121504f264d3SPaul Burton	bool
121604f264d3SPaul Burton	help
121704f264d3SPaul Burton	  An architecture can select this if it provides an
121804f264d3SPaul Burton	  asm/compiler.h header that should be included after
121904f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
122004f264d3SPaul Burton	  headers generally provide.
122104f264d3SPaul Burton
1222271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1223271ca788SArd Biesheuvel	bool
1224271ca788SArd Biesheuvel	help
1225271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1226271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1227271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1228271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1229271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1230271ca788SArd Biesheuvel	  kernels.
1231271ca788SArd Biesheuvel
1232ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1233ce9084baSArd Biesheuvel	bool
1234ce9084baSArd Biesheuvel
1235fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1236fb346fd9SWaiman Long	bool "Locking event counts collection"
1237fb346fd9SWaiman Long	depends on DEBUG_FS
1238a7f7f624SMasahiro Yamada	help
1239fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1240fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1241fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1242fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1243fb346fd9SWaiman Long
12445cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
12455cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
12465cf896fbSPeter Collingbourne	bool
12475cf896fbSPeter Collingbourne
12485cf896fbSPeter Collingbourneconfig RELR
12495cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
12505cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
12515cf896fbSPeter Collingbourne	default y
12525cf896fbSPeter Collingbourne	help
12535cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
12545cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
12555cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
12565cf896fbSPeter Collingbourne	  are compatible).
12575cf896fbSPeter Collingbourne
12580c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
12590c9c1d56SThiago Jung Bauermann	bool
12600c9c1d56SThiago Jung Bauermann
126146b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
126246b49b12STom Lendacky	bool
126346b49b12STom Lendacky
12640e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
12650e242208SHassan Naveed       bool
12660e242208SHassan Naveed       help
12670e242208SHassan Naveed          An architecture should select this if its syscall numbering is sparse
12680e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
12690e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
12700e242208SHassan Naveed	  related optimizations for a given architecture.
12710e242208SHassan Naveed
1272d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1273d60d7de3SSven Schnelle	bool
1274d60d7de3SSven Schnelle
1275115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1276115284d8SJosh Poimboeuf	bool
1277115284d8SJosh Poimboeuf
12789183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
12799183c3f9SJosh Poimboeuf	bool
12809183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
12819183c3f9SJosh Poimboeuf
12826ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
12836ef869e0SMichal Hocko	bool
12846ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
12856ef869e0SMichal Hocko	depends on GENERIC_ENTRY
12866ef869e0SMichal Hocko	help
12876ef869e0SMichal Hocko	   Select this if the architecture support boot time preempt setting
12886ef869e0SMichal Hocko	   on top of static calls. It is strongly advised to support inline
12896ef869e0SMichal Hocko	   static call to avoid any overhead.
12906ef869e0SMichal Hocko
129159612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
129259612b24SNathan Chancellor	bool
129359612b24SNathan Chancellor	help
129459612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
129559612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
129659612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
129759612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
129859612b24SNathan Chancellor	  versions.
129959612b24SNathan Chancellor
13004f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
13014f5b0c17SMike Rapoport	bool
13024f5b0c17SMike Rapoport
13035d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
13045d6ad668SMike Rapoport	bool
13055d6ad668SMike Rapoport
1306df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1307df4e817bSPasha Tatashin	bool
1308df4e817bSPasha Tatashin
13092ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
13102ca408d9SBrian Gerst	bool
13112ca408d9SBrian Gerst	help
13122ca408d9SBrian Gerst	   If a 32-bit architecture requires 64-bit arguments to be split into
13132ca408d9SBrian Gerst	   pairs of 32-bit arguments, select this option.
13142ca408d9SBrian Gerst
13157facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
13167facdc42SAl Viro	bool
13177facdc42SAl Viro
131858e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
131958e106e7SBalbir Singh	bool
132058e106e7SBalbir Singh
13211bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
13221bdda24cSThomas Gleixner	bool
13231bdda24cSThomas Gleixner
132450468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
132550468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
132650468e43SJarkko Sakkinen	bool
132750468e43SJarkko Sakkinen
13282521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
132945332b1bSMasahiro Yamada
133045332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1331fa1b5d09SLinus Torvalds
133222471e13SRandy Dunlapendmenu
1333