xref: /openbmc/linux/arch/Kconfig (revision 83c2da2e)
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 OPROFILE
37b309a294SRobert Richter	tristate "OProfile system profiling"
38125e5645SMathieu Desnoyers	depends on PROFILING
39125e5645SMathieu Desnoyers	depends on HAVE_OPROFILE
40d69d59f4SIngo Molnar	select RING_BUFFER
419a5963ebSChristian Borntraeger	select RING_BUFFER_ALLOW_SWAP
42125e5645SMathieu Desnoyers	help
43125e5645SMathieu Desnoyers	  OProfile is a profiling system capable of profiling the
44125e5645SMathieu Desnoyers	  whole system, include the kernel, kernel modules, libraries,
45125e5645SMathieu Desnoyers	  and applications.
46125e5645SMathieu Desnoyers
47125e5645SMathieu Desnoyers	  If unsure, say N.
48125e5645SMathieu Desnoyers
494d4036e0SJason Yehconfig OPROFILE_EVENT_MULTIPLEX
504d4036e0SJason Yeh	bool "OProfile multiplexing support (EXPERIMENTAL)"
514d4036e0SJason Yeh	default n
524d4036e0SJason Yeh	depends on OPROFILE && X86
534d4036e0SJason Yeh	help
544d4036e0SJason Yeh	  The number of hardware counters is limited. The multiplexing
554d4036e0SJason Yeh	  feature enables OProfile to gather more events than counters
564d4036e0SJason Yeh	  are provided by the hardware. This is realized by switching
579332ef9dSMasahiro Yamada	  between events at a user specified time interval.
584d4036e0SJason Yeh
594d4036e0SJason Yeh	  If unsure, say N.
604d4036e0SJason Yeh
61125e5645SMathieu Desnoyersconfig HAVE_OPROFILE
629ba16087SJan Beulich	bool
63125e5645SMathieu Desnoyers
64dcfce4a0SRobert Richterconfig OPROFILE_NMI_TIMER
65dcfce4a0SRobert Richter	def_bool y
66af9feebeSAnton Blanchard	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
67dcfce4a0SRobert Richter
68125e5645SMathieu Desnoyersconfig KPROBES
69125e5645SMathieu Desnoyers	bool "Kprobes"
7005ed160eSMasami Hiramatsu	depends on MODULES
71125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
7205ed160eSMasami Hiramatsu	select KALLSYMS
73125e5645SMathieu Desnoyers	help
74125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
75125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
76125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
77125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
78125e5645SMathieu Desnoyers	  If in doubt, say "N".
79125e5645SMathieu Desnoyers
8045f81b1cSSteven Rostedtconfig JUMP_LABEL
81c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
8245f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
83e9666d10SMasahiro Yamada	depends on CC_HAS_ASM_GOTO
8445f81b1cSSteven Rostedt	help
85c5905afbSIngo Molnar	 This option enables a transparent branch optimization that
86c5905afbSIngo Molnar	 makes certain almost-always-true or almost-always-false branch
87c5905afbSIngo Molnar	 conditions even cheaper to execute within the kernel.
8845f81b1cSSteven Rostedt
89c5905afbSIngo Molnar	 Certain performance-sensitive kernel code, such as trace points,
90c5905afbSIngo Molnar	 scheduler functionality, networking code and KVM have such
91c5905afbSIngo Molnar	 branches and include support for this optimization technique.
92c5905afbSIngo Molnar
93c5905afbSIngo Molnar	 If it is detected that the compiler has support for "asm goto",
94c5905afbSIngo Molnar	 the kernel will compile such branches with just a nop
95c5905afbSIngo Molnar	 instruction. When the condition flag is toggled to true, the
96c5905afbSIngo Molnar	 nop will be converted to a jump instruction to execute the
97c5905afbSIngo Molnar	 conditional block of instructions.
98c5905afbSIngo Molnar
99c5905afbSIngo Molnar	 This technique lowers overhead and stress on the branch prediction
100c5905afbSIngo Molnar	 of the processor and generally makes the kernel faster. The update
101c5905afbSIngo Molnar	 of the condition is slower, but those are always very rare.
102c5905afbSIngo Molnar
103c5905afbSIngo Molnar	 ( On 32-bit x86, the necessary options added to the compiler
104c5905afbSIngo Molnar	   flags may increase the size of the kernel slightly. )
10545f81b1cSSteven Rostedt
1061987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
1071987c947SPeter Zijlstra	bool "Static key selftest"
1081987c947SPeter Zijlstra	depends on JUMP_LABEL
1091987c947SPeter Zijlstra	help
1101987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
1111987c947SPeter Zijlstra
112f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
113f03c4129SPeter Zijlstra	bool "Static call selftest"
114f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
115f03c4129SPeter Zijlstra	help
116f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
117f03c4129SPeter Zijlstra
118afd66255SMasami Hiramatsuconfig OPTPROBES
1195cc718b9SMasami Hiramatsu	def_bool y
1205cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
12101b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
122afd66255SMasami Hiramatsu
123e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
124e7dbfe34SMasami Hiramatsu	def_bool y
125e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
126e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
127e7dbfe34SMasami Hiramatsu	help
128e7dbfe34SMasami Hiramatsu	 If function tracer is enabled and the arch supports full
129e7dbfe34SMasami Hiramatsu	 passing of pt_regs to function tracing, then kprobes can
130e7dbfe34SMasami Hiramatsu	 optimize on top of function tracing.
131e7dbfe34SMasami Hiramatsu
1322b144498SSrikar Dronamrajuconfig UPROBES
13309294e31SDavid A. Long	def_bool n
134e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1352b144498SSrikar Dronamraju	help
1367b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1377b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1387b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1397b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1407b2d81d4SIngo Molnar	  are hit by user-space applications.
1417b2d81d4SIngo Molnar
1427b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1437b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1447b2d81d4SIngo Molnar	    application. )
1452b144498SSrikar Dronamraju
14658340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1479ba16087SJan Beulich	bool
14858340a07SJohannes Berg	help
14958340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
15058340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
15158340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
15258340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
15358340a07SJohannes Berg	  handler.)
15458340a07SJohannes Berg
15558340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
15658340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
15758340a07SJohannes Berg	  code paths to be selected for these cases. Some network
15858340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
15958340a07SJohannes Berg	  problems with received packets if doing so would not help
16058340a07SJohannes Berg	  much.
16158340a07SJohannes Berg
162c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
16358340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
16458340a07SJohannes Berg
165cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
166cf66bb93SDavid Woodhouse	bool
167cf66bb93SDavid Woodhouse	help
168cf66bb93SDavid Woodhouse	 Modern versions of GCC (since 4.4) have builtin functions
169cf66bb93SDavid Woodhouse	 for handling byte-swapping. Using these, instead of the old
170cf66bb93SDavid Woodhouse	 inline assembler that the architecture code provides in the
171cf66bb93SDavid Woodhouse	 __arch_bswapXX() macros, allows the compiler to see what's
172cf66bb93SDavid Woodhouse	 happening and offers more opportunity for optimisation. In
173cf66bb93SDavid Woodhouse	 particular, the compiler will be able to combine the byteswap
174cf66bb93SDavid Woodhouse	 with a nearby load or store and use load-and-swap or
175cf66bb93SDavid Woodhouse	 store-and-swap instructions if the architecture has them. It
176cf66bb93SDavid Woodhouse	 should almost *never* result in code which is worse than the
177cf66bb93SDavid Woodhouse	 hand-coded assembler in <asm/swab.h>.  But just in case it
178cf66bb93SDavid Woodhouse	 does, the use of the builtins is optional.
179cf66bb93SDavid Woodhouse
180cf66bb93SDavid Woodhouse	 Any architecture with load-and-swap or store-and-swap
181cf66bb93SDavid Woodhouse	 instructions should set this. And it shouldn't hurt to set it
182cf66bb93SDavid Woodhouse	 on architectures that don't have such instructions.
183cf66bb93SDavid Woodhouse
1849edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
1859edddaa2SAnanth N Mavinakayanahalli	def_bool y
1869edddaa2SAnanth N Mavinakayanahalli	depends on KPROBES && HAVE_KRETPROBES
1879edddaa2SAnanth N Mavinakayanahalli
1887c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
1897c68af6eSAvi Kivity	bool
1907c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
1917c68af6eSAvi Kivity	help
1927c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
1937c68af6eSAvi Kivity	  switch to user mode.
1947c68af6eSAvi Kivity
19528b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
1969ba16087SJan Beulich	bool
19728b2ee20SRik van Riel
198125e5645SMathieu Desnoyersconfig HAVE_KPROBES
1999ba16087SJan Beulich	bool
2009edddaa2SAnanth N Mavinakayanahalli
2019edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2029ba16087SJan Beulich	bool
20374bc7ceeSArthur Kepner
204afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
205afd66255SMasami Hiramatsu	bool
206d314d74cSCong Wang
207e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
208e7dbfe34SMasami Hiramatsu	bool
209e7dbfe34SMasami Hiramatsu
210540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2119802d865SJosef Bacik	bool
2129802d865SJosef Bacik
21342a0bb3fSPetr Mladekconfig HAVE_NMI
21442a0bb3fSPetr Mladek	bool
21542a0bb3fSPetr Mladek
2161f5a4ad9SRoland McGrath#
2171f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2181f5a4ad9SRoland McGrath#
2191f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2201f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2211f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2221f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2231f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2241f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
2251f5a4ad9SRoland McGrath#	TIF_SYSCALL_TRACE	calls tracehook_report_syscall_{entry,exit}
2261f5a4ad9SRoland McGrath#	TIF_NOTIFY_RESUME	calls tracehook_notify_resume()
2271f5a4ad9SRoland McGrath#	signal delivery		calls tracehook_signal_handler()
2281f5a4ad9SRoland McGrath#
2291f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2309ba16087SJan Beulich	bool
2311f5a4ad9SRoland McGrath
232c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
233c64be2bbSMarek Szyprowski	bool
234c64be2bbSMarek Szyprowski
23529d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
23629d5e047SThomas Gleixner	bool
23729d5e047SThomas Gleixner
238485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
239485cf5daSKevin Hilman	bool
240485cf5daSKevin Hilman
2416974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2426974f0c4SDaniel Micay	bool
2436974f0c4SDaniel Micay	help
2446974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2456974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2466974f0c4SDaniel Micay
247d8ae8a37SChristoph Hellwig#
248d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
249d8ae8a37SChristoph Hellwig# command line option
250d8ae8a37SChristoph Hellwig#
251d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
252d8ae8a37SChristoph Hellwig	bool
253d8ae8a37SChristoph Hellwig
254d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
255d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
256d2852a22SDaniel Borkmann	bool
257d2852a22SDaniel Borkmann
258d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
259d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
260d253ca0cSRick Edgecombe	bool
261d253ca0cSRick Edgecombe
262c30700dbSChristoph Hellwig#
263fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
264fa7e2247SChristoph Hellwig# either provide an uncached segement alias for a DMA allocation, or
265fa7e2247SChristoph Hellwig# to remap the page tables in place.
266c30700dbSChristoph Hellwig#
267fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
268c30700dbSChristoph Hellwig	bool
269c30700dbSChristoph Hellwig
270999a5d12SChristoph Hellwig#
271999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
272999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
273999a5d12SChristoph Hellwig#
274999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
275f5e10287SThomas Gleixner	bool
276f5e10287SThomas Gleixner
2775905429aSKees Cook# Select if arch init_task must go in the __init_task_data section
2785905429aSKees Cookconfig ARCH_TASK_STRUCT_ON_STACK
2795905429aSKees Cook	bool
2805905429aSKees Cook
2815905429aSKees Cook# Select if arch has its private alloc_task_struct() function
2825905429aSKees Cookconfig ARCH_TASK_STRUCT_ALLOCATOR
2835905429aSKees Cook	bool
2845905429aSKees Cook
2855905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
2865905429aSKees Cook	bool
2875905429aSKees Cook	depends on !ARCH_TASK_STRUCT_ALLOCATOR
288b235beeaSLinus Torvalds	help
289b235beeaSLinus Torvalds	  An architecture should select this to provide hardened usercopy
290f5e10287SThomas Gleixner	  knowledge about what region of the thread_struct should be
291f5e10287SThomas Gleixner	  whitelisted for copying to userspace. Normally this is only the
2925aaeb5c0SIngo Molnar	  FPU registers. Specifically, arch_thread_struct_whitelist()
2935aaeb5c0SIngo Molnar	  should be implemented. Without this, the entire thread_struct
2945aaeb5c0SIngo Molnar	  field in task_struct will be left whitelisted.
2955aaeb5c0SIngo Molnar
296942fa985SYury Norov# Select if arch has its private alloc_thread_stack() function
297942fa985SYury Norovconfig ARCH_THREAD_STACK_ALLOCATOR
298942fa985SYury Norov	bool
299942fa985SYury Norov
300942fa985SYury Norov# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
301942fa985SYury Norovconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
302942fa985SYury Norov	bool
303942fa985SYury Norov
304942fa985SYury Norovconfig ARCH_32BIT_OFF_T
305942fa985SYury Norov	bool
306f850c30cSHeiko Carstens	depends on !64BIT
307f850c30cSHeiko Carstens	help
308e01292b1SHeiko Carstens	  All new 32-bit architectures should have 64-bit off_t type on
309e01292b1SHeiko Carstens	  userspace side which corresponds to the loff_t kernel type. This
310e01292b1SHeiko Carstens	  is the requirement for modern ABIs. Some existing architectures
311e01292b1SHeiko Carstens	  still support 32-bit off_t. This option is enabled for all such
312e01292b1SHeiko Carstens	  architectures explicitly.
313f850c30cSHeiko Carstens
3142ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3152ff2b7ecSMasahiro Yamada	bool
3162ff2b7ecSMasahiro Yamada	help
3172ff2b7ecSMasahiro Yamada	  This symbol should be selected by an architecure if it provides
3182ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3192ff2b7ecSMasahiro Yamada	  exported from assembly code.
3202ff2b7ecSMasahiro Yamada
3219483a578SDavid Brownellconfig HAVE_REGS_AND_STACK_ACCESS_API
3229ba16087SJan Beulich	bool
3239483a578SDavid Brownell	help
3249483a578SDavid Brownell	  This symbol should be selected by an architecure if it supports
3259483a578SDavid Brownell	  the API needed to access registers and stack entries from pt_regs,
3269483a578SDavid Brownell	  declared in asm/ptrace.h
3275ee00bd4SJoerg Roedel	  For example the kprobes-based event tracer needs this API.
3285ee00bd4SJoerg Roedel
329d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
330d7822b1eSMathieu Desnoyers	bool
331d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
332d7822b1eSMathieu Desnoyers	help
333d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
334d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
335d7822b1eSMathieu Desnoyers
3363c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3373c88ee19SMasami Hiramatsu	bool
3383c88ee19SMasami Hiramatsu	help
3393c88ee19SMasami Hiramatsu	  This symbol should be selected by an architecure if it supports
3403c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3413c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3423c88ee19SMasami Hiramatsu
34362a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
34462a038d3SK.Prasad	bool
34599e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
34662a038d3SK.Prasad
3470102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
3480102752eSFrederic Weisbecker	bool
3490102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
3500102752eSFrederic Weisbecker	help
3510102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
3520102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
3530102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
3540102752eSFrederic Weisbecker	  them but define the access type in a control register.
3550102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3560102752eSFrederic Weisbecker	  latter fashion.
3570102752eSFrederic Weisbecker
3587c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3597c68af6eSAvi Kivity	bool
360a1922ed6SIngo Molnar
361c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
362c01d4323SFrederic Weisbecker	bool
36323637d47SFrederic Weisbecker	help
36423637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
36523637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
36623637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
367c01d4323SFrederic Weisbecker
36805a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
36905a4a952SNicholas Piggin	bool
37005a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
37105a4a952SNicholas Piggin	help
37205a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
37305a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
37405a4a952SNicholas Piggin
37505a4a952SNicholas Pigginconfig HAVE_NMI_WATCHDOG
37605a4a952SNicholas Piggin	depends on HAVE_NMI
37705a4a952SNicholas Piggin	bool
37805a4a952SNicholas Piggin	help
37905a4a952SNicholas Piggin	  The arch provides a low level NMI watchdog. It provides
38005a4a952SNicholas Piggin	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
38105a4a952SNicholas Piggin
38205a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
38305a4a952SNicholas Piggin	bool
38405a4a952SNicholas Piggin	select HAVE_NMI_WATCHDOG
38505a4a952SNicholas Piggin	help
38605a4a952SNicholas Piggin	  The arch chooses to provide its own hardlockup detector, which is
38705a4a952SNicholas Piggin	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
38805a4a952SNicholas Piggin	  interfaces and parameters provided by hardlockup detector subsystem.
38905a4a952SNicholas Piggin
390c5e63197SJiri Olsaconfig HAVE_PERF_REGS
391c5e63197SJiri Olsa	bool
392c5e63197SJiri Olsa	help
393c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
394c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
395c5e63197SJiri Olsa
396c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
397c5ebcedbSJiri Olsa	bool
398c5ebcedbSJiri Olsa	help
399c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
400c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
401c5ebcedbSJiri Olsa	  architectures.
402c5ebcedbSJiri Olsa
403bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
404bf5438fcSJason Baron	bool
405bf5438fcSJason Baron
40650ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
40750ff18abSArd Biesheuvel	bool
40850ff18abSArd Biesheuvel
4090d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4100d6e24d4SPeter Zijlstra	bool
4110d6e24d4SPeter Zijlstra
412ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
41326723911SPeter Zijlstra	bool
4140d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
41526723911SPeter Zijlstra
4163af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
417ed6a7935SPeter Zijlstra	bool
418ed6a7935SPeter Zijlstra
41927796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
42027796d03SPeter Zijlstra	bool
42127796d03SPeter Zijlstra
422580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
423952a31c9SMartin Schwidefsky	bool
4240d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
425952a31c9SMartin Schwidefsky
426d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
427d53c3dfbSNicholas Piggin	bool
428d53c3dfbSNicholas Piggin	help
429d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
430d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
431d53c3dfbSNicholas Piggin	  shootdowns should enable this.
432d53c3dfbSNicholas Piggin
433df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
434df013ffbSHuang Ying	bool
435df013ffbSHuang Ying
43643570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
43743570fd2SHeiko Carstens	bool
43843570fd2SHeiko Carstens	help
43943570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
44043570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
44143570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
44243570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
44343570fd2SHeiko Carstens
4444156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
4454156153cSHeiko Carstens	bool
4464156153cSHeiko Carstens
4472565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
4482565409fSHeiko Carstens	bool
4492565409fSHeiko Carstens
45077e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
45177e58496SPaul E. McKenney	bool
45277e58496SPaul E. McKenney
453c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
454c1d7e01dSWill Deacon	bool
455c1d7e01dSWill Deacon
456c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
457c1d7e01dSWill Deacon	bool
458c1d7e01dSWill Deacon
45948b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
460c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
46148b25c43SChris Metcalf	bool
46248b25c43SChris Metcalf
463282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
464e2cfabdfSWill Drewry	bool
465e2cfabdfSWill Drewry	help
466282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
467282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
468282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
469282a181bSYiFei Zhu	  - __NR_seccomp_read_32
470282a181bSYiFei Zhu	  - __NR_seccomp_write_32
471282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
472282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
473282a181bSYiFei Zhu
474282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
475282a181bSYiFei Zhu	bool
476282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
477282a181bSYiFei Zhu	help
478fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
479282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
480bb6ea430SWill Drewry	  - syscall_get_arch()
481bb6ea430SWill Drewry	  - syscall_get_arguments()
482bb6ea430SWill Drewry	  - syscall_rollback()
483bb6ea430SWill Drewry	  - syscall_set_return_value()
484fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
485fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
486fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
487fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
48848dc92b9SKees Cook	  - seccomp syscall wired up
489e2cfabdfSWill Drewry
490282a181bSYiFei Zhuconfig SECCOMP
491282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
492282a181bSYiFei Zhu	def_bool y
493282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
494282a181bSYiFei Zhu	help
495282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
496282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
497282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
498282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
499282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
500282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
501282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
502282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
503282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
504282a181bSYiFei Zhu
505282a181bSYiFei Zhu	  If unsure, say Y.
506282a181bSYiFei Zhu
507e2cfabdfSWill Drewryconfig SECCOMP_FILTER
508e2cfabdfSWill Drewry	def_bool y
509e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
510e2cfabdfSWill Drewry	help
511e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
512e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
513e2cfabdfSWill Drewry	  task-defined system call filtering polices.
514e2cfabdfSWill Drewry
5155fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
516e2cfabdfSWill Drewry
517afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
518afaef01cSAlexander Popov	bool
519afaef01cSAlexander Popov	help
520afaef01cSAlexander Popov	  An architecture should select this if it has the code which
521afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
522afaef01cSAlexander Popov	  value before returning from system calls.
523afaef01cSAlexander Popov
524d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
52519952a92SKees Cook	bool
52619952a92SKees Cook	help
52719952a92SKees Cook	  An arch should select this symbol if:
52819952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
52919952a92SKees Cook
530050e9baaSLinus Torvaldsconfig STACKPROTECTOR
5312a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
532d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
5332a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
5342a61f474SMasahiro Yamada	default y
5358779657dSKees Cook	help
5368779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
53719952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
53819952a92SKees Cook	  the stack just before the return address, and validates
53919952a92SKees Cook	  the value just before actually returning.  Stack based buffer
54019952a92SKees Cook	  overflows (that need to overwrite this return address) now also
54119952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
54219952a92SKees Cook	  neutralized via a kernel panic.
54319952a92SKees Cook
5448779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
5458779657dSKees Cook	  have an 8-byte or larger character array on the stack.
5468779657dSKees Cook
54719952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
5488779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
5498779657dSKees Cook
5508779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5518779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
5528779657dSKees Cook	  by about 0.3%.
5538779657dSKees Cook
554050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
5552a61f474SMasahiro Yamada	bool "Strong Stack Protector"
556050e9baaSLinus Torvalds	depends on STACKPROTECTOR
5572a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
5582a61f474SMasahiro Yamada	default y
5598779657dSKees Cook	help
5608779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
5618779657dSKees Cook	  of the following conditions:
5628779657dSKees Cook
5638779657dSKees Cook	  - local variable's address used as part of the right hand side of an
5648779657dSKees Cook	    assignment or function argument
5658779657dSKees Cook	  - local variable is an array (or union containing an array),
5668779657dSKees Cook	    regardless of array type or length
5678779657dSKees Cook	  - uses register local variables
5688779657dSKees Cook
5698779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
5708779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
5718779657dSKees Cook
5728779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5738779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
5748779657dSKees Cook	  size by about 2%.
5758779657dSKees Cook
576d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
577d08b9f0cSSami Tolvanen	bool
578d08b9f0cSSami Tolvanen	help
579d08b9f0cSSami Tolvanen	  An architecture should select this if it supports Clang's Shadow
580aa7a65aeSWill Deacon	  Call Stack and implements runtime support for shadow stack
581aa7a65aeSWill Deacon	  switching.
582d08b9f0cSSami Tolvanen
583d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
584d08b9f0cSSami Tolvanen	bool "Clang Shadow Call Stack"
585d08b9f0cSSami Tolvanen	depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK
586ddc9863eSSami Tolvanen	depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
587d08b9f0cSSami Tolvanen	help
588d08b9f0cSSami Tolvanen	  This option enables Clang's Shadow Call Stack, which uses a
589d08b9f0cSSami Tolvanen	  shadow stack to protect function return addresses from being
590d08b9f0cSSami Tolvanen	  overwritten by an attacker. More information can be found in
591d08b9f0cSSami Tolvanen	  Clang's documentation:
592d08b9f0cSSami Tolvanen
593d08b9f0cSSami Tolvanen	    https://clang.llvm.org/docs/ShadowCallStack.html
594d08b9f0cSSami Tolvanen
595d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
596d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
597d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
598d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
599d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
600d08b9f0cSSami Tolvanen
6010f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
6020f60a8efSKees Cook	bool
6030f60a8efSKees Cook	help
6040f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
6050f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
6060f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
6070f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
6080f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
6090f60a8efSKees Cook
61091d1aa43SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING
6112b1d5024SFrederic Weisbecker	bool
6122b1d5024SFrederic Weisbecker	help
61391d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
61491d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
615490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
616490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
617490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
618490f561bSFrederic Weisbecker	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
619490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
620490f561bSFrederic Weisbecker
621*83c2da2eSFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_OFFSTACK
622*83c2da2eSFrederic Weisbecker	bool
623*83c2da2eSFrederic Weisbecker	help
624*83c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
625*83c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
626*83c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
627*83c2da2eSFrederic Weisbecker	  while context tracking is CONTEXT_USER. This feature reflects a sane
628*83c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
629*83c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
630*83c2da2eSFrederic Weisbecker
631*83c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
632*83c2da2eSFrederic Weisbecker	    not interruptible).
633*83c2da2eSFrederic Weisbecker	  - No use of RCU read side critical sections, unless rcu_nmi_enter()
634*83c2da2eSFrederic Weisbecker	    got called.
635*83c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
636*83c2da2eSFrederic Weisbecker	    called.
637*83c2da2eSFrederic Weisbecker
638490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
639490f561bSFrederic Weisbecker	bool
640490f561bSFrederic Weisbecker	help
641490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
642490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
6432b1d5024SFrederic Weisbecker
644b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
645b952741cSFrederic Weisbecker	bool
646b952741cSFrederic Weisbecker
64740565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
64840565b5aSStanislaw Gruszka	bool
64940565b5aSStanislaw Gruszka
650554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
651554b0004SKevin Hilman	bool
652554b0004SKevin Hilman	default y if 64BIT
653554b0004SKevin Hilman	help
654554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
655554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
656554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
657554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
658554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
659554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
660554b0004SKevin Hilman
661554b0004SKevin Hilman
662fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
663fdf9c356SFrederic Weisbecker	bool
664fdf9c356SFrederic Weisbecker	help
665fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
666fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
667fdf9c356SFrederic Weisbecker
6682c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
6692c91bd4aSJoel Fernandes (Google)	bool
6702c91bd4aSJoel Fernandes (Google)	help
6712c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
6722c91bd4aSJoel Fernandes (Google)
67315626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
67415626062SGerald Schaefer	bool
67515626062SGerald Schaefer
676a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
677a00cc7d9SMatthew Wilcox	bool
678a00cc7d9SMatthew Wilcox
6790ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
6800ddab1d2SToshi Kani	bool
6810ddab1d2SToshi Kani
6823876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
6833876d4a3SAlexandre Ghiti	bool
6843876d4a3SAlexandre Ghiti
6850f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
6860f8975ecSPavel Emelyanov	bool
6870f8975ecSPavel Emelyanov
688786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
689786d35d4SDavid Howells	bool
690786d35d4SDavid Howells	help
691786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
692786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
693786d35d4SDavid Howells	  should not enable this.
694786d35d4SDavid Howells
695786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
696786d35d4SDavid Howells	bool
697786d35d4SDavid Howells	help
698786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
699786d35d4SDavid Howells	  relocations will give an error.
700786d35d4SDavid Howells
701786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
702786d35d4SDavid Howells	bool
703786d35d4SDavid Howells	help
704786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
705786d35d4SDavid Howells	  relocations will give an error.
706786d35d4SDavid Howells
707cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
708cc1f0274SFrederic Weisbecker	bool
709cc1f0274SFrederic Weisbecker	help
710cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
711cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
712cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
713cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
714cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
715cc1f0274SFrederic Weisbecker	  processing.
716cc1f0274SFrederic Weisbecker
717235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
718235a8f02SKirill A. Shutemov	int
719235a8f02SKirill A. Shutemov	default 2
720235a8f02SKirill A. Shutemov
7212b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
7222b68f6caSKees Cook	bool
7232b68f6caSKees Cook	help
7242b68f6caSKees Cook	  An architecture supports choosing randomized locations for
7252b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
7262b68f6caSKees Cook	  - arch_mmap_rnd()
727204db6edSKees Cook	  - arch_randomize_brk()
7282b68f6caSKees Cook
729d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
730d07e2259SDaniel Cashman	bool
731d07e2259SDaniel Cashman	help
732d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
733d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
734d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
735d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
736d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
737d07e2259SDaniel Cashman
7385f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
7395f56a5dfSJiri Slaby	bool
7405f56a5dfSJiri Slaby	help
7415f56a5dfSJiri Slaby	  An architecture implements exit_thread.
7425f56a5dfSJiri Slaby
743d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
744d07e2259SDaniel Cashman	int
745d07e2259SDaniel Cashman
746d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
747d07e2259SDaniel Cashman	int
748d07e2259SDaniel Cashman
749d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
750d07e2259SDaniel Cashman	int
751d07e2259SDaniel Cashman
752d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
753d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
754d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
755d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
756d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
757d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
758d07e2259SDaniel Cashman	help
759d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
760d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
761d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
762d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
763d07e2259SDaniel Cashman
764d07e2259SDaniel Cashman	  This value can be changed after boot using the
765d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
766d07e2259SDaniel Cashman
767d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
768d07e2259SDaniel Cashman	bool
769d07e2259SDaniel Cashman	help
770d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
771d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
772d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
773d07e2259SDaniel Cashman	  enabled and provides values for both:
774d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
775d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
776d07e2259SDaniel Cashman
777d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
778d07e2259SDaniel Cashman	int
779d07e2259SDaniel Cashman
780d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
781d07e2259SDaniel Cashman	int
782d07e2259SDaniel Cashman
783d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
784d07e2259SDaniel Cashman	int
785d07e2259SDaniel Cashman
786d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
787d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
788d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
789d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
790d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
791d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
792d07e2259SDaniel Cashman	help
793d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
794d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
795d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
796d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
797d07e2259SDaniel Cashman	  supported values.
798d07e2259SDaniel Cashman
799d07e2259SDaniel Cashman	  This value can be changed after boot using the
800d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
801d07e2259SDaniel Cashman
8021b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
8031b028f78SDmitry Safonov	bool
8041b028f78SDmitry Safonov	help
8051b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
8061b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
8071b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
8081b028f78SDmitry Safonov
80967f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
81067f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
81167f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
81267f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
81367f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
81467f3977fSAlexandre Ghiti# - STACK_RND_MASK
81567f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
81667f3977fSAlexandre Ghiti	bool
81767f3977fSAlexandre Ghiti	depends on MMU
818e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
81967f3977fSAlexandre Ghiti
820b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
821b9ab5ebbSJosh Poimboeuf	bool
822b9ab5ebbSJosh Poimboeuf	help
823b9ab5ebbSJosh Poimboeuf	  Architecture supports the 'objtool check' host tool command, which
824b9ab5ebbSJosh Poimboeuf	  performs compile-time stack metadata validation.
825b9ab5ebbSJosh Poimboeuf
826af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
827af085d90SJosh Poimboeuf	bool
828af085d90SJosh Poimboeuf	help
829140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
830140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
831140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
832af085d90SJosh Poimboeuf
833468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
834468a9428SGeorge Spelvin	bool
835468a9428SGeorge Spelvin	default n
836468a9428SGeorge Spelvin	help
837468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
838468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
839468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
840468a9428SGeorge Spelvin
841666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
842666047feSFinn Thain	bool
843666047feSFinn Thain
8443a495511SWilliam Breathitt Grayconfig ISA_BUS_API
8453a495511SWilliam Breathitt Gray	def_bool ISA
8463a495511SWilliam Breathitt Gray
847d2125043SAl Viro#
848d2125043SAl Viro# ABI hall of shame
849d2125043SAl Viro#
850d2125043SAl Viroconfig CLONE_BACKWARDS
851d2125043SAl Viro	bool
852d2125043SAl Viro	help
853d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
854d2125043SAl Viro	  not the 5th one.
855d2125043SAl Viro
856d2125043SAl Viroconfig CLONE_BACKWARDS2
857d2125043SAl Viro	bool
858d2125043SAl Viro	help
859d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
860d2125043SAl Viro
861dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
862dfa9771aSMichal Simek	bool
863dfa9771aSMichal Simek	help
864dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
865dfa9771aSMichal Simek	  not the 5th one.
866dfa9771aSMichal Simek
867eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
868eaca6eaeSAl Viro	bool
869eaca6eaeSAl Viro	help
870eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
871eaca6eaeSAl Viro
8720a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
8730a0e8cdfSAl Viro	bool
8740a0e8cdfSAl Viro	help
8750a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
8760a0e8cdfSAl Viro
8770a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
8780a0e8cdfSAl Viro	bool
8790a0e8cdfSAl Viro	help
8800a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
8810a0e8cdfSAl Viro
882495dfbf7SAl Viroconfig OLD_SIGACTION
883495dfbf7SAl Viro	bool
884495dfbf7SAl Viro	help
885495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
886495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
887495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
888495dfbf7SAl Viro	  compatibility...
889495dfbf7SAl Viro
890495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
891495dfbf7SAl Viro	bool
892495dfbf7SAl Viro
89317435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
894942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
895942437c9SArnd Bergmann	default !64BIT || COMPAT
89617435e5fSDeepa Dinamani	help
89717435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
89817435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
89917435e5fSDeepa Dinamani	  as part of compat syscall handling.
90017435e5fSDeepa Dinamani
90187a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
90287a4c375SChristoph Hellwig	bool
90387a4c375SChristoph Hellwig
904a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
905a50a3f4bSThomas Gleixner	bool
906a50a3f4bSThomas Gleixner
907fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
908fff7fb0bSZhaoxiu Zeng	def_bool n
909fff7fb0bSZhaoxiu Zeng
910ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
911ba14a194SAndy Lutomirski	def_bool n
912ba14a194SAndy Lutomirski	help
913ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
914ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
915ba14a194SAndy Lutomirski
916ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
917ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
918ba14a194SAndy Lutomirski
919ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
920ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
921ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
922ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
923ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
924ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
925ba14a194SAndy Lutomirski
926ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
927ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
928ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
929ba14a194SAndy Lutomirski
930ba14a194SAndy Lutomirskiconfig VMAP_STACK
931ba14a194SAndy Lutomirski	default y
932ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
933eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
934eafb149eSDaniel Axtens	depends on !KASAN || KASAN_VMALLOC
935a7f7f624SMasahiro Yamada	help
936ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
937ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
938ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
939ba14a194SAndy Lutomirski	  corruption.
940ba14a194SAndy Lutomirski
941eafb149eSDaniel Axtens	  To use this with KASAN, the architecture must support backing
942eafb149eSDaniel Axtens	  virtual mappings with real shadow memory, and KASAN_VMALLOC must
943eafb149eSDaniel Axtens	  be enabled.
944ba14a194SAndy Lutomirski
945ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
946ad21fc4fSLaura Abbott	def_bool n
947ad21fc4fSLaura Abbott
948ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
949ad21fc4fSLaura Abbott	def_bool n
950ad21fc4fSLaura Abbott
951ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
952ad21fc4fSLaura Abbott	def_bool n
953ad21fc4fSLaura Abbott
9540f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
955ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
956ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
957ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
958ad21fc4fSLaura Abbott	help
959ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
960ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
961ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
962ad21fc4fSLaura Abbott	  or modifying text)
963ad21fc4fSLaura Abbott
964ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
965ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
966ad21fc4fSLaura Abbott
967ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
968ad21fc4fSLaura Abbott	def_bool n
969ad21fc4fSLaura Abbott
9700f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
971ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
972ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
973ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
974ad21fc4fSLaura Abbott	help
975ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
976ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
977ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
978ad21fc4fSLaura Abbott
979ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
980ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
981ea8c64acSChristoph Hellwig	bool
982ea8c64acSChristoph Hellwig
98304f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
98404f264d3SPaul Burton	bool
98504f264d3SPaul Burton	help
98604f264d3SPaul Burton	  An architecture can select this if it provides an
98704f264d3SPaul Burton	  asm/compiler.h header that should be included after
98804f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
98904f264d3SPaul Burton	  headers generally provide.
99004f264d3SPaul Burton
991271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
992271ca788SArd Biesheuvel	bool
993271ca788SArd Biesheuvel	help
994271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
995271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
996271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
997271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
998271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
999271ca788SArd Biesheuvel	  kernels.
1000271ca788SArd Biesheuvel
1001ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1002ce9084baSArd Biesheuvel	bool
1003ce9084baSArd Biesheuvel
1004fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1005fb346fd9SWaiman Long	bool "Locking event counts collection"
1006fb346fd9SWaiman Long	depends on DEBUG_FS
1007a7f7f624SMasahiro Yamada	help
1008fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1009fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1010fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1011fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1012fb346fd9SWaiman Long
10135cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
10145cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
10155cf896fbSPeter Collingbourne	bool
10165cf896fbSPeter Collingbourne
10175cf896fbSPeter Collingbourneconfig RELR
10185cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
10195cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
10205cf896fbSPeter Collingbourne	default y
10215cf896fbSPeter Collingbourne	help
10225cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
10235cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
10245cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
10255cf896fbSPeter Collingbourne	  are compatible).
10265cf896fbSPeter Collingbourne
10270c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
10280c9c1d56SThiago Jung Bauermann	bool
10290c9c1d56SThiago Jung Bauermann
10300e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
10310e242208SHassan Naveed       bool
10320e242208SHassan Naveed       help
10330e242208SHassan Naveed          An architecture should select this if its syscall numbering is sparse
10340e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
10350e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
10360e242208SHassan Naveed	  related optimizations for a given architecture.
10370e242208SHassan Naveed
1038d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1039d60d7de3SSven Schnelle	bool
1040d60d7de3SSven Schnelle
1041115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1042115284d8SJosh Poimboeuf	bool
1043115284d8SJosh Poimboeuf
10449183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
10459183c3f9SJosh Poimboeuf	bool
10469183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
10479183c3f9SJosh Poimboeuf
10482521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
104945332b1bSMasahiro Yamada
105045332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1051fa1b5d09SLinus Torvalds
105222471e13SRandy Dunlapendmenu
1053