xref: /linux/arch/Kconfig (revision ba64beb17493a4bfec563100c86a462a15926f24)
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
194540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
1959802d865SJosef Bacik	bool
1969802d865SJosef Bacik
19742a0bb3fSPetr Mladekconfig HAVE_NMI
19842a0bb3fSPetr Mladek	bool
19942a0bb3fSPetr Mladek
2001f5a4ad9SRoland McGrath#
2011f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2021f5a4ad9SRoland McGrath#
2031f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2041f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2051f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2061f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2071f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2081f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
2091f5a4ad9SRoland McGrath#	TIF_SYSCALL_TRACE	calls tracehook_report_syscall_{entry,exit}
2101f5a4ad9SRoland McGrath#	TIF_NOTIFY_RESUME	calls tracehook_notify_resume()
2111f5a4ad9SRoland McGrath#	signal delivery		calls tracehook_signal_handler()
2121f5a4ad9SRoland McGrath#
2131f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2149ba16087SJan Beulich	bool
2151f5a4ad9SRoland McGrath
216c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
217c64be2bbSMarek Szyprowski	bool
218c64be2bbSMarek Szyprowski
21929d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
22029d5e047SThomas Gleixner	bool
22129d5e047SThomas Gleixner
222485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
223485cf5daSKevin Hilman	bool
224485cf5daSKevin Hilman
2256974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2266974f0c4SDaniel Micay	bool
2276974f0c4SDaniel Micay	help
2286974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2296974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2306974f0c4SDaniel Micay
231d8ae8a37SChristoph Hellwig#
232d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
233d8ae8a37SChristoph Hellwig# command line option
234d8ae8a37SChristoph Hellwig#
235d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
236d8ae8a37SChristoph Hellwig	bool
237d8ae8a37SChristoph Hellwig
238d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
239d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
240d2852a22SDaniel Borkmann	bool
241d2852a22SDaniel Borkmann
242d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
243d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
244d253ca0cSRick Edgecombe	bool
245d253ca0cSRick Edgecombe
246c30700dbSChristoph Hellwig#
247fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
248a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
249fa7e2247SChristoph Hellwig# to remap the page tables in place.
250c30700dbSChristoph Hellwig#
251fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
252c30700dbSChristoph Hellwig	bool
253c30700dbSChristoph Hellwig
254999a5d12SChristoph Hellwig#
255999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
256999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
257999a5d12SChristoph Hellwig#
258999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
259f5e10287SThomas Gleixner	bool
260f5e10287SThomas Gleixner
2615905429aSKees Cook# Select if arch init_task must go in the __init_task_data section
2625905429aSKees Cookconfig ARCH_TASK_STRUCT_ON_STACK
2635905429aSKees Cook	bool
2645905429aSKees Cook
2655905429aSKees Cook# Select if arch has its private alloc_task_struct() function
2665905429aSKees Cookconfig ARCH_TASK_STRUCT_ALLOCATOR
2675905429aSKees Cook	bool
2685905429aSKees Cook
2695905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
2705905429aSKees Cook	bool
2715905429aSKees Cook	depends on !ARCH_TASK_STRUCT_ALLOCATOR
272b235beeaSLinus Torvalds	help
273b235beeaSLinus Torvalds	  An architecture should select this to provide hardened usercopy
274f5e10287SThomas Gleixner	  knowledge about what region of the thread_struct should be
275f5e10287SThomas Gleixner	  whitelisted for copying to userspace. Normally this is only the
2765aaeb5c0SIngo Molnar	  FPU registers. Specifically, arch_thread_struct_whitelist()
2775aaeb5c0SIngo Molnar	  should be implemented. Without this, the entire thread_struct
2785aaeb5c0SIngo Molnar	  field in task_struct will be left whitelisted.
2795aaeb5c0SIngo Molnar
280942fa985SYury Norov# Select if arch has its private alloc_thread_stack() function
281942fa985SYury Norovconfig ARCH_THREAD_STACK_ALLOCATOR
282942fa985SYury Norov	bool
283942fa985SYury Norov
284942fa985SYury Norov# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
285942fa985SYury Norovconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
286942fa985SYury Norov	bool
287942fa985SYury Norov
288942fa985SYury Norovconfig ARCH_32BIT_OFF_T
289942fa985SYury Norov	bool
290f850c30cSHeiko Carstens	depends on !64BIT
291f850c30cSHeiko Carstens	help
292e01292b1SHeiko Carstens	  All new 32-bit architectures should have 64-bit off_t type on
293e01292b1SHeiko Carstens	  userspace side which corresponds to the loff_t kernel type. This
294e01292b1SHeiko Carstens	  is the requirement for modern ABIs. Some existing architectures
295e01292b1SHeiko Carstens	  still support 32-bit off_t. This option is enabled for all such
296e01292b1SHeiko Carstens	  architectures explicitly.
297f850c30cSHeiko Carstens
29896c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
29996c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
30096c0a6a7SHeiko Carstens	bool
30196c0a6a7SHeiko Carstens
3022ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3032ff2b7ecSMasahiro Yamada	bool
3042ff2b7ecSMasahiro Yamada	help
305a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
3062ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3072ff2b7ecSMasahiro Yamada	  exported from assembly code.
3082ff2b7ecSMasahiro Yamada
3099483a578SDavid Brownellconfig HAVE_REGS_AND_STACK_ACCESS_API
3109ba16087SJan Beulich	bool
3119483a578SDavid Brownell	help
312a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
3139483a578SDavid Brownell	  the API needed to access registers and stack entries from pt_regs,
3149483a578SDavid Brownell	  declared in asm/ptrace.h
3155ee00bd4SJoerg Roedel	  For example the kprobes-based event tracer needs this API.
3165ee00bd4SJoerg Roedel
317d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
318d7822b1eSMathieu Desnoyers	bool
319d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
320d7822b1eSMathieu Desnoyers	help
321d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
322d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
323d7822b1eSMathieu Desnoyers
3243c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3253c88ee19SMasami Hiramatsu	bool
3263c88ee19SMasami Hiramatsu	help
327a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
3283c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3293c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3303c88ee19SMasami Hiramatsu
33162a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
33262a038d3SK.Prasad	bool
33399e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
33462a038d3SK.Prasad
3350102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
3360102752eSFrederic Weisbecker	bool
3370102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
3380102752eSFrederic Weisbecker	help
3390102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
3400102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
3410102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
3420102752eSFrederic Weisbecker	  them but define the access type in a control register.
3430102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3440102752eSFrederic Weisbecker	  latter fashion.
3450102752eSFrederic Weisbecker
3467c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3477c68af6eSAvi Kivity	bool
348a1922ed6SIngo Molnar
349c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
350c01d4323SFrederic Weisbecker	bool
35123637d47SFrederic Weisbecker	help
35223637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
35323637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
35423637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
355c01d4323SFrederic Weisbecker
35605a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
35705a4a952SNicholas Piggin	bool
35805a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
35905a4a952SNicholas Piggin	help
36005a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
36105a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
36205a4a952SNicholas Piggin
36305a4a952SNicholas Pigginconfig HAVE_NMI_WATCHDOG
36405a4a952SNicholas Piggin	depends on HAVE_NMI
36505a4a952SNicholas Piggin	bool
36605a4a952SNicholas Piggin	help
36705a4a952SNicholas Piggin	  The arch provides a low level NMI watchdog. It provides
36805a4a952SNicholas Piggin	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
36905a4a952SNicholas Piggin
37005a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
37105a4a952SNicholas Piggin	bool
37205a4a952SNicholas Piggin	select HAVE_NMI_WATCHDOG
37305a4a952SNicholas Piggin	help
37405a4a952SNicholas Piggin	  The arch chooses to provide its own hardlockup detector, which is
37505a4a952SNicholas Piggin	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
37605a4a952SNicholas Piggin	  interfaces and parameters provided by hardlockup detector subsystem.
37705a4a952SNicholas Piggin
378c5e63197SJiri Olsaconfig HAVE_PERF_REGS
379c5e63197SJiri Olsa	bool
380c5e63197SJiri Olsa	help
381c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
382c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
383c5e63197SJiri Olsa
384c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
385c5ebcedbSJiri Olsa	bool
386c5ebcedbSJiri Olsa	help
387c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
388c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
389c5ebcedbSJiri Olsa	  architectures.
390c5ebcedbSJiri Olsa
391bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
392bf5438fcSJason Baron	bool
393bf5438fcSJason Baron
39450ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
39550ff18abSArd Biesheuvel	bool
39650ff18abSArd Biesheuvel
3970d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
3980d6e24d4SPeter Zijlstra	bool
3990d6e24d4SPeter Zijlstra
400ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
40126723911SPeter Zijlstra	bool
4020d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
40326723911SPeter Zijlstra
4043af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
405ed6a7935SPeter Zijlstra	bool
406ed6a7935SPeter Zijlstra
40727796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
40827796d03SPeter Zijlstra	bool
40927796d03SPeter Zijlstra
410580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
411952a31c9SMartin Schwidefsky	bool
4120d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
413952a31c9SMartin Schwidefsky
414d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
415d53c3dfbSNicholas Piggin	bool
416d53c3dfbSNicholas Piggin	help
417d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
418d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
419d53c3dfbSNicholas Piggin	  shootdowns should enable this.
420d53c3dfbSNicholas Piggin
421df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
422df013ffbSHuang Ying	bool
423df013ffbSHuang Ying
42443570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
42543570fd2SHeiko Carstens	bool
42643570fd2SHeiko Carstens	help
42743570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
42843570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
42943570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
43043570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
43143570fd2SHeiko Carstens
4324156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
4334156153cSHeiko Carstens	bool
4344156153cSHeiko Carstens
4352565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
4362565409fSHeiko Carstens	bool
4372565409fSHeiko Carstens
43877e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
43977e58496SPaul E. McKenney	bool
44077e58496SPaul E. McKenney
441c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
442c1d7e01dSWill Deacon	bool
443c1d7e01dSWill Deacon
444c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
445c1d7e01dSWill Deacon	bool
446c1d7e01dSWill Deacon
44748b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
448c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
44948b25c43SChris Metcalf	bool
45048b25c43SChris Metcalf
451282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
452e2cfabdfSWill Drewry	bool
453e2cfabdfSWill Drewry	help
454282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
455282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
456282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
457282a181bSYiFei Zhu	  - __NR_seccomp_read_32
458282a181bSYiFei Zhu	  - __NR_seccomp_write_32
459282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
460282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
461282a181bSYiFei Zhu
462282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
463282a181bSYiFei Zhu	bool
464282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
465282a181bSYiFei Zhu	help
466fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
467282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
468bb6ea430SWill Drewry	  - syscall_get_arch()
469bb6ea430SWill Drewry	  - syscall_get_arguments()
470bb6ea430SWill Drewry	  - syscall_rollback()
471bb6ea430SWill Drewry	  - syscall_set_return_value()
472fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
473fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
474fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
475fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
47648dc92b9SKees Cook	  - seccomp syscall wired up
4770d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
4780d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
4790d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
480e2cfabdfSWill Drewry
481282a181bSYiFei Zhuconfig SECCOMP
482282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
483282a181bSYiFei Zhu	def_bool y
484282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
485282a181bSYiFei Zhu	help
486282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
487282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
488282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
489282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
490282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
491282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
492282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
493282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
494282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
495282a181bSYiFei Zhu
496282a181bSYiFei Zhu	  If unsure, say Y.
497282a181bSYiFei Zhu
498e2cfabdfSWill Drewryconfig SECCOMP_FILTER
499e2cfabdfSWill Drewry	def_bool y
500e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
501e2cfabdfSWill Drewry	help
502e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
503e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
504e2cfabdfSWill Drewry	  task-defined system call filtering polices.
505e2cfabdfSWill Drewry
5065fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
507e2cfabdfSWill Drewry
5080d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
5090d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
5100d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
5110d8315ddSYiFei Zhu	depends on PROC_FS
5120d8315ddSYiFei Zhu	help
5130d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
5140d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
5150d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
5160d8315ddSYiFei Zhu
5170d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
5180d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
5190d8315ddSYiFei Zhu
5200d8315ddSYiFei Zhu	  If unsure, say N.
5210d8315ddSYiFei Zhu
522afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
523afaef01cSAlexander Popov	bool
524afaef01cSAlexander Popov	help
525afaef01cSAlexander Popov	  An architecture should select this if it has the code which
526afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
527afaef01cSAlexander Popov	  value before returning from system calls.
528afaef01cSAlexander Popov
529d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
53019952a92SKees Cook	bool
53119952a92SKees Cook	help
53219952a92SKees Cook	  An arch should select this symbol if:
53319952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
53419952a92SKees Cook
535050e9baaSLinus Torvaldsconfig STACKPROTECTOR
5362a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
537d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
5382a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
5392a61f474SMasahiro Yamada	default y
5408779657dSKees Cook	help
5418779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
54219952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
54319952a92SKees Cook	  the stack just before the return address, and validates
54419952a92SKees Cook	  the value just before actually returning.  Stack based buffer
54519952a92SKees Cook	  overflows (that need to overwrite this return address) now also
54619952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
54719952a92SKees Cook	  neutralized via a kernel panic.
54819952a92SKees Cook
5498779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
5508779657dSKees Cook	  have an 8-byte or larger character array on the stack.
5518779657dSKees Cook
55219952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
5538779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
5548779657dSKees Cook
5558779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5568779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
5578779657dSKees Cook	  by about 0.3%.
5588779657dSKees Cook
559050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
5602a61f474SMasahiro Yamada	bool "Strong Stack Protector"
561050e9baaSLinus Torvalds	depends on STACKPROTECTOR
5622a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
5632a61f474SMasahiro Yamada	default y
5648779657dSKees Cook	help
5658779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
5668779657dSKees Cook	  of the following conditions:
5678779657dSKees Cook
5688779657dSKees Cook	  - local variable's address used as part of the right hand side of an
5698779657dSKees Cook	    assignment or function argument
5708779657dSKees Cook	  - local variable is an array (or union containing an array),
5718779657dSKees Cook	    regardless of array type or length
5728779657dSKees Cook	  - uses register local variables
5738779657dSKees Cook
5748779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
5758779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
5768779657dSKees Cook
5778779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5788779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
5798779657dSKees Cook	  size by about 2%.
5808779657dSKees Cook
581d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
582d08b9f0cSSami Tolvanen	bool
583d08b9f0cSSami Tolvanen	help
584d08b9f0cSSami Tolvanen	  An architecture should select this if it supports Clang's Shadow
585aa7a65aeSWill Deacon	  Call Stack and implements runtime support for shadow stack
586aa7a65aeSWill Deacon	  switching.
587d08b9f0cSSami Tolvanen
588d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
589d08b9f0cSSami Tolvanen	bool "Clang Shadow Call Stack"
590d08b9f0cSSami Tolvanen	depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK
591ddc9863eSSami Tolvanen	depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
592d08b9f0cSSami Tolvanen	help
593d08b9f0cSSami Tolvanen	  This option enables Clang's Shadow Call Stack, which uses a
594d08b9f0cSSami Tolvanen	  shadow stack to protect function return addresses from being
595d08b9f0cSSami Tolvanen	  overwritten by an attacker. More information can be found in
596d08b9f0cSSami Tolvanen	  Clang's documentation:
597d08b9f0cSSami Tolvanen
598d08b9f0cSSami Tolvanen	    https://clang.llvm.org/docs/ShadowCallStack.html
599d08b9f0cSSami Tolvanen
600d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
601d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
602d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
603d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
604d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
605d08b9f0cSSami Tolvanen
606dc5723b0SSami Tolvanenconfig LTO
607dc5723b0SSami Tolvanen	bool
608dc5723b0SSami Tolvanen	help
609dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
610dc5723b0SSami Tolvanen
611dc5723b0SSami Tolvanenconfig LTO_CLANG
612dc5723b0SSami Tolvanen	bool
613dc5723b0SSami Tolvanen	select LTO
614dc5723b0SSami Tolvanen	help
615dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
616dc5723b0SSami Tolvanen
617dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
618dc5723b0SSami Tolvanen	bool
619dc5723b0SSami Tolvanen	help
620dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
621dc5723b0SSami Tolvanen	  - compiling with Clang,
622dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
623dc5723b0SSami Tolvanen	  - and linking with LLD.
624dc5723b0SSami Tolvanen
625dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
626dc5723b0SSami Tolvanen	bool
627dc5723b0SSami Tolvanen	help
628dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
629dc5723b0SSami Tolvanen	  ThinLTO mode.
630dc5723b0SSami Tolvanen
631dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
632dc5723b0SSami Tolvanen	def_bool y
633dc5723b0SSami Tolvanen	# Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510
634*ba64beb1SMasahiro Yamada	depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD && AS_IS_LLVM
635dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
636dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
637dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
638dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
639bf3c2551SSami Tolvanen	depends on !KASAN || KASAN_HW_TAGS
640dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
641dc5723b0SSami Tolvanen	help
642dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
643dc5723b0SSami Tolvanen	  LTO.
644dc5723b0SSami Tolvanen
645dc5723b0SSami Tolvanenchoice
646dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
647dc5723b0SSami Tolvanen	default LTO_NONE
648dc5723b0SSami Tolvanen	help
649dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
650dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
651dc5723b0SSami Tolvanen
652dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
653dc5723b0SSami Tolvanen	  so it's disabled by default.
654dc5723b0SSami Tolvanen
655dc5723b0SSami Tolvanenconfig LTO_NONE
656dc5723b0SSami Tolvanen	bool "None"
657dc5723b0SSami Tolvanen	help
658dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
659dc5723b0SSami Tolvanen
660dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
661dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
662dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
663dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
664dc5723b0SSami Tolvanen	select LTO_CLANG
665dc5723b0SSami Tolvanen	help
666dc5723b0SSami Tolvanen          This option enables Clang's full Link Time Optimization (LTO), which
667dc5723b0SSami Tolvanen          allows the compiler to optimize the kernel globally. If you enable
668dc5723b0SSami Tolvanen          this option, the compiler generates LLVM bitcode instead of ELF
669dc5723b0SSami Tolvanen          object files, and the actual compilation from bitcode happens at
670dc5723b0SSami Tolvanen          the LTO link step, which may take several minutes depending on the
671dc5723b0SSami Tolvanen          kernel configuration. More information can be found from LLVM's
672dc5723b0SSami Tolvanen          documentation:
673dc5723b0SSami Tolvanen
674dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
675dc5723b0SSami Tolvanen
676dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
677dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
678dc5723b0SSami Tolvanen
679dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
680dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
681dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
682dc5723b0SSami Tolvanen	select LTO_CLANG
683dc5723b0SSami Tolvanen	help
684dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
685dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
686dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
687dc5723b0SSami Tolvanen	  from Clang's documentation:
688dc5723b0SSami Tolvanen
689dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
690dc5723b0SSami Tolvanen
691dc5723b0SSami Tolvanen	  If unsure, say Y.
692dc5723b0SSami Tolvanenendchoice
693dc5723b0SSami Tolvanen
6940f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
6950f60a8efSKees Cook	bool
6960f60a8efSKees Cook	help
6970f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
6980f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
6990f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
7000f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
7010f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
7020f60a8efSKees Cook
70391d1aa43SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING
7042b1d5024SFrederic Weisbecker	bool
7052b1d5024SFrederic Weisbecker	help
70691d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
70791d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
708490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
709490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
710490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
711490f561bSFrederic Weisbecker	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
712490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
713490f561bSFrederic Weisbecker
71483c2da2eSFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_OFFSTACK
71583c2da2eSFrederic Weisbecker	bool
71683c2da2eSFrederic Weisbecker	help
71783c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
71883c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
71983c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
72083c2da2eSFrederic Weisbecker	  while context tracking is CONTEXT_USER. This feature reflects a sane
72183c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
72283c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
72383c2da2eSFrederic Weisbecker
72483c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
72583c2da2eSFrederic Weisbecker	    not interruptible).
72683c2da2eSFrederic Weisbecker	  - No use of RCU read side critical sections, unless rcu_nmi_enter()
72783c2da2eSFrederic Weisbecker	    got called.
72883c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
72983c2da2eSFrederic Weisbecker	    called.
73083c2da2eSFrederic Weisbecker
731490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
732490f561bSFrederic Weisbecker	bool
733490f561bSFrederic Weisbecker	help
734490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
735490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
7362b1d5024SFrederic Weisbecker
737b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
738b952741cSFrederic Weisbecker	bool
739b952741cSFrederic Weisbecker
7402b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
7412b91ec9fSFrederic Weisbecker	bool
7422b91ec9fSFrederic Weisbecker	help
7432b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
7442b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
7452b91ec9fSFrederic Weisbecker
74640565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
74740565b5aSStanislaw Gruszka	bool
74840565b5aSStanislaw Gruszka
749554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
750554b0004SKevin Hilman	bool
751554b0004SKevin Hilman	default y if 64BIT
752554b0004SKevin Hilman	help
753554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
754554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
755554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
756554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
757554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
758554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
759554b0004SKevin Hilman
760fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
761fdf9c356SFrederic Weisbecker	bool
762fdf9c356SFrederic Weisbecker	help
763fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
764fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
765fdf9c356SFrederic Weisbecker
766c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
767c49dd340SKalesh Singh	bool
768c49dd340SKalesh Singh	help
769c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
770c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
771c49dd340SKalesh Singh	  happens at the PGD level.
772c49dd340SKalesh Singh
7732c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
7742c91bd4aSJoel Fernandes (Google)	bool
7752c91bd4aSJoel Fernandes (Google)	help
7762c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
7772c91bd4aSJoel Fernandes (Google)
77815626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
77915626062SGerald Schaefer	bool
78015626062SGerald Schaefer
781a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
782a00cc7d9SMatthew Wilcox	bool
783a00cc7d9SMatthew Wilcox
7840ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
7850ddab1d2SToshi Kani	bool
7860ddab1d2SToshi Kani
7873876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
7883876d4a3SAlexandre Ghiti	bool
7893876d4a3SAlexandre Ghiti
7900f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
7910f8975ecSPavel Emelyanov	bool
7920f8975ecSPavel Emelyanov
793786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
794786d35d4SDavid Howells	bool
795786d35d4SDavid Howells	help
796786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
797786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
798786d35d4SDavid Howells	  should not enable this.
799786d35d4SDavid Howells
800786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
801786d35d4SDavid Howells	bool
802786d35d4SDavid Howells	help
803786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
804786d35d4SDavid Howells	  relocations will give an error.
805786d35d4SDavid Howells
806786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
807786d35d4SDavid Howells	bool
808786d35d4SDavid Howells	help
809786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
810786d35d4SDavid Howells	  relocations will give an error.
811786d35d4SDavid Howells
812cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
813cc1f0274SFrederic Weisbecker	bool
814cc1f0274SFrederic Weisbecker	help
815cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
816cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
817cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
818cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
819cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
820cc1f0274SFrederic Weisbecker	  processing.
821cc1f0274SFrederic Weisbecker
822cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
823cd1a41ceSThomas Gleixner	bool
824cd1a41ceSThomas Gleixner	help
825cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
826cd1a41ceSThomas Gleixner	  seperate stack.
827cd1a41ceSThomas Gleixner
828235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
829235a8f02SKirill A. Shutemov	int
830235a8f02SKirill A. Shutemov	default 2
831235a8f02SKirill A. Shutemov
8322b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
8332b68f6caSKees Cook	bool
8342b68f6caSKees Cook	help
8352b68f6caSKees Cook	  An architecture supports choosing randomized locations for
8362b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
8372b68f6caSKees Cook	  - arch_mmap_rnd()
838204db6edSKees Cook	  - arch_randomize_brk()
8392b68f6caSKees Cook
840d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
841d07e2259SDaniel Cashman	bool
842d07e2259SDaniel Cashman	help
843d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
844d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
845d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
846d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
847d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
848d07e2259SDaniel Cashman
8495f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
8505f56a5dfSJiri Slaby	bool
8515f56a5dfSJiri Slaby	help
8525f56a5dfSJiri Slaby	  An architecture implements exit_thread.
8535f56a5dfSJiri Slaby
854d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
855d07e2259SDaniel Cashman	int
856d07e2259SDaniel Cashman
857d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
858d07e2259SDaniel Cashman	int
859d07e2259SDaniel Cashman
860d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
861d07e2259SDaniel Cashman	int
862d07e2259SDaniel Cashman
863d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
864d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
865d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
866d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
867d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
868d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
869d07e2259SDaniel Cashman	help
870d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
871d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
872d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
873d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
874d07e2259SDaniel Cashman
875d07e2259SDaniel Cashman	  This value can be changed after boot using the
876d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
877d07e2259SDaniel Cashman
878d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
879d07e2259SDaniel Cashman	bool
880d07e2259SDaniel Cashman	help
881d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
882d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
883d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
884d07e2259SDaniel Cashman	  enabled and provides values for both:
885d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
886d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
887d07e2259SDaniel Cashman
888d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
889d07e2259SDaniel Cashman	int
890d07e2259SDaniel Cashman
891d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
892d07e2259SDaniel Cashman	int
893d07e2259SDaniel Cashman
894d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
895d07e2259SDaniel Cashman	int
896d07e2259SDaniel Cashman
897d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
898d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
899d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
900d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
901d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
902d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
903d07e2259SDaniel Cashman	help
904d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
905d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
906d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
907d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
908d07e2259SDaniel Cashman	  supported values.
909d07e2259SDaniel Cashman
910d07e2259SDaniel Cashman	  This value can be changed after boot using the
911d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
912d07e2259SDaniel Cashman
9131b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
9141b028f78SDmitry Safonov	bool
9151b028f78SDmitry Safonov	help
9161b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
9171b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
9181b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
9191b028f78SDmitry Safonov
92067f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
92167f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
92267f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
92367f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
92467f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
92567f3977fSAlexandre Ghiti# - STACK_RND_MASK
92667f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
92767f3977fSAlexandre Ghiti	bool
92867f3977fSAlexandre Ghiti	depends on MMU
929e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
93067f3977fSAlexandre Ghiti
931b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
932b9ab5ebbSJosh Poimboeuf	bool
933b9ab5ebbSJosh Poimboeuf	help
934b9ab5ebbSJosh Poimboeuf	  Architecture supports the 'objtool check' host tool command, which
935b9ab5ebbSJosh Poimboeuf	  performs compile-time stack metadata validation.
936b9ab5ebbSJosh Poimboeuf
937af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
938af085d90SJosh Poimboeuf	bool
939af085d90SJosh Poimboeuf	help
940140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
941140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
942140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
943af085d90SJosh Poimboeuf
944468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
945468a9428SGeorge Spelvin	bool
946468a9428SGeorge Spelvin	default n
947468a9428SGeorge Spelvin	help
948468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
949468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
950468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
951468a9428SGeorge Spelvin
952666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
953666047feSFinn Thain	bool
954666047feSFinn Thain
9553a495511SWilliam Breathitt Grayconfig ISA_BUS_API
9563a495511SWilliam Breathitt Gray	def_bool ISA
9573a495511SWilliam Breathitt Gray
958d2125043SAl Viro#
959d2125043SAl Viro# ABI hall of shame
960d2125043SAl Viro#
961d2125043SAl Viroconfig CLONE_BACKWARDS
962d2125043SAl Viro	bool
963d2125043SAl Viro	help
964d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
965d2125043SAl Viro	  not the 5th one.
966d2125043SAl Viro
967d2125043SAl Viroconfig CLONE_BACKWARDS2
968d2125043SAl Viro	bool
969d2125043SAl Viro	help
970d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
971d2125043SAl Viro
972dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
973dfa9771aSMichal Simek	bool
974dfa9771aSMichal Simek	help
975dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
976dfa9771aSMichal Simek	  not the 5th one.
977dfa9771aSMichal Simek
978eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
979eaca6eaeSAl Viro	bool
980eaca6eaeSAl Viro	help
981eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
982eaca6eaeSAl Viro
9830a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
9840a0e8cdfSAl Viro	bool
9850a0e8cdfSAl Viro	help
9860a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
9870a0e8cdfSAl Viro
9880a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
9890a0e8cdfSAl Viro	bool
9900a0e8cdfSAl Viro	help
9910a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
9920a0e8cdfSAl Viro
993495dfbf7SAl Viroconfig OLD_SIGACTION
994495dfbf7SAl Viro	bool
995495dfbf7SAl Viro	help
996495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
997495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
998495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
999495dfbf7SAl Viro	  compatibility...
1000495dfbf7SAl Viro
1001495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1002495dfbf7SAl Viro	bool
1003495dfbf7SAl Viro
100417435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1005942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1006942437c9SArnd Bergmann	default !64BIT || COMPAT
100717435e5fSDeepa Dinamani	help
100817435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
100917435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
101017435e5fSDeepa Dinamani	  as part of compat syscall handling.
101117435e5fSDeepa Dinamani
101287a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
101387a4c375SChristoph Hellwig	bool
101487a4c375SChristoph Hellwig
1015a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1016a50a3f4bSThomas Gleixner	bool
1017a50a3f4bSThomas Gleixner
1018fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1019fff7fb0bSZhaoxiu Zeng	def_bool n
1020fff7fb0bSZhaoxiu Zeng
1021ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1022ba14a194SAndy Lutomirski	def_bool n
1023ba14a194SAndy Lutomirski	help
1024ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1025ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1026ba14a194SAndy Lutomirski
1027ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1028ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1029ba14a194SAndy Lutomirski
1030ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1031ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1032ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1033ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1034ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1035ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1036ba14a194SAndy Lutomirski
1037ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1038ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1039ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1040ba14a194SAndy Lutomirski
1041ba14a194SAndy Lutomirskiconfig VMAP_STACK
1042ba14a194SAndy Lutomirski	default y
1043ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1044eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
104538dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1046a7f7f624SMasahiro Yamada	help
1047ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1048ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1049ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1050ba14a194SAndy Lutomirski	  corruption.
1051ba14a194SAndy Lutomirski
105238dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
105338dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
105438dd767dSAndrey Konovalov	  must be enabled.
1055ba14a194SAndy Lutomirski
1056ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1057ad21fc4fSLaura Abbott	def_bool n
1058ad21fc4fSLaura Abbott
1059ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1060ad21fc4fSLaura Abbott	def_bool n
1061ad21fc4fSLaura Abbott
1062ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1063ad21fc4fSLaura Abbott	def_bool n
1064ad21fc4fSLaura Abbott
10650f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1066ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1067ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1068ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1069ad21fc4fSLaura Abbott	help
1070ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1071ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1072ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1073ad21fc4fSLaura Abbott	  or modifying text)
1074ad21fc4fSLaura Abbott
1075ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1076ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1077ad21fc4fSLaura Abbott
1078ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1079ad21fc4fSLaura Abbott	def_bool n
1080ad21fc4fSLaura Abbott
10810f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1082ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1083ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1084ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1085ad21fc4fSLaura Abbott	help
1086ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1087ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1088ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1089ad21fc4fSLaura Abbott
1090ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1091ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1092ea8c64acSChristoph Hellwig	bool
1093ea8c64acSChristoph Hellwig
109404f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
109504f264d3SPaul Burton	bool
109604f264d3SPaul Burton	help
109704f264d3SPaul Burton	  An architecture can select this if it provides an
109804f264d3SPaul Burton	  asm/compiler.h header that should be included after
109904f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
110004f264d3SPaul Burton	  headers generally provide.
110104f264d3SPaul Burton
1102271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1103271ca788SArd Biesheuvel	bool
1104271ca788SArd Biesheuvel	help
1105271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1106271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1107271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1108271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1109271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1110271ca788SArd Biesheuvel	  kernels.
1111271ca788SArd Biesheuvel
1112ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1113ce9084baSArd Biesheuvel	bool
1114ce9084baSArd Biesheuvel
1115fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1116fb346fd9SWaiman Long	bool "Locking event counts collection"
1117fb346fd9SWaiman Long	depends on DEBUG_FS
1118a7f7f624SMasahiro Yamada	help
1119fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1120fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1121fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1122fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1123fb346fd9SWaiman Long
11245cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
11255cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
11265cf896fbSPeter Collingbourne	bool
11275cf896fbSPeter Collingbourne
11285cf896fbSPeter Collingbourneconfig RELR
11295cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
11305cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
11315cf896fbSPeter Collingbourne	default y
11325cf896fbSPeter Collingbourne	help
11335cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
11345cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
11355cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
11365cf896fbSPeter Collingbourne	  are compatible).
11375cf896fbSPeter Collingbourne
11380c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
11390c9c1d56SThiago Jung Bauermann	bool
11400c9c1d56SThiago Jung Bauermann
11410e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
11420e242208SHassan Naveed       bool
11430e242208SHassan Naveed       help
11440e242208SHassan Naveed          An architecture should select this if its syscall numbering is sparse
11450e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
11460e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
11470e242208SHassan Naveed	  related optimizations for a given architecture.
11480e242208SHassan Naveed
1149d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1150d60d7de3SSven Schnelle	bool
1151d60d7de3SSven Schnelle
1152115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1153115284d8SJosh Poimboeuf	bool
1154115284d8SJosh Poimboeuf
11559183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
11569183c3f9SJosh Poimboeuf	bool
11579183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
11589183c3f9SJosh Poimboeuf
11596ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
11606ef869e0SMichal Hocko	bool
11616ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
11626ef869e0SMichal Hocko	depends on GENERIC_ENTRY
11636ef869e0SMichal Hocko	help
11646ef869e0SMichal Hocko	   Select this if the architecture support boot time preempt setting
11656ef869e0SMichal Hocko	   on top of static calls. It is strongly advised to support inline
11666ef869e0SMichal Hocko	   static call to avoid any overhead.
11676ef869e0SMichal Hocko
116859612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
116959612b24SNathan Chancellor	bool
117059612b24SNathan Chancellor	help
117159612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
117259612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
117359612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
117459612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
117559612b24SNathan Chancellor	  versions.
117659612b24SNathan Chancellor
11774f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
11784f5b0c17SMike Rapoport	bool
11794f5b0c17SMike Rapoport
11805d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
11815d6ad668SMike Rapoport	bool
11825d6ad668SMike Rapoport
11832ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
11842ca408d9SBrian Gerst	bool
11852ca408d9SBrian Gerst	help
11862ca408d9SBrian Gerst	   If a 32-bit architecture requires 64-bit arguments to be split into
11872ca408d9SBrian Gerst	   pairs of 32-bit arguments, select this option.
11882ca408d9SBrian Gerst
11897facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
11907facdc42SAl Viro	bool
11917facdc42SAl Viro
11922521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
119345332b1bSMasahiro Yamada
119445332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1195fa1b5d09SLinus Torvalds
119622471e13SRandy Dunlapendmenu
1197