xref: /linux/arch/Kconfig (revision 5fb94e9ca333f0fe1d96de06704a79942b3832c3)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2fb32e03fSMathieu Desnoyers#
3fb32e03fSMathieu Desnoyers# General architecture dependent options
4fb32e03fSMathieu Desnoyers#
5125e5645SMathieu Desnoyers
6692f66f2SHari Bathiniconfig CRASH_CORE
7692f66f2SHari Bathini	bool
8692f66f2SHari Bathini
92965faa5SDave Youngconfig KEXEC_CORE
10692f66f2SHari Bathini	select CRASH_CORE
112965faa5SDave Young	bool
122965faa5SDave Young
13467d2782SThiago Jung Bauermannconfig HAVE_IMA_KEXEC
14467d2782SThiago Jung Bauermann	bool
15467d2782SThiago Jung Bauermann
16125e5645SMathieu Desnoyersconfig OPROFILE
17b309a294SRobert Richter	tristate "OProfile system profiling"
18125e5645SMathieu Desnoyers	depends on PROFILING
19125e5645SMathieu Desnoyers	depends on HAVE_OPROFILE
20d69d59f4SIngo Molnar	select RING_BUFFER
219a5963ebSChristian Borntraeger	select RING_BUFFER_ALLOW_SWAP
22125e5645SMathieu Desnoyers	help
23125e5645SMathieu Desnoyers	  OProfile is a profiling system capable of profiling the
24125e5645SMathieu Desnoyers	  whole system, include the kernel, kernel modules, libraries,
25125e5645SMathieu Desnoyers	  and applications.
26125e5645SMathieu Desnoyers
27125e5645SMathieu Desnoyers	  If unsure, say N.
28125e5645SMathieu Desnoyers
294d4036e0SJason Yehconfig OPROFILE_EVENT_MULTIPLEX
304d4036e0SJason Yeh	bool "OProfile multiplexing support (EXPERIMENTAL)"
314d4036e0SJason Yeh	default n
324d4036e0SJason Yeh	depends on OPROFILE && X86
334d4036e0SJason Yeh	help
344d4036e0SJason Yeh	  The number of hardware counters is limited. The multiplexing
354d4036e0SJason Yeh	  feature enables OProfile to gather more events than counters
364d4036e0SJason Yeh	  are provided by the hardware. This is realized by switching
379332ef9dSMasahiro Yamada	  between events at a user specified time interval.
384d4036e0SJason Yeh
394d4036e0SJason Yeh	  If unsure, say N.
404d4036e0SJason Yeh
41125e5645SMathieu Desnoyersconfig HAVE_OPROFILE
429ba16087SJan Beulich	bool
43125e5645SMathieu Desnoyers
44dcfce4a0SRobert Richterconfig OPROFILE_NMI_TIMER
45dcfce4a0SRobert Richter	def_bool y
46af9feebeSAnton Blanchard	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
47dcfce4a0SRobert Richter
48125e5645SMathieu Desnoyersconfig KPROBES
49125e5645SMathieu Desnoyers	bool "Kprobes"
5005ed160eSMasami Hiramatsu	depends on MODULES
51125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
5205ed160eSMasami Hiramatsu	select KALLSYMS
53125e5645SMathieu Desnoyers	help
54125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
55125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
56125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
57125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
58125e5645SMathieu Desnoyers	  If in doubt, say "N".
59125e5645SMathieu Desnoyers
6045f81b1cSSteven Rostedtconfig JUMP_LABEL
61c5905afbSIngo Molnar       bool "Optimize very unlikely/likely branches"
6245f81b1cSSteven Rostedt       depends on HAVE_ARCH_JUMP_LABEL
6345f81b1cSSteven Rostedt       help
64c5905afbSIngo Molnar         This option enables a transparent branch optimization that
65c5905afbSIngo Molnar	 makes certain almost-always-true or almost-always-false branch
66c5905afbSIngo Molnar	 conditions even cheaper to execute within the kernel.
6745f81b1cSSteven Rostedt
68c5905afbSIngo Molnar	 Certain performance-sensitive kernel code, such as trace points,
69c5905afbSIngo Molnar	 scheduler functionality, networking code and KVM have such
70c5905afbSIngo Molnar	 branches and include support for this optimization technique.
71c5905afbSIngo Molnar
72c5905afbSIngo Molnar         If it is detected that the compiler has support for "asm goto",
73c5905afbSIngo Molnar	 the kernel will compile such branches with just a nop
74c5905afbSIngo Molnar	 instruction. When the condition flag is toggled to true, the
75c5905afbSIngo Molnar	 nop will be converted to a jump instruction to execute the
76c5905afbSIngo Molnar	 conditional block of instructions.
77c5905afbSIngo Molnar
78c5905afbSIngo Molnar	 This technique lowers overhead and stress on the branch prediction
79c5905afbSIngo Molnar	 of the processor and generally makes the kernel faster. The update
80c5905afbSIngo Molnar	 of the condition is slower, but those are always very rare.
81c5905afbSIngo Molnar
82c5905afbSIngo Molnar	 ( On 32-bit x86, the necessary options added to the compiler
83c5905afbSIngo Molnar	   flags may increase the size of the kernel slightly. )
8445f81b1cSSteven Rostedt
851987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
861987c947SPeter Zijlstra	bool "Static key selftest"
871987c947SPeter Zijlstra	depends on JUMP_LABEL
881987c947SPeter Zijlstra	help
891987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
901987c947SPeter Zijlstra
91afd66255SMasami Hiramatsuconfig OPTPROBES
925cc718b9SMasami Hiramatsu	def_bool y
935cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
94a30b85dfSMasami Hiramatsu	select TASKS_RCU if PREEMPT
95afd66255SMasami Hiramatsu
96e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
97e7dbfe34SMasami Hiramatsu	def_bool y
98e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
99e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
100e7dbfe34SMasami Hiramatsu	help
101e7dbfe34SMasami Hiramatsu	 If function tracer is enabled and the arch supports full
102e7dbfe34SMasami Hiramatsu	 passing of pt_regs to function tracing, then kprobes can
103e7dbfe34SMasami Hiramatsu	 optimize on top of function tracing.
104e7dbfe34SMasami Hiramatsu
1052b144498SSrikar Dronamrajuconfig UPROBES
10609294e31SDavid A. Long	def_bool n
107e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1082b144498SSrikar Dronamraju	help
1097b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1107b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1117b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1127b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1137b2d81d4SIngo Molnar	  are hit by user-space applications.
1147b2d81d4SIngo Molnar
1157b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1167b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1177b2d81d4SIngo Molnar	    application. )
1182b144498SSrikar Dronamraju
119c19fa94aSJames Hoganconfig HAVE_64BIT_ALIGNED_ACCESS
120c19fa94aSJames Hogan	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
121c19fa94aSJames Hogan	help
122c19fa94aSJames Hogan	  Some architectures require 64 bit accesses to be 64 bit
123c19fa94aSJames Hogan	  aligned, which also requires structs containing 64 bit values
124c19fa94aSJames Hogan	  to be 64 bit aligned too. This includes some 32 bit
125c19fa94aSJames Hogan	  architectures which can do 64 bit accesses, as well as 64 bit
126c19fa94aSJames Hogan	  architectures without unaligned access.
127c19fa94aSJames Hogan
128c19fa94aSJames Hogan	  This symbol should be selected by an architecture if 64 bit
129c19fa94aSJames Hogan	  accesses are required to be 64 bit aligned in this way even
130c19fa94aSJames Hogan	  though it is not a 64 bit architecture.
131c19fa94aSJames Hogan
132c19fa94aSJames Hogan	  See Documentation/unaligned-memory-access.txt for more
133c19fa94aSJames Hogan	  information on the topic of unaligned memory accesses.
134c19fa94aSJames Hogan
13558340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1369ba16087SJan Beulich	bool
13758340a07SJohannes Berg	help
13858340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
13958340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
14058340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
14158340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
14258340a07SJohannes Berg	  handler.)
14358340a07SJohannes Berg
14458340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
14558340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
14658340a07SJohannes Berg	  code paths to be selected for these cases. Some network
14758340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
14858340a07SJohannes Berg	  problems with received packets if doing so would not help
14958340a07SJohannes Berg	  much.
15058340a07SJohannes Berg
15158340a07SJohannes Berg	  See Documentation/unaligned-memory-access.txt for more
15258340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
15358340a07SJohannes Berg
154cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
155cf66bb93SDavid Woodhouse       bool
156cf66bb93SDavid Woodhouse       help
157cf66bb93SDavid Woodhouse	 Modern versions of GCC (since 4.4) have builtin functions
158cf66bb93SDavid Woodhouse	 for handling byte-swapping. Using these, instead of the old
159cf66bb93SDavid Woodhouse	 inline assembler that the architecture code provides in the
160cf66bb93SDavid Woodhouse	 __arch_bswapXX() macros, allows the compiler to see what's
161cf66bb93SDavid Woodhouse	 happening and offers more opportunity for optimisation. In
162cf66bb93SDavid Woodhouse	 particular, the compiler will be able to combine the byteswap
163cf66bb93SDavid Woodhouse	 with a nearby load or store and use load-and-swap or
164cf66bb93SDavid Woodhouse	 store-and-swap instructions if the architecture has them. It
165cf66bb93SDavid Woodhouse	 should almost *never* result in code which is worse than the
166cf66bb93SDavid Woodhouse	 hand-coded assembler in <asm/swab.h>.  But just in case it
167cf66bb93SDavid Woodhouse	 does, the use of the builtins is optional.
168cf66bb93SDavid Woodhouse
169cf66bb93SDavid Woodhouse	 Any architecture with load-and-swap or store-and-swap
170cf66bb93SDavid Woodhouse	 instructions should set this. And it shouldn't hurt to set it
171cf66bb93SDavid Woodhouse	 on architectures that don't have such instructions.
172cf66bb93SDavid Woodhouse
1739edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
1749edddaa2SAnanth N Mavinakayanahalli	def_bool y
1759edddaa2SAnanth N Mavinakayanahalli	depends on KPROBES && HAVE_KRETPROBES
1769edddaa2SAnanth N Mavinakayanahalli
1777c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
1787c68af6eSAvi Kivity	bool
1797c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
1807c68af6eSAvi Kivity	help
1817c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
1827c68af6eSAvi Kivity	  switch to user mode.
1837c68af6eSAvi Kivity
18428b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
1859ba16087SJan Beulich	bool
18628b2ee20SRik van Riel
187125e5645SMathieu Desnoyersconfig HAVE_KPROBES
1889ba16087SJan Beulich	bool
1899edddaa2SAnanth N Mavinakayanahalli
1909edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
1919ba16087SJan Beulich	bool
19274bc7ceeSArthur Kepner
193afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
194afd66255SMasami Hiramatsu	bool
195d314d74cSCong Wang
196e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
197e7dbfe34SMasami Hiramatsu	bool
198e7dbfe34SMasami Hiramatsu
199540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2009802d865SJosef Bacik	bool
2019802d865SJosef Bacik
20242a0bb3fSPetr Mladekconfig HAVE_NMI
20342a0bb3fSPetr Mladek	bool
20442a0bb3fSPetr Mladek
2051f5a4ad9SRoland McGrath#
2061f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2071f5a4ad9SRoland McGrath#
2081f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2091f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2101f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2111f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2121f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2131f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
2141f5a4ad9SRoland McGrath#	TIF_SYSCALL_TRACE	calls tracehook_report_syscall_{entry,exit}
2151f5a4ad9SRoland McGrath#	TIF_NOTIFY_RESUME	calls tracehook_notify_resume()
2161f5a4ad9SRoland McGrath#	signal delivery		calls tracehook_signal_handler()
2171f5a4ad9SRoland McGrath#
2181f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2199ba16087SJan Beulich	bool
2201f5a4ad9SRoland McGrath
221c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
222c64be2bbSMarek Szyprowski	bool
223c64be2bbSMarek Szyprowski
22429d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
22529d5e047SThomas Gleixner       bool
22629d5e047SThomas Gleixner
227485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
228485cf5daSKevin Hilman       bool
229485cf5daSKevin Hilman
2306974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2316974f0c4SDaniel Micay	bool
2326974f0c4SDaniel Micay	help
2336974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2346974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2356974f0c4SDaniel Micay
236d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
237d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
238d2852a22SDaniel Borkmann	bool
239d2852a22SDaniel Borkmann
2400500871fSDavid Howells# Select if arch init_task must go in the __init_task_data section
2410500871fSDavid Howellsconfig ARCH_TASK_STRUCT_ON_STACK
242a4a2eb49SThomas Gleixner       bool
243a4a2eb49SThomas Gleixner
244f5e10287SThomas Gleixner# Select if arch has its private alloc_task_struct() function
245f5e10287SThomas Gleixnerconfig ARCH_TASK_STRUCT_ALLOCATOR
246f5e10287SThomas Gleixner	bool
247f5e10287SThomas Gleixner
2485905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
2495905429aSKees Cook	bool
2505905429aSKees Cook	depends on !ARCH_TASK_STRUCT_ALLOCATOR
2515905429aSKees Cook	help
2525905429aSKees Cook	  An architecture should select this to provide hardened usercopy
2535905429aSKees Cook	  knowledge about what region of the thread_struct should be
2545905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
2555905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
2565905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
2575905429aSKees Cook	  field in task_struct will be left whitelisted.
2585905429aSKees Cook
259b235beeaSLinus Torvalds# Select if arch has its private alloc_thread_stack() function
260b235beeaSLinus Torvaldsconfig ARCH_THREAD_STACK_ALLOCATOR
261f5e10287SThomas Gleixner	bool
262f5e10287SThomas Gleixner
2635aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
2645aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
2655aaeb5c0SIngo Molnar	bool
2665aaeb5c0SIngo Molnar
267f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
268f850c30cSHeiko Carstens	bool
269e01292b1SHeiko Carstens	help
270e01292b1SHeiko Carstens	  This symbol should be selected by an architecure if it supports
271e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
272e01292b1SHeiko Carstens	  declared in asm/ptrace.h
273e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
274f850c30cSHeiko Carstens
275d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
276d7822b1eSMathieu Desnoyers	bool
277d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
278d7822b1eSMathieu Desnoyers	help
279d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
280d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
281d7822b1eSMathieu Desnoyers
2829483a578SDavid Brownellconfig HAVE_CLK
2839ba16087SJan Beulich	bool
2849483a578SDavid Brownell	help
2859483a578SDavid Brownell	  The <linux/clk.h> calls support software clock gating and
2869483a578SDavid Brownell	  thus are a key power management tool on many systems.
2879483a578SDavid Brownell
28862a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
28962a038d3SK.Prasad	bool
29099e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
29162a038d3SK.Prasad
2920102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
2930102752eSFrederic Weisbecker	bool
2940102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
2950102752eSFrederic Weisbecker	help
2960102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
2970102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
2980102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
2990102752eSFrederic Weisbecker	  them but define the access type in a control register.
3000102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3010102752eSFrederic Weisbecker	  latter fashion.
3020102752eSFrederic Weisbecker
3037c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3047c68af6eSAvi Kivity	bool
305a1922ed6SIngo Molnar
306c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
307c01d4323SFrederic Weisbecker	bool
30823637d47SFrederic Weisbecker	help
30923637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
31023637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
31123637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
312c01d4323SFrederic Weisbecker
31305a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
31405a4a952SNicholas Piggin	bool
31505a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
31605a4a952SNicholas Piggin	help
31705a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
31805a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
31905a4a952SNicholas Piggin
32005a4a952SNicholas Pigginconfig HAVE_NMI_WATCHDOG
32105a4a952SNicholas Piggin	depends on HAVE_NMI
32205a4a952SNicholas Piggin	bool
32305a4a952SNicholas Piggin	help
32405a4a952SNicholas Piggin	  The arch provides a low level NMI watchdog. It provides
32505a4a952SNicholas Piggin	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
32605a4a952SNicholas Piggin
32705a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
32805a4a952SNicholas Piggin	bool
32905a4a952SNicholas Piggin	select HAVE_NMI_WATCHDOG
33005a4a952SNicholas Piggin	help
33105a4a952SNicholas Piggin	  The arch chooses to provide its own hardlockup detector, which is
33205a4a952SNicholas Piggin	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
33305a4a952SNicholas Piggin	  interfaces and parameters provided by hardlockup detector subsystem.
33405a4a952SNicholas Piggin
335c5e63197SJiri Olsaconfig HAVE_PERF_REGS
336c5e63197SJiri Olsa	bool
337c5e63197SJiri Olsa	help
338c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
339c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
340c5e63197SJiri Olsa
341c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
342c5ebcedbSJiri Olsa	bool
343c5ebcedbSJiri Olsa	help
344c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
345c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
346c5ebcedbSJiri Olsa	  architectures.
347c5ebcedbSJiri Olsa
348bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
349bf5438fcSJason Baron	bool
350bf5438fcSJason Baron
35126723911SPeter Zijlstraconfig HAVE_RCU_TABLE_FREE
35226723911SPeter Zijlstra	bool
35326723911SPeter Zijlstra
354df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
355df013ffbSHuang Ying	bool
356df013ffbSHuang Ying
35743570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
35843570fd2SHeiko Carstens	bool
35943570fd2SHeiko Carstens	help
36043570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
36143570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
36243570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
36343570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
36443570fd2SHeiko Carstens
3654156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
3664156153cSHeiko Carstens	bool
3674156153cSHeiko Carstens
3682565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
3692565409fSHeiko Carstens	bool
3702565409fSHeiko Carstens
37177e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
37277e58496SPaul E. McKenney	bool
37377e58496SPaul E. McKenney
374c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
375c1d7e01dSWill Deacon	bool
376c1d7e01dSWill Deacon
377c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
378c1d7e01dSWill Deacon	bool
379c1d7e01dSWill Deacon
38048b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
381c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
38248b25c43SChris Metcalf	bool
38348b25c43SChris Metcalf
384e2cfabdfSWill Drewryconfig HAVE_ARCH_SECCOMP_FILTER
385e2cfabdfSWill Drewry	bool
386e2cfabdfSWill Drewry	help
387fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
388bb6ea430SWill Drewry	  - syscall_get_arch()
389bb6ea430SWill Drewry	  - syscall_get_arguments()
390bb6ea430SWill Drewry	  - syscall_rollback()
391bb6ea430SWill Drewry	  - syscall_set_return_value()
392fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
393fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
394fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
395fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
39648dc92b9SKees Cook	  - seccomp syscall wired up
397e2cfabdfSWill Drewry
398e2cfabdfSWill Drewryconfig SECCOMP_FILTER
399e2cfabdfSWill Drewry	def_bool y
400e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
401e2cfabdfSWill Drewry	help
402e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
403e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
404e2cfabdfSWill Drewry	  task-defined system call filtering polices.
405e2cfabdfSWill Drewry
406*5fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
407e2cfabdfSWill Drewry
40859f53855SMasahiro Yamadapreferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC))
40959f53855SMasahiro Yamada
41059f53855SMasahiro Yamadaconfig PLUGIN_HOSTCC
41159f53855SMasahiro Yamada	string
41259f53855SMasahiro Yamada	default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
41359f53855SMasahiro Yamada	help
41459f53855SMasahiro Yamada	  Host compiler used to build GCC plugins.  This can be $(HOSTCXX),
41559f53855SMasahiro Yamada	  $(HOSTCC), or a null string if GCC plugin is unsupported.
41659f53855SMasahiro Yamada
4176b90bd4bSEmese Revfyconfig HAVE_GCC_PLUGINS
4186b90bd4bSEmese Revfy	bool
4196b90bd4bSEmese Revfy	help
4206b90bd4bSEmese Revfy	  An arch should select this symbol if it supports building with
4216b90bd4bSEmese Revfy	  GCC plugins.
4226b90bd4bSEmese Revfy
4236b90bd4bSEmese Revfymenuconfig GCC_PLUGINS
4246b90bd4bSEmese Revfy	bool "GCC plugins"
4256b90bd4bSEmese Revfy	depends on HAVE_GCC_PLUGINS
42659f53855SMasahiro Yamada	depends on PLUGIN_HOSTCC != ""
4276b90bd4bSEmese Revfy	help
4286b90bd4bSEmese Revfy	  GCC plugins are loadable modules that provide extra features to the
4296b90bd4bSEmese Revfy	  compiler. They are useful for runtime instrumentation and static analysis.
4306b90bd4bSEmese Revfy
4316b90bd4bSEmese Revfy	  See Documentation/gcc-plugins.txt for details.
4326b90bd4bSEmese Revfy
4330dae776cSEmese Revfyconfig GCC_PLUGIN_CYC_COMPLEXITY
434215e2aa6SKees Cook	bool "Compute the cyclomatic complexity of a function" if EXPERT
4350dae776cSEmese Revfy	depends on GCC_PLUGINS
4361658dceeSMasahiro Yamada	depends on !COMPILE_TEST	# too noisy
4370dae776cSEmese Revfy	help
4380dae776cSEmese Revfy	  The complexity M of a function's control flow graph is defined as:
4390dae776cSEmese Revfy	   M = E - N + 2P
4400dae776cSEmese Revfy	  where
4410dae776cSEmese Revfy
4420dae776cSEmese Revfy	  E = the number of edges
4430dae776cSEmese Revfy	  N = the number of nodes
4440dae776cSEmese Revfy	  P = the number of connected components (exit nodes).
4450dae776cSEmese Revfy
446215e2aa6SKees Cook	  Enabling this plugin reports the complexity to stderr during the
447215e2aa6SKees Cook	  build. It mainly serves as a simple example of how to create a
448215e2aa6SKees Cook	  gcc plugin for the kernel.
449215e2aa6SKees Cook
450543c37cbSEmese Revfyconfig GCC_PLUGIN_SANCOV
451543c37cbSEmese Revfy	bool
452543c37cbSEmese Revfy	depends on GCC_PLUGINS
453543c37cbSEmese Revfy	help
454543c37cbSEmese Revfy	  This plugin inserts a __sanitizer_cov_trace_pc() call at the start of
455543c37cbSEmese Revfy	  basic blocks. It supports all gcc versions with plugin support (from
456543c37cbSEmese Revfy	  gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
457543c37cbSEmese Revfy	  by Dmitry Vyukov <dvyukov@google.com>.
458543c37cbSEmese Revfy
45938addce8SEmese Revfyconfig GCC_PLUGIN_LATENT_ENTROPY
46038addce8SEmese Revfy	bool "Generate some entropy during boot and runtime"
46138addce8SEmese Revfy	depends on GCC_PLUGINS
46238addce8SEmese Revfy	help
46338addce8SEmese Revfy	  By saying Y here the kernel will instrument some kernel code to
46438addce8SEmese Revfy	  extract some entropy from both original and artificially created
46538addce8SEmese Revfy	  program state.  This will help especially embedded systems where
46638addce8SEmese Revfy	  there is little 'natural' source of entropy normally.  The cost
46738addce8SEmese Revfy	  is some slowdown of the boot process (about 0.5%) and fork and
46838addce8SEmese Revfy	  irq processing.
46938addce8SEmese Revfy
47038addce8SEmese Revfy	  Note that entropy extracted this way is not cryptographically
47138addce8SEmese Revfy	  secure!
47238addce8SEmese Revfy
47338addce8SEmese Revfy	  This plugin was ported from grsecurity/PaX. More information at:
47438addce8SEmese Revfy	   * https://grsecurity.net/
47538addce8SEmese Revfy	   * https://pax.grsecurity.net/
47638addce8SEmese Revfy
477c61f13eaSKees Cookconfig GCC_PLUGIN_STRUCTLEAK
478c61f13eaSKees Cook	bool "Force initialization of variables containing userspace addresses"
479c61f13eaSKees Cook	depends on GCC_PLUGINS
480c9cf87eaSDmitry Vyukov	# Currently STRUCTLEAK inserts initialization out of live scope of
481c9cf87eaSDmitry Vyukov	# variables from KASAN point of view. This leads to KASAN false
482c9cf87eaSDmitry Vyukov	# positive reports. Prohibit this combination for now.
483c9cf87eaSDmitry Vyukov	depends on !KASAN_EXTRA
484c61f13eaSKees Cook	help
485f136e090SJean Delvare	  This plugin zero-initializes any structures containing a
486c61f13eaSKees Cook	  __user attribute. This can prevent some classes of information
487c61f13eaSKees Cook	  exposures.
488c61f13eaSKees Cook
489c61f13eaSKees Cook	  This plugin was ported from grsecurity/PaX. More information at:
490c61f13eaSKees Cook	   * https://grsecurity.net/
491c61f13eaSKees Cook	   * https://pax.grsecurity.net/
492c61f13eaSKees Cook
493f7dd2507SArd Biesheuvelconfig GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
494f7dd2507SArd Biesheuvel	bool "Force initialize all struct type variables passed by reference"
495f7dd2507SArd Biesheuvel	depends on GCC_PLUGIN_STRUCTLEAK
496caa91ba5SMasahiro Yamada	depends on !COMPILE_TEST
497f7dd2507SArd Biesheuvel	help
498f7dd2507SArd Biesheuvel	  Zero initialize any struct type local variable that may be passed by
499f7dd2507SArd Biesheuvel	  reference without having been initialized.
500f7dd2507SArd Biesheuvel
501c61f13eaSKees Cookconfig GCC_PLUGIN_STRUCTLEAK_VERBOSE
502c61f13eaSKees Cook	bool "Report forcefully initialized variables"
503c61f13eaSKees Cook	depends on GCC_PLUGIN_STRUCTLEAK
5041658dceeSMasahiro Yamada	depends on !COMPILE_TEST	# too noisy
505c61f13eaSKees Cook	help
506c61f13eaSKees Cook	  This option will cause a warning to be printed each time the
507c61f13eaSKees Cook	  structleak plugin finds a variable it thinks needs to be
508c61f13eaSKees Cook	  initialized. Since not all existing initializers are detected
509c61f13eaSKees Cook	  by the plugin, this can produce false positive warnings.
510c61f13eaSKees Cook
511313dd1b6SKees Cookconfig GCC_PLUGIN_RANDSTRUCT
512313dd1b6SKees Cook	bool "Randomize layout of sensitive kernel structures"
513313dd1b6SKees Cook	depends on GCC_PLUGINS
514313dd1b6SKees Cook	select MODVERSIONS if MODULES
515313dd1b6SKees Cook	help
5169225331bSKees Cook	  If you say Y here, the layouts of structures that are entirely
5179225331bSKees Cook	  function pointers (and have not been manually annotated with
5189225331bSKees Cook	  __no_randomize_layout), or structures that have been explicitly
5199225331bSKees Cook	  marked with __randomize_layout, will be randomized at compile-time.
5209225331bSKees Cook	  This can introduce the requirement of an additional information
5219225331bSKees Cook	  exposure vulnerability for exploits targeting these structure
5229225331bSKees Cook	  types.
523313dd1b6SKees Cook
524313dd1b6SKees Cook	  Enabling this feature will introduce some performance impact,
525313dd1b6SKees Cook	  slightly increase memory usage, and prevent the use of forensic
526313dd1b6SKees Cook	  tools like Volatility against the system (unless the kernel
527313dd1b6SKees Cook	  source tree isn't cleaned after kernel installation).
528313dd1b6SKees Cook
529313dd1b6SKees Cook	  The seed used for compilation is located at
530313dd1b6SKees Cook	  scripts/gcc-plgins/randomize_layout_seed.h.  It remains after
531313dd1b6SKees Cook	  a make clean to allow for external modules to be compiled with
532313dd1b6SKees Cook	  the existing seed and will be removed by a make mrproper or
533313dd1b6SKees Cook	  make distclean.
534313dd1b6SKees Cook
535313dd1b6SKees Cook	  Note that the implementation requires gcc 4.7 or newer.
536313dd1b6SKees Cook
537313dd1b6SKees Cook	  This plugin was ported from grsecurity/PaX. More information at:
538313dd1b6SKees Cook	   * https://grsecurity.net/
539313dd1b6SKees Cook	   * https://pax.grsecurity.net/
540313dd1b6SKees Cook
541313dd1b6SKees Cookconfig GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
542313dd1b6SKees Cook	bool "Use cacheline-aware structure randomization"
543313dd1b6SKees Cook	depends on GCC_PLUGIN_RANDSTRUCT
5441658dceeSMasahiro Yamada	depends on !COMPILE_TEST	# do not reduce test coverage
545313dd1b6SKees Cook	help
546313dd1b6SKees Cook	  If you say Y here, the RANDSTRUCT randomization will make a
547313dd1b6SKees Cook	  best effort at restricting randomization to cacheline-sized
548313dd1b6SKees Cook	  groups of elements.  It will further not randomize bitfields
549313dd1b6SKees Cook	  in structures.  This reduces the performance hit of RANDSTRUCT
550313dd1b6SKees Cook	  at the cost of weakened randomization.
551313dd1b6SKees Cook
552d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
55319952a92SKees Cook	bool
55419952a92SKees Cook	help
55519952a92SKees Cook	  An arch should select this symbol if:
55619952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
55719952a92SKees Cook
5582a61f474SMasahiro Yamadaconfig CC_HAS_STACKPROTECTOR_NONE
5592a61f474SMasahiro Yamada	def_bool $(cc-option,-fno-stack-protector)
5602a61f474SMasahiro Yamada
561050e9baaSLinus Torvaldsconfig STACKPROTECTOR
5622a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
563d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
5642a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
5652a61f474SMasahiro Yamada	default y
5668779657dSKees Cook	help
5678779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
56819952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
56919952a92SKees Cook	  the stack just before the return address, and validates
57019952a92SKees Cook	  the value just before actually returning.  Stack based buffer
57119952a92SKees Cook	  overflows (that need to overwrite this return address) now also
57219952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
57319952a92SKees Cook	  neutralized via a kernel panic.
57419952a92SKees Cook
5758779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
5768779657dSKees Cook	  have an 8-byte or larger character array on the stack.
5778779657dSKees Cook
57819952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
5798779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
5808779657dSKees Cook
5818779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
5828779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
5838779657dSKees Cook	  by about 0.3%.
5848779657dSKees Cook
585050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
5862a61f474SMasahiro Yamada	bool "Strong Stack Protector"
587050e9baaSLinus Torvalds	depends on STACKPROTECTOR
5882a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
5892a61f474SMasahiro Yamada	default y
5908779657dSKees Cook	help
5918779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
5928779657dSKees Cook	  of the following conditions:
5938779657dSKees Cook
5948779657dSKees Cook	  - local variable's address used as part of the right hand side of an
5958779657dSKees Cook	    assignment or function argument
5968779657dSKees Cook	  - local variable is an array (or union containing an array),
5978779657dSKees Cook	    regardless of array type or length
5988779657dSKees Cook	  - uses register local variables
5998779657dSKees Cook
6008779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
6018779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
6028779657dSKees Cook
6038779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6048779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
6058779657dSKees Cook	  size by about 2%.
6068779657dSKees Cook
6070f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
6080f60a8efSKees Cook	bool
6090f60a8efSKees Cook	help
6100f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
6110f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
6120f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
6130f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
6140f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
6150f60a8efSKees Cook
61691d1aa43SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING
6172b1d5024SFrederic Weisbecker	bool
6182b1d5024SFrederic Weisbecker	help
61991d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
62091d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
62191d1aa43SFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter() through
62291d1aa43SFrederic Weisbecker	  the slow path using TIF_NOHZ flag. Exceptions handlers must be
62391d1aa43SFrederic Weisbecker	  wrapped as well. Irqs are already protected inside
62491d1aa43SFrederic Weisbecker	  rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
62591d1aa43SFrederic Weisbecker	  irq exit still need to be protected.
6262b1d5024SFrederic Weisbecker
627b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
628b952741cSFrederic Weisbecker	bool
629b952741cSFrederic Weisbecker
63040565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
63140565b5aSStanislaw Gruszka	bool
63240565b5aSStanislaw Gruszka
633554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
634554b0004SKevin Hilman	bool
635554b0004SKevin Hilman	default y if 64BIT
636554b0004SKevin Hilman	help
637554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
638554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
639554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
640554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
641554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
642554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
643554b0004SKevin Hilman
644554b0004SKevin Hilman
645fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
646fdf9c356SFrederic Weisbecker	bool
647fdf9c356SFrederic Weisbecker	help
648fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
649fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
650fdf9c356SFrederic Weisbecker
65115626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
65215626062SGerald Schaefer	bool
65315626062SGerald Schaefer
654a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
655a00cc7d9SMatthew Wilcox	bool
656a00cc7d9SMatthew Wilcox
6570ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
6580ddab1d2SToshi Kani	bool
6590ddab1d2SToshi Kani
6600f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
6610f8975ecSPavel Emelyanov	bool
6620f8975ecSPavel Emelyanov
663786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
664786d35d4SDavid Howells	bool
665786d35d4SDavid Howells	help
666786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
667786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
668786d35d4SDavid Howells	  should not enable this.
669786d35d4SDavid Howells
670786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
671786d35d4SDavid Howells	bool
672786d35d4SDavid Howells	help
673786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
674786d35d4SDavid Howells	  relocations will give an error.
675786d35d4SDavid Howells
676786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
677786d35d4SDavid Howells	bool
678786d35d4SDavid Howells	help
679786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
680786d35d4SDavid Howells	  relocations will give an error.
681786d35d4SDavid Howells
682cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
683cc1f0274SFrederic Weisbecker	bool
684cc1f0274SFrederic Weisbecker	help
685cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
686cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
687cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
688cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
689cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
690cc1f0274SFrederic Weisbecker	  processing.
691cc1f0274SFrederic Weisbecker
692235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
693235a8f02SKirill A. Shutemov	int
694235a8f02SKirill A. Shutemov	default 2
695235a8f02SKirill A. Shutemov
6962b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
6972b68f6caSKees Cook	bool
6982b68f6caSKees Cook	help
6992b68f6caSKees Cook	  An architecture supports choosing randomized locations for
7002b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
7012b68f6caSKees Cook	  - arch_mmap_rnd()
702204db6edSKees Cook	  - arch_randomize_brk()
7032b68f6caSKees Cook
704d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
705d07e2259SDaniel Cashman	bool
706d07e2259SDaniel Cashman	help
707d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
708d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
709d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
710d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
711d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
712d07e2259SDaniel Cashman
7135f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
7145f56a5dfSJiri Slaby	bool
7155f56a5dfSJiri Slaby	help
7165f56a5dfSJiri Slaby	  An architecture implements exit_thread.
7175f56a5dfSJiri Slaby
718d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
719d07e2259SDaniel Cashman	int
720d07e2259SDaniel Cashman
721d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
722d07e2259SDaniel Cashman	int
723d07e2259SDaniel Cashman
724d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
725d07e2259SDaniel Cashman	int
726d07e2259SDaniel Cashman
727d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
728d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
729d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
730d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
731d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
732d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
733d07e2259SDaniel Cashman	help
734d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
735d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
736d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
737d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
738d07e2259SDaniel Cashman
739d07e2259SDaniel Cashman	  This value can be changed after boot using the
740d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
741d07e2259SDaniel Cashman
742d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
743d07e2259SDaniel Cashman	bool
744d07e2259SDaniel Cashman	help
745d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
746d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
747d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
748d07e2259SDaniel Cashman	  enabled and provides values for both:
749d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
750d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
751d07e2259SDaniel Cashman
752d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
753d07e2259SDaniel Cashman	int
754d07e2259SDaniel Cashman
755d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
756d07e2259SDaniel Cashman	int
757d07e2259SDaniel Cashman
758d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
759d07e2259SDaniel Cashman	int
760d07e2259SDaniel Cashman
761d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
762d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
763d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
764d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
765d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
766d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
767d07e2259SDaniel Cashman	help
768d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
769d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
770d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
771d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
772d07e2259SDaniel Cashman	  supported values.
773d07e2259SDaniel Cashman
774d07e2259SDaniel Cashman	  This value can be changed after boot using the
775d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
776d07e2259SDaniel Cashman
7771b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
7781b028f78SDmitry Safonov	bool
7791b028f78SDmitry Safonov	help
7801b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
7811b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
7821b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
7831b028f78SDmitry Safonov
7843033f14aSJosh Triplettconfig HAVE_COPY_THREAD_TLS
7853033f14aSJosh Triplett	bool
7863033f14aSJosh Triplett	help
7873033f14aSJosh Triplett	  Architecture provides copy_thread_tls to accept tls argument via
7883033f14aSJosh Triplett	  normal C parameter passing, rather than extracting the syscall
7893033f14aSJosh Triplett	  argument from pt_regs.
7903033f14aSJosh Triplett
791b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
792b9ab5ebbSJosh Poimboeuf	bool
793b9ab5ebbSJosh Poimboeuf	help
794b9ab5ebbSJosh Poimboeuf	  Architecture supports the 'objtool check' host tool command, which
795b9ab5ebbSJosh Poimboeuf	  performs compile-time stack metadata validation.
796b9ab5ebbSJosh Poimboeuf
797af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
798af085d90SJosh Poimboeuf	bool
799af085d90SJosh Poimboeuf	help
800af085d90SJosh Poimboeuf	  Architecture has a save_stack_trace_tsk_reliable() function which
801af085d90SJosh Poimboeuf	  only returns a stack trace if it can guarantee the trace is reliable.
802af085d90SJosh Poimboeuf
803468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
804468a9428SGeorge Spelvin	bool
805468a9428SGeorge Spelvin	default n
806468a9428SGeorge Spelvin	help
807468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
808468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
809468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
810468a9428SGeorge Spelvin
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
860d4703ddaSDeepa Dinamaniconfig 64BIT_TIME
861d4703ddaSDeepa Dinamani	def_bool ARCH_HAS_64BIT_TIME
862d4703ddaSDeepa Dinamani	help
863d4703ddaSDeepa Dinamani	  This should be selected by all architectures that need to support
864d4703ddaSDeepa Dinamani	  new system calls with a 64-bit time_t. This is relevant on all 32-bit
865d4703ddaSDeepa Dinamani	  architectures, and 64-bit architectures as part of compat syscall
866d4703ddaSDeepa Dinamani	  handling.
867d4703ddaSDeepa Dinamani
86817435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
86917435e5fSDeepa Dinamani	def_bool (!64BIT && 64BIT_TIME) || COMPAT
87017435e5fSDeepa Dinamani	help
87117435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
87217435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
87317435e5fSDeepa Dinamani	  as part of compat syscall handling.
87417435e5fSDeepa Dinamani
8750d4a619bSChristoph Hellwigconfig ARCH_NO_COHERENT_DMA_MMAP
8760d4a619bSChristoph Hellwig	bool
8770d4a619bSChristoph Hellwig
878fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
879fff7fb0bSZhaoxiu Zeng	def_bool n
880fff7fb0bSZhaoxiu Zeng
881ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
882ba14a194SAndy Lutomirski	def_bool n
883ba14a194SAndy Lutomirski	help
884ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
885ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
886ba14a194SAndy Lutomirski
887ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
888ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
889ba14a194SAndy Lutomirski
890ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
891ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
892ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
893ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
894ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
895ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
896ba14a194SAndy Lutomirski
897ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
898ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
899ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
900ba14a194SAndy Lutomirski
901ba14a194SAndy Lutomirskiconfig VMAP_STACK
902ba14a194SAndy Lutomirski	default y
903ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
904ba14a194SAndy Lutomirski	depends on HAVE_ARCH_VMAP_STACK && !KASAN
905ba14a194SAndy Lutomirski	---help---
906ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
907ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
908ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
909ba14a194SAndy Lutomirski	  corruption.
910ba14a194SAndy Lutomirski
911ba14a194SAndy Lutomirski	  This is presently incompatible with KASAN because KASAN expects
912ba14a194SAndy Lutomirski	  the stack to map directly to the KASAN shadow map using a formula
913ba14a194SAndy Lutomirski	  that is incorrect if the stack is in vmalloc space.
914ba14a194SAndy Lutomirski
915ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
916ad21fc4fSLaura Abbott	def_bool n
917ad21fc4fSLaura Abbott
918ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
919ad21fc4fSLaura Abbott	def_bool n
920ad21fc4fSLaura Abbott
921ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
922ad21fc4fSLaura Abbott	def_bool n
923ad21fc4fSLaura Abbott
9240f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
925ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
926ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
927ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
928ad21fc4fSLaura Abbott	help
929ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
930ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
931ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
932ad21fc4fSLaura Abbott	  or modifying text)
933ad21fc4fSLaura Abbott
934ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
935ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
936ad21fc4fSLaura Abbott
937ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
938ad21fc4fSLaura Abbott	def_bool n
939ad21fc4fSLaura Abbott
9400f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
941ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
942ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
943ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
944ad21fc4fSLaura Abbott	help
945ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
946ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
947ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
948ad21fc4fSLaura Abbott
949ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
950ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
951ea8c64acSChristoph Hellwig	bool
952ea8c64acSChristoph Hellwig
9537a46ec0eSKees Cookconfig ARCH_HAS_REFCOUNT
9547a46ec0eSKees Cook	bool
9557a46ec0eSKees Cook	help
9567a46ec0eSKees Cook	  An architecture selects this when it has implemented refcount_t
9577a46ec0eSKees Cook	  using open coded assembly primitives that provide an optimized
9587a46ec0eSKees Cook	  refcount_t implementation, possibly at the expense of some full
9597a46ec0eSKees Cook	  refcount state checks of CONFIG_REFCOUNT_FULL=y.
9607a46ec0eSKees Cook
9617a46ec0eSKees Cook	  The refcount overflow check behavior, however, must be retained.
9627a46ec0eSKees Cook	  Catching overflows is the primary security concern for protecting
9637a46ec0eSKees Cook	  against bugs in reference counts.
9647a46ec0eSKees Cook
965fd25d19fSKees Cookconfig REFCOUNT_FULL
966fd25d19fSKees Cook	bool "Perform full reference count validation at the expense of speed"
967fd25d19fSKees Cook	help
968fd25d19fSKees Cook	  Enabling this switches the refcounting infrastructure from a fast
969fd25d19fSKees Cook	  unchecked atomic_t implementation to a fully state checked
970fd25d19fSKees Cook	  implementation, which can be (slightly) slower but provides protections
971fd25d19fSKees Cook	  against various use-after-free conditions that can be used in
972fd25d19fSKees Cook	  security flaw exploits.
973fd25d19fSKees Cook
9742521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
975