xref: /linux/arch/Kconfig (revision 282a181b1a0d66de1f0894d82f395fcd478f51d1)
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
2705736e4aSThomas Gleixnerconfig HOTPLUG_SMT
2805736e4aSThomas Gleixner	bool
2905736e4aSThomas Gleixner
30142781e1SThomas Gleixnerconfig GENERIC_ENTRY
31142781e1SThomas Gleixner       bool
32142781e1SThomas Gleixner
33125e5645SMathieu Desnoyersconfig OPROFILE
34b309a294SRobert Richter	tristate "OProfile system profiling"
35125e5645SMathieu Desnoyers	depends on PROFILING
36125e5645SMathieu Desnoyers	depends on HAVE_OPROFILE
37d69d59f4SIngo Molnar	select RING_BUFFER
389a5963ebSChristian Borntraeger	select RING_BUFFER_ALLOW_SWAP
39125e5645SMathieu Desnoyers	help
40125e5645SMathieu Desnoyers	  OProfile is a profiling system capable of profiling the
41125e5645SMathieu Desnoyers	  whole system, include the kernel, kernel modules, libraries,
42125e5645SMathieu Desnoyers	  and applications.
43125e5645SMathieu Desnoyers
44125e5645SMathieu Desnoyers	  If unsure, say N.
45125e5645SMathieu Desnoyers
464d4036e0SJason Yehconfig OPROFILE_EVENT_MULTIPLEX
474d4036e0SJason Yeh	bool "OProfile multiplexing support (EXPERIMENTAL)"
484d4036e0SJason Yeh	default n
494d4036e0SJason Yeh	depends on OPROFILE && X86
504d4036e0SJason Yeh	help
514d4036e0SJason Yeh	  The number of hardware counters is limited. The multiplexing
524d4036e0SJason Yeh	  feature enables OProfile to gather more events than counters
534d4036e0SJason Yeh	  are provided by the hardware. This is realized by switching
549332ef9dSMasahiro Yamada	  between events at a user specified time interval.
554d4036e0SJason Yeh
564d4036e0SJason Yeh	  If unsure, say N.
574d4036e0SJason Yeh
58125e5645SMathieu Desnoyersconfig HAVE_OPROFILE
599ba16087SJan Beulich	bool
60125e5645SMathieu Desnoyers
61dcfce4a0SRobert Richterconfig OPROFILE_NMI_TIMER
62dcfce4a0SRobert Richter	def_bool y
63af9feebeSAnton Blanchard	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
64dcfce4a0SRobert Richter
65125e5645SMathieu Desnoyersconfig KPROBES
66125e5645SMathieu Desnoyers	bool "Kprobes"
6705ed160eSMasami Hiramatsu	depends on MODULES
68125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
6905ed160eSMasami Hiramatsu	select KALLSYMS
70125e5645SMathieu Desnoyers	help
71125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
72125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
73125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
74125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
75125e5645SMathieu Desnoyers	  If in doubt, say "N".
76125e5645SMathieu Desnoyers
7745f81b1cSSteven Rostedtconfig JUMP_LABEL
78c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
7945f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
80e9666d10SMasahiro Yamada	depends on CC_HAS_ASM_GOTO
8145f81b1cSSteven Rostedt	help
82c5905afbSIngo Molnar	 This option enables a transparent branch optimization that
83c5905afbSIngo Molnar	 makes certain almost-always-true or almost-always-false branch
84c5905afbSIngo Molnar	 conditions even cheaper to execute within the kernel.
8545f81b1cSSteven Rostedt
86c5905afbSIngo Molnar	 Certain performance-sensitive kernel code, such as trace points,
87c5905afbSIngo Molnar	 scheduler functionality, networking code and KVM have such
88c5905afbSIngo Molnar	 branches and include support for this optimization technique.
89c5905afbSIngo Molnar
90c5905afbSIngo Molnar	 If it is detected that the compiler has support for "asm goto",
91c5905afbSIngo Molnar	 the kernel will compile such branches with just a nop
92c5905afbSIngo Molnar	 instruction. When the condition flag is toggled to true, the
93c5905afbSIngo Molnar	 nop will be converted to a jump instruction to execute the
94c5905afbSIngo Molnar	 conditional block of instructions.
95c5905afbSIngo Molnar
96c5905afbSIngo Molnar	 This technique lowers overhead and stress on the branch prediction
97c5905afbSIngo Molnar	 of the processor and generally makes the kernel faster. The update
98c5905afbSIngo Molnar	 of the condition is slower, but those are always very rare.
99c5905afbSIngo Molnar
100c5905afbSIngo Molnar	 ( On 32-bit x86, the necessary options added to the compiler
101c5905afbSIngo Molnar	   flags may increase the size of the kernel slightly. )
10245f81b1cSSteven Rostedt
1031987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
1041987c947SPeter Zijlstra	bool "Static key selftest"
1051987c947SPeter Zijlstra	depends on JUMP_LABEL
1061987c947SPeter Zijlstra	help
1071987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
1081987c947SPeter Zijlstra
109afd66255SMasami Hiramatsuconfig OPTPROBES
1105cc718b9SMasami Hiramatsu	def_bool y
1115cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
11201b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
113afd66255SMasami Hiramatsu
114e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
115e7dbfe34SMasami Hiramatsu	def_bool y
116e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
117e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
118e7dbfe34SMasami Hiramatsu	help
119e7dbfe34SMasami Hiramatsu	 If function tracer is enabled and the arch supports full
120e7dbfe34SMasami Hiramatsu	 passing of pt_regs to function tracing, then kprobes can
121e7dbfe34SMasami Hiramatsu	 optimize on top of function tracing.
122e7dbfe34SMasami Hiramatsu
1232b144498SSrikar Dronamrajuconfig UPROBES
12409294e31SDavid A. Long	def_bool n
125e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1262b144498SSrikar Dronamraju	help
1277b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1287b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1297b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1307b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1317b2d81d4SIngo Molnar	  are hit by user-space applications.
1327b2d81d4SIngo Molnar
1337b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1347b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1357b2d81d4SIngo Molnar	    application. )
1362b144498SSrikar Dronamraju
13758340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1389ba16087SJan Beulich	bool
13958340a07SJohannes Berg	help
14058340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
14158340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
14258340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
14358340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
14458340a07SJohannes Berg	  handler.)
14558340a07SJohannes Berg
14658340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
14758340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
14858340a07SJohannes Berg	  code paths to be selected for these cases. Some network
14958340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
15058340a07SJohannes Berg	  problems with received packets if doing so would not help
15158340a07SJohannes Berg	  much.
15258340a07SJohannes Berg
153c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
15458340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
15558340a07SJohannes Berg
156cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
157cf66bb93SDavid Woodhouse	bool
158cf66bb93SDavid Woodhouse	help
159cf66bb93SDavid Woodhouse	 Modern versions of GCC (since 4.4) have builtin functions
160cf66bb93SDavid Woodhouse	 for handling byte-swapping. Using these, instead of the old
161cf66bb93SDavid Woodhouse	 inline assembler that the architecture code provides in the
162cf66bb93SDavid Woodhouse	 __arch_bswapXX() macros, allows the compiler to see what's
163cf66bb93SDavid Woodhouse	 happening and offers more opportunity for optimisation. In
164cf66bb93SDavid Woodhouse	 particular, the compiler will be able to combine the byteswap
165cf66bb93SDavid Woodhouse	 with a nearby load or store and use load-and-swap or
166cf66bb93SDavid Woodhouse	 store-and-swap instructions if the architecture has them. It
167cf66bb93SDavid Woodhouse	 should almost *never* result in code which is worse than the
168cf66bb93SDavid Woodhouse	 hand-coded assembler in <asm/swab.h>.  But just in case it
169cf66bb93SDavid Woodhouse	 does, the use of the builtins is optional.
170cf66bb93SDavid Woodhouse
171cf66bb93SDavid Woodhouse	 Any architecture with load-and-swap or store-and-swap
172cf66bb93SDavid Woodhouse	 instructions should set this. And it shouldn't hurt to set it
173cf66bb93SDavid Woodhouse	 on architectures that don't have such instructions.
174cf66bb93SDavid Woodhouse
1759edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
1769edddaa2SAnanth N Mavinakayanahalli	def_bool y
1779edddaa2SAnanth N Mavinakayanahalli	depends on KPROBES && HAVE_KRETPROBES
1789edddaa2SAnanth N Mavinakayanahalli
1797c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
1807c68af6eSAvi Kivity	bool
1817c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
1827c68af6eSAvi Kivity	help
1837c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
1847c68af6eSAvi Kivity	  switch to user mode.
1857c68af6eSAvi Kivity
18628b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
1879ba16087SJan Beulich	bool
18828b2ee20SRik van Riel
189125e5645SMathieu Desnoyersconfig HAVE_KPROBES
1909ba16087SJan Beulich	bool
1919edddaa2SAnanth N Mavinakayanahalli
1929edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
1939ba16087SJan Beulich	bool
19474bc7ceeSArthur Kepner
195afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
196afd66255SMasami Hiramatsu	bool
197d314d74cSCong Wang
198e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
199e7dbfe34SMasami Hiramatsu	bool
200e7dbfe34SMasami Hiramatsu
201540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2029802d865SJosef Bacik	bool
2039802d865SJosef Bacik
20442a0bb3fSPetr Mladekconfig HAVE_NMI
20542a0bb3fSPetr Mladek	bool
20642a0bb3fSPetr Mladek
2071f5a4ad9SRoland McGrath#
2081f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2091f5a4ad9SRoland McGrath#
2101f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2111f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2121f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2131f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2141f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2151f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
2161f5a4ad9SRoland McGrath#	TIF_SYSCALL_TRACE	calls tracehook_report_syscall_{entry,exit}
2171f5a4ad9SRoland McGrath#	TIF_NOTIFY_RESUME	calls tracehook_notify_resume()
2181f5a4ad9SRoland McGrath#	signal delivery		calls tracehook_signal_handler()
2191f5a4ad9SRoland McGrath#
2201f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2219ba16087SJan Beulich	bool
2221f5a4ad9SRoland McGrath
223c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
224c64be2bbSMarek Szyprowski	bool
225c64be2bbSMarek Szyprowski
22629d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
22729d5e047SThomas Gleixner	bool
22829d5e047SThomas Gleixner
229485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
230485cf5daSKevin Hilman	bool
231485cf5daSKevin Hilman
2326974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2336974f0c4SDaniel Micay	bool
2346974f0c4SDaniel Micay	help
2356974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2366974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2376974f0c4SDaniel Micay
238d8ae8a37SChristoph Hellwig#
239d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
240d8ae8a37SChristoph Hellwig# command line option
241d8ae8a37SChristoph Hellwig#
242d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
243d8ae8a37SChristoph Hellwig	bool
244d8ae8a37SChristoph Hellwig
245d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
246d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
247d2852a22SDaniel Borkmann	bool
248d2852a22SDaniel Borkmann
249d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
250d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
251d253ca0cSRick Edgecombe	bool
252d253ca0cSRick Edgecombe
253c30700dbSChristoph Hellwig#
254fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
255fa7e2247SChristoph Hellwig# either provide an uncached segement alias for a DMA allocation, or
256fa7e2247SChristoph Hellwig# to remap the page tables in place.
257c30700dbSChristoph Hellwig#
258fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
259c30700dbSChristoph Hellwig	bool
260c30700dbSChristoph Hellwig
261999a5d12SChristoph Hellwig#
262999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
263999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
264999a5d12SChristoph Hellwig#
265999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
266f5e10287SThomas Gleixner	bool
267f5e10287SThomas Gleixner
2685905429aSKees Cook# Select if arch init_task must go in the __init_task_data section
2695905429aSKees Cookconfig ARCH_TASK_STRUCT_ON_STACK
2705905429aSKees Cook	bool
2715905429aSKees Cook
2725905429aSKees Cook# Select if arch has its private alloc_task_struct() function
2735905429aSKees Cookconfig ARCH_TASK_STRUCT_ALLOCATOR
2745905429aSKees Cook	bool
2755905429aSKees Cook
2765905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
2775905429aSKees Cook	bool
2785905429aSKees Cook	depends on !ARCH_TASK_STRUCT_ALLOCATOR
279b235beeaSLinus Torvalds	help
280b235beeaSLinus Torvalds	  An architecture should select this to provide hardened usercopy
281f5e10287SThomas Gleixner	  knowledge about what region of the thread_struct should be
282f5e10287SThomas Gleixner	  whitelisted for copying to userspace. Normally this is only the
2835aaeb5c0SIngo Molnar	  FPU registers. Specifically, arch_thread_struct_whitelist()
2845aaeb5c0SIngo Molnar	  should be implemented. Without this, the entire thread_struct
2855aaeb5c0SIngo Molnar	  field in task_struct will be left whitelisted.
2865aaeb5c0SIngo Molnar
287942fa985SYury Norov# Select if arch has its private alloc_thread_stack() function
288942fa985SYury Norovconfig ARCH_THREAD_STACK_ALLOCATOR
289942fa985SYury Norov	bool
290942fa985SYury Norov
291942fa985SYury Norov# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
292942fa985SYury Norovconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
293942fa985SYury Norov	bool
294942fa985SYury Norov
295942fa985SYury Norovconfig ARCH_32BIT_OFF_T
296942fa985SYury Norov	bool
297f850c30cSHeiko Carstens	depends on !64BIT
298f850c30cSHeiko Carstens	help
299e01292b1SHeiko Carstens	  All new 32-bit architectures should have 64-bit off_t type on
300e01292b1SHeiko Carstens	  userspace side which corresponds to the loff_t kernel type. This
301e01292b1SHeiko Carstens	  is the requirement for modern ABIs. Some existing architectures
302e01292b1SHeiko Carstens	  still support 32-bit off_t. This option is enabled for all such
303e01292b1SHeiko Carstens	  architectures explicitly.
304f850c30cSHeiko Carstens
3052ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3062ff2b7ecSMasahiro Yamada	bool
3072ff2b7ecSMasahiro Yamada	help
3082ff2b7ecSMasahiro Yamada	  This symbol should be selected by an architecure if it provides
3092ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3102ff2b7ecSMasahiro Yamada	  exported from assembly code.
3112ff2b7ecSMasahiro Yamada
3129483a578SDavid Brownellconfig HAVE_REGS_AND_STACK_ACCESS_API
3139ba16087SJan Beulich	bool
3149483a578SDavid Brownell	help
3159483a578SDavid Brownell	  This symbol should be selected by an architecure if it supports
3169483a578SDavid Brownell	  the API needed to access registers and stack entries from pt_regs,
3179483a578SDavid Brownell	  declared in asm/ptrace.h
3185ee00bd4SJoerg Roedel	  For example the kprobes-based event tracer needs this API.
3195ee00bd4SJoerg Roedel
320d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
321d7822b1eSMathieu Desnoyers	bool
322d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
323d7822b1eSMathieu Desnoyers	help
324d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
325d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
326d7822b1eSMathieu Desnoyers
3273c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3283c88ee19SMasami Hiramatsu	bool
3293c88ee19SMasami Hiramatsu	help
3303c88ee19SMasami Hiramatsu	  This symbol should be selected by an architecure if it supports
3313c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3323c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3333c88ee19SMasami Hiramatsu
33462a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
33562a038d3SK.Prasad	bool
33699e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
33762a038d3SK.Prasad
3380102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
3390102752eSFrederic Weisbecker	bool
3400102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
3410102752eSFrederic Weisbecker	help
3420102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
3430102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
3440102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
3450102752eSFrederic Weisbecker	  them but define the access type in a control register.
3460102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3470102752eSFrederic Weisbecker	  latter fashion.
3480102752eSFrederic Weisbecker
3497c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3507c68af6eSAvi Kivity	bool
351a1922ed6SIngo Molnar
352c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
353c01d4323SFrederic Weisbecker	bool
35423637d47SFrederic Weisbecker	help
35523637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
35623637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
35723637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
358c01d4323SFrederic Weisbecker
35905a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
36005a4a952SNicholas Piggin	bool
36105a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
36205a4a952SNicholas Piggin	help
36305a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
36405a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
36505a4a952SNicholas Piggin
36605a4a952SNicholas Pigginconfig HAVE_NMI_WATCHDOG
36705a4a952SNicholas Piggin	depends on HAVE_NMI
36805a4a952SNicholas Piggin	bool
36905a4a952SNicholas Piggin	help
37005a4a952SNicholas Piggin	  The arch provides a low level NMI watchdog. It provides
37105a4a952SNicholas Piggin	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
37205a4a952SNicholas Piggin
37305a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
37405a4a952SNicholas Piggin	bool
37505a4a952SNicholas Piggin	select HAVE_NMI_WATCHDOG
37605a4a952SNicholas Piggin	help
37705a4a952SNicholas Piggin	  The arch chooses to provide its own hardlockup detector, which is
37805a4a952SNicholas Piggin	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
37905a4a952SNicholas Piggin	  interfaces and parameters provided by hardlockup detector subsystem.
38005a4a952SNicholas Piggin
381c5e63197SJiri Olsaconfig HAVE_PERF_REGS
382c5e63197SJiri Olsa	bool
383c5e63197SJiri Olsa	help
384c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
385c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
386c5e63197SJiri Olsa
387c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
388c5ebcedbSJiri Olsa	bool
389c5ebcedbSJiri Olsa	help
390c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
391c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
392c5ebcedbSJiri Olsa	  architectures.
393c5ebcedbSJiri Olsa
394bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
395bf5438fcSJason Baron	bool
396bf5438fcSJason Baron
39750ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
39850ff18abSArd Biesheuvel	bool
39950ff18abSArd Biesheuvel
4000d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4010d6e24d4SPeter Zijlstra	bool
4020d6e24d4SPeter Zijlstra
403ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
40426723911SPeter Zijlstra	bool
4050d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
40626723911SPeter Zijlstra
4073af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
408ed6a7935SPeter Zijlstra	bool
409ed6a7935SPeter Zijlstra
41027796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
41127796d03SPeter Zijlstra	bool
41227796d03SPeter Zijlstra
413580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
414952a31c9SMartin Schwidefsky	bool
4150d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
416952a31c9SMartin Schwidefsky
417df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
418df013ffbSHuang Ying	bool
419df013ffbSHuang Ying
42043570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
42143570fd2SHeiko Carstens	bool
42243570fd2SHeiko Carstens	help
42343570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
42443570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
42543570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
42643570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
42743570fd2SHeiko Carstens
4284156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
4294156153cSHeiko Carstens	bool
4304156153cSHeiko Carstens
4312565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
4322565409fSHeiko Carstens	bool
4332565409fSHeiko Carstens
43477e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
43577e58496SPaul E. McKenney	bool
43677e58496SPaul E. McKenney
437c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
438c1d7e01dSWill Deacon	bool
439c1d7e01dSWill Deacon
440c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
441c1d7e01dSWill Deacon	bool
442c1d7e01dSWill Deacon
44348b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
444c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
44548b25c43SChris Metcalf	bool
44648b25c43SChris Metcalf
447*282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
448e2cfabdfSWill Drewry	bool
449e2cfabdfSWill Drewry	help
450*282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
451*282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
452*282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
453*282a181bSYiFei Zhu	  - __NR_seccomp_read_32
454*282a181bSYiFei Zhu	  - __NR_seccomp_write_32
455*282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
456*282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
457*282a181bSYiFei Zhu
458*282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
459*282a181bSYiFei Zhu	bool
460*282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
461*282a181bSYiFei Zhu	help
462fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
463*282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
464bb6ea430SWill Drewry	  - syscall_get_arch()
465bb6ea430SWill Drewry	  - syscall_get_arguments()
466bb6ea430SWill Drewry	  - syscall_rollback()
467bb6ea430SWill Drewry	  - syscall_set_return_value()
468fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
469fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
470fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
471fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
47248dc92b9SKees Cook	  - seccomp syscall wired up
473e2cfabdfSWill Drewry
474*282a181bSYiFei Zhuconfig SECCOMP
475*282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
476*282a181bSYiFei Zhu	def_bool y
477*282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
478*282a181bSYiFei Zhu	help
479*282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
480*282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
481*282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
482*282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
483*282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
484*282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
485*282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
486*282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
487*282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
488*282a181bSYiFei Zhu
489*282a181bSYiFei Zhu	  If unsure, say Y.
490*282a181bSYiFei Zhu
491e2cfabdfSWill Drewryconfig SECCOMP_FILTER
492e2cfabdfSWill Drewry	def_bool y
493e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
494e2cfabdfSWill Drewry	help
495e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
496e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
497e2cfabdfSWill Drewry	  task-defined system call filtering polices.
498e2cfabdfSWill Drewry
4995fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
500e2cfabdfSWill Drewry
501afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
502afaef01cSAlexander Popov	bool
503afaef01cSAlexander Popov	help
504afaef01cSAlexander Popov	  An architecture should select this if it has the code which
505afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
506afaef01cSAlexander Popov	  value before returning from system calls.
507afaef01cSAlexander Popov
508d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
50919952a92SKees Cook	bool
51019952a92SKees Cook	help
51119952a92SKees Cook	  An arch should select this symbol if:
51219952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
51319952a92SKees Cook
514050e9baaSLinus Torvaldsconfig STACKPROTECTOR
5152a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
516d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
5172a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
5182a61f474SMasahiro Yamada	default y
5198779657dSKees Cook	help
5208779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
52119952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
52219952a92SKees Cook	  the stack just before the return address, and validates
52319952a92SKees Cook	  the value just before actually returning.  Stack based buffer
52419952a92SKees Cook	  overflows (that need to overwrite this return address) now also
52519952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
52619952a92SKees Cook	  neutralized via a kernel panic.
52719952a92SKees Cook
5288779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
5298779657dSKees Cook	  have an 8-byte or larger character array on the stack.
5308779657dSKees Cook
53119952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
5328779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
5338779657dSKees Cook
5348779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5358779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
5368779657dSKees Cook	  by about 0.3%.
5378779657dSKees Cook
538050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
5392a61f474SMasahiro Yamada	bool "Strong Stack Protector"
540050e9baaSLinus Torvalds	depends on STACKPROTECTOR
5412a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
5422a61f474SMasahiro Yamada	default y
5438779657dSKees Cook	help
5448779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
5458779657dSKees Cook	  of the following conditions:
5468779657dSKees Cook
5478779657dSKees Cook	  - local variable's address used as part of the right hand side of an
5488779657dSKees Cook	    assignment or function argument
5498779657dSKees Cook	  - local variable is an array (or union containing an array),
5508779657dSKees Cook	    regardless of array type or length
5518779657dSKees Cook	  - uses register local variables
5528779657dSKees Cook
5538779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
5548779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
5558779657dSKees Cook
5568779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5578779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
5588779657dSKees Cook	  size by about 2%.
5598779657dSKees Cook
560d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
561d08b9f0cSSami Tolvanen	bool
562d08b9f0cSSami Tolvanen	help
563d08b9f0cSSami Tolvanen	  An architecture should select this if it supports Clang's Shadow
564aa7a65aeSWill Deacon	  Call Stack and implements runtime support for shadow stack
565aa7a65aeSWill Deacon	  switching.
566d08b9f0cSSami Tolvanen
567d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
568d08b9f0cSSami Tolvanen	bool "Clang Shadow Call Stack"
569d08b9f0cSSami Tolvanen	depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK
570ddc9863eSSami Tolvanen	depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
571d08b9f0cSSami Tolvanen	help
572d08b9f0cSSami Tolvanen	  This option enables Clang's Shadow Call Stack, which uses a
573d08b9f0cSSami Tolvanen	  shadow stack to protect function return addresses from being
574d08b9f0cSSami Tolvanen	  overwritten by an attacker. More information can be found in
575d08b9f0cSSami Tolvanen	  Clang's documentation:
576d08b9f0cSSami Tolvanen
577d08b9f0cSSami Tolvanen	    https://clang.llvm.org/docs/ShadowCallStack.html
578d08b9f0cSSami Tolvanen
579d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
580d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
581d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
582d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
583d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
584d08b9f0cSSami Tolvanen
5850f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
5860f60a8efSKees Cook	bool
5870f60a8efSKees Cook	help
5880f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
5890f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
5900f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
5910f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
5920f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
5930f60a8efSKees Cook
59491d1aa43SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING
5952b1d5024SFrederic Weisbecker	bool
5962b1d5024SFrederic Weisbecker	help
59791d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
59891d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
599490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
600490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
601490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
602490f561bSFrederic Weisbecker	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
603490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
604490f561bSFrederic Weisbecker
605490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
606490f561bSFrederic Weisbecker	bool
607490f561bSFrederic Weisbecker	help
608490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
609490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
6102b1d5024SFrederic Weisbecker
611b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
612b952741cSFrederic Weisbecker	bool
613b952741cSFrederic Weisbecker
61440565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
61540565b5aSStanislaw Gruszka	bool
61640565b5aSStanislaw Gruszka
617554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
618554b0004SKevin Hilman	bool
619554b0004SKevin Hilman	default y if 64BIT
620554b0004SKevin Hilman	help
621554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
622554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
623554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
624554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
625554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
626554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
627554b0004SKevin Hilman
628554b0004SKevin Hilman
629fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
630fdf9c356SFrederic Weisbecker	bool
631fdf9c356SFrederic Weisbecker	help
632fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
633fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
634fdf9c356SFrederic Weisbecker
6352c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
6362c91bd4aSJoel Fernandes (Google)	bool
6372c91bd4aSJoel Fernandes (Google)	help
6382c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
6392c91bd4aSJoel Fernandes (Google)
64015626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
64115626062SGerald Schaefer	bool
64215626062SGerald Schaefer
643a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
644a00cc7d9SMatthew Wilcox	bool
645a00cc7d9SMatthew Wilcox
6460ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
6470ddab1d2SToshi Kani	bool
6480ddab1d2SToshi Kani
6493876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
6503876d4a3SAlexandre Ghiti	bool
6513876d4a3SAlexandre Ghiti
6520f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
6530f8975ecSPavel Emelyanov	bool
6540f8975ecSPavel Emelyanov
655786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
656786d35d4SDavid Howells	bool
657786d35d4SDavid Howells	help
658786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
659786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
660786d35d4SDavid Howells	  should not enable this.
661786d35d4SDavid Howells
662786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
663786d35d4SDavid Howells	bool
664786d35d4SDavid Howells	help
665786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
666786d35d4SDavid Howells	  relocations will give an error.
667786d35d4SDavid Howells
668786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
669786d35d4SDavid Howells	bool
670786d35d4SDavid Howells	help
671786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
672786d35d4SDavid Howells	  relocations will give an error.
673786d35d4SDavid Howells
674cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
675cc1f0274SFrederic Weisbecker	bool
676cc1f0274SFrederic Weisbecker	help
677cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
678cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
679cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
680cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
681cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
682cc1f0274SFrederic Weisbecker	  processing.
683cc1f0274SFrederic Weisbecker
684235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
685235a8f02SKirill A. Shutemov	int
686235a8f02SKirill A. Shutemov	default 2
687235a8f02SKirill A. Shutemov
6882b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
6892b68f6caSKees Cook	bool
6902b68f6caSKees Cook	help
6912b68f6caSKees Cook	  An architecture supports choosing randomized locations for
6922b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
6932b68f6caSKees Cook	  - arch_mmap_rnd()
694204db6edSKees Cook	  - arch_randomize_brk()
6952b68f6caSKees Cook
696d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
697d07e2259SDaniel Cashman	bool
698d07e2259SDaniel Cashman	help
699d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
700d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
701d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
702d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
703d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
704d07e2259SDaniel Cashman
7055f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
7065f56a5dfSJiri Slaby	bool
7075f56a5dfSJiri Slaby	help
7085f56a5dfSJiri Slaby	  An architecture implements exit_thread.
7095f56a5dfSJiri Slaby
710d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
711d07e2259SDaniel Cashman	int
712d07e2259SDaniel Cashman
713d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
714d07e2259SDaniel Cashman	int
715d07e2259SDaniel Cashman
716d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
717d07e2259SDaniel Cashman	int
718d07e2259SDaniel Cashman
719d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
720d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
721d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
722d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
723d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
724d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
725d07e2259SDaniel Cashman	help
726d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
727d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
728d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
729d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
730d07e2259SDaniel Cashman
731d07e2259SDaniel Cashman	  This value can be changed after boot using the
732d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
733d07e2259SDaniel Cashman
734d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
735d07e2259SDaniel Cashman	bool
736d07e2259SDaniel Cashman	help
737d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
738d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
739d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
740d07e2259SDaniel Cashman	  enabled and provides values for both:
741d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
742d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
743d07e2259SDaniel Cashman
744d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
745d07e2259SDaniel Cashman	int
746d07e2259SDaniel Cashman
747d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
748d07e2259SDaniel Cashman	int
749d07e2259SDaniel Cashman
750d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
751d07e2259SDaniel Cashman	int
752d07e2259SDaniel Cashman
753d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
754d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
755d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
756d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
757d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
758d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
759d07e2259SDaniel Cashman	help
760d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
761d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
762d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
763d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
764d07e2259SDaniel Cashman	  supported values.
765d07e2259SDaniel Cashman
766d07e2259SDaniel Cashman	  This value can be changed after boot using the
767d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
768d07e2259SDaniel Cashman
7691b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
7701b028f78SDmitry Safonov	bool
7711b028f78SDmitry Safonov	help
7721b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
7731b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
7741b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
7751b028f78SDmitry Safonov
77667f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
77767f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
77867f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
77967f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
78067f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
78167f3977fSAlexandre Ghiti# - STACK_RND_MASK
78267f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
78367f3977fSAlexandre Ghiti	bool
78467f3977fSAlexandre Ghiti	depends on MMU
785e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
78667f3977fSAlexandre Ghiti
787b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
788b9ab5ebbSJosh Poimboeuf	bool
789b9ab5ebbSJosh Poimboeuf	help
790b9ab5ebbSJosh Poimboeuf	  Architecture supports the 'objtool check' host tool command, which
791b9ab5ebbSJosh Poimboeuf	  performs compile-time stack metadata validation.
792b9ab5ebbSJosh Poimboeuf
793af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
794af085d90SJosh Poimboeuf	bool
795af085d90SJosh Poimboeuf	help
796140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
797140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
798140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
799af085d90SJosh Poimboeuf
800468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
801468a9428SGeorge Spelvin	bool
802468a9428SGeorge Spelvin	default n
803468a9428SGeorge Spelvin	help
804468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
805468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
806468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
807468a9428SGeorge Spelvin
808666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
809666047feSFinn Thain	bool
810666047feSFinn Thain
8113a495511SWilliam Breathitt Grayconfig ISA_BUS_API
8123a495511SWilliam Breathitt Gray	def_bool ISA
8133a495511SWilliam Breathitt Gray
814d2125043SAl Viro#
815d2125043SAl Viro# ABI hall of shame
816d2125043SAl Viro#
817d2125043SAl Viroconfig CLONE_BACKWARDS
818d2125043SAl Viro	bool
819d2125043SAl Viro	help
820d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
821d2125043SAl Viro	  not the 5th one.
822d2125043SAl Viro
823d2125043SAl Viroconfig CLONE_BACKWARDS2
824d2125043SAl Viro	bool
825d2125043SAl Viro	help
826d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
827d2125043SAl Viro
828dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
829dfa9771aSMichal Simek	bool
830dfa9771aSMichal Simek	help
831dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
832dfa9771aSMichal Simek	  not the 5th one.
833dfa9771aSMichal Simek
834eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
835eaca6eaeSAl Viro	bool
836eaca6eaeSAl Viro	help
837eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
838eaca6eaeSAl Viro
8390a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
8400a0e8cdfSAl Viro	bool
8410a0e8cdfSAl Viro	help
8420a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
8430a0e8cdfSAl Viro
8440a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
8450a0e8cdfSAl Viro	bool
8460a0e8cdfSAl Viro	help
8470a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
8480a0e8cdfSAl Viro
849495dfbf7SAl Viroconfig OLD_SIGACTION
850495dfbf7SAl Viro	bool
851495dfbf7SAl Viro	help
852495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
853495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
854495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
855495dfbf7SAl Viro	  compatibility...
856495dfbf7SAl Viro
857495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
858495dfbf7SAl Viro	bool
859495dfbf7SAl Viro
86017435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
861942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
862942437c9SArnd Bergmann	default !64BIT || COMPAT
86317435e5fSDeepa Dinamani	help
86417435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
86517435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
86617435e5fSDeepa Dinamani	  as part of compat syscall handling.
86717435e5fSDeepa Dinamani
86887a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
86987a4c375SChristoph Hellwig	bool
87087a4c375SChristoph Hellwig
871a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
872a50a3f4bSThomas Gleixner	bool
873a50a3f4bSThomas Gleixner
874fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
875fff7fb0bSZhaoxiu Zeng	def_bool n
876fff7fb0bSZhaoxiu Zeng
877ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
878ba14a194SAndy Lutomirski	def_bool n
879ba14a194SAndy Lutomirski	help
880ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
881ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
882ba14a194SAndy Lutomirski
883ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
884ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
885ba14a194SAndy Lutomirski
886ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
887ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
888ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
889ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
890ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
891ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
892ba14a194SAndy Lutomirski
893ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
894ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
895ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
896ba14a194SAndy Lutomirski
897ba14a194SAndy Lutomirskiconfig VMAP_STACK
898ba14a194SAndy Lutomirski	default y
899ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
900eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
901eafb149eSDaniel Axtens	depends on !KASAN || KASAN_VMALLOC
902a7f7f624SMasahiro Yamada	help
903ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
904ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
905ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
906ba14a194SAndy Lutomirski	  corruption.
907ba14a194SAndy Lutomirski
908eafb149eSDaniel Axtens	  To use this with KASAN, the architecture must support backing
909eafb149eSDaniel Axtens	  virtual mappings with real shadow memory, and KASAN_VMALLOC must
910eafb149eSDaniel Axtens	  be enabled.
911ba14a194SAndy Lutomirski
912ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
913ad21fc4fSLaura Abbott	def_bool n
914ad21fc4fSLaura Abbott
915ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
916ad21fc4fSLaura Abbott	def_bool n
917ad21fc4fSLaura Abbott
918ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
919ad21fc4fSLaura Abbott	def_bool n
920ad21fc4fSLaura Abbott
9210f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
922ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
923ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
924ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
925ad21fc4fSLaura Abbott	help
926ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
927ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
928ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
929ad21fc4fSLaura Abbott	  or modifying text)
930ad21fc4fSLaura Abbott
931ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
932ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
933ad21fc4fSLaura Abbott
934ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
935ad21fc4fSLaura Abbott	def_bool n
936ad21fc4fSLaura Abbott
9370f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
938ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
939ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
940ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
941ad21fc4fSLaura Abbott	help
942ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
943ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
944ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
945ad21fc4fSLaura Abbott
946ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
947ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
948ea8c64acSChristoph Hellwig	bool
949ea8c64acSChristoph Hellwig
95004f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
95104f264d3SPaul Burton	bool
95204f264d3SPaul Burton	help
95304f264d3SPaul Burton	  An architecture can select this if it provides an
95404f264d3SPaul Burton	  asm/compiler.h header that should be included after
95504f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
95604f264d3SPaul Burton	  headers generally provide.
95704f264d3SPaul Burton
958271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
959271ca788SArd Biesheuvel	bool
960271ca788SArd Biesheuvel	help
961271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
962271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
963271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
964271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
965271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
966271ca788SArd Biesheuvel	  kernels.
967271ca788SArd Biesheuvel
968ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
969ce9084baSArd Biesheuvel	bool
970ce9084baSArd Biesheuvel
971fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
972fb346fd9SWaiman Long	bool "Locking event counts collection"
973fb346fd9SWaiman Long	depends on DEBUG_FS
974a7f7f624SMasahiro Yamada	help
975fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
976fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
977fb346fd9SWaiman Long	  the chance of application behavior change because of timing
978fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
979fb346fd9SWaiman Long
9805cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
9815cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
9825cf896fbSPeter Collingbourne	bool
9835cf896fbSPeter Collingbourne
9845cf896fbSPeter Collingbourneconfig RELR
9855cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
9865cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
9875cf896fbSPeter Collingbourne	default y
9885cf896fbSPeter Collingbourne	help
9895cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
9905cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
9915cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
9925cf896fbSPeter Collingbourne	  are compatible).
9935cf896fbSPeter Collingbourne
9940c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
9950c9c1d56SThiago Jung Bauermann	bool
9960c9c1d56SThiago Jung Bauermann
9970e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
9980e242208SHassan Naveed       bool
9990e242208SHassan Naveed       help
10000e242208SHassan Naveed          An architecture should select this if its syscall numbering is sparse
10010e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
10020e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
10030e242208SHassan Naveed	  related optimizations for a given architecture.
10040e242208SHassan Naveed
1005d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1006d60d7de3SSven Schnelle	bool
1007d60d7de3SSven Schnelle
10082521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
100945332b1bSMasahiro Yamada
101045332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1011fa1b5d09SLinus Torvalds
101222471e13SRandy Dunlapendmenu
1013