xref: /linux/arch/Kconfig (revision a88d970c8bb55dc20f319ce3e33c7ce0e9647480)
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
14da32b581SCatalin Marinasconfig ARCH_HAS_SUBPAGE_FAULTS
15da32b581SCatalin Marinas	bool
16da32b581SCatalin Marinas	help
17da32b581SCatalin Marinas	  Select if the architecture can check permissions at sub-page
18da32b581SCatalin Marinas	  granularity (e.g. arm64 MTE). The probe_user_*() functions
19da32b581SCatalin Marinas	  must be implemented.
20da32b581SCatalin Marinas
2105736e4aSThomas Gleixnerconfig HOTPLUG_SMT
2205736e4aSThomas Gleixner	bool
2305736e4aSThomas Gleixner
2438253464SMichael Ellermanconfig SMT_NUM_THREADS_DYNAMIC
2538253464SMichael Ellerman	bool
2638253464SMichael Ellerman
276f062123SThomas Gleixner# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
286f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC
296f062123SThomas Gleixner	bool
306f062123SThomas Gleixner
316f062123SThomas Gleixner# Basic CPU dead synchronization selected by architecture
326f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_DEAD
336f062123SThomas Gleixner	bool
346f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
356f062123SThomas Gleixner
366f062123SThomas Gleixner# Full CPU synchronization with alive state selected by architecture
376f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_FULL
386f062123SThomas Gleixner	bool
396f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
406f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
416f062123SThomas Gleixner
42a631be92SThomas Gleixnerconfig HOTPLUG_SPLIT_STARTUP
43a631be92SThomas Gleixner	bool
44a631be92SThomas Gleixner	select HOTPLUG_CORE_SYNC_FULL
45a631be92SThomas Gleixner
4618415f33SThomas Gleixnerconfig HOTPLUG_PARALLEL
4718415f33SThomas Gleixner	bool
4818415f33SThomas Gleixner	select HOTPLUG_SPLIT_STARTUP
4918415f33SThomas Gleixner
50142781e1SThomas Gleixnerconfig GENERIC_ENTRY
51142781e1SThomas Gleixner	bool
52142781e1SThomas Gleixner
53125e5645SMathieu Desnoyersconfig KPROBES
54125e5645SMathieu Desnoyers	bool "Kprobes"
5505ed160eSMasami Hiramatsu	depends on MODULES
56125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
5705ed160eSMasami Hiramatsu	select KALLSYMS
58835f14edSPaul E. McKenney	select TASKS_RCU if PREEMPTION
59125e5645SMathieu Desnoyers	help
60125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
61125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
62125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
63125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
64125e5645SMathieu Desnoyers	  If in doubt, say "N".
65125e5645SMathieu Desnoyers
6645f81b1cSSteven Rostedtconfig JUMP_LABEL
67c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
6845f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
694ab7674fSJosh Poimboeuf	select OBJTOOL if HAVE_JUMP_LABEL_HACK
7045f81b1cSSteven Rostedt	help
71c5905afbSIngo Molnar	  This option enables a transparent branch optimization that
72c5905afbSIngo Molnar	  makes certain almost-always-true or almost-always-false branch
73c5905afbSIngo Molnar	  conditions even cheaper to execute within the kernel.
7445f81b1cSSteven Rostedt
75c5905afbSIngo Molnar	  Certain performance-sensitive kernel code, such as trace points,
76c5905afbSIngo Molnar	  scheduler functionality, networking code and KVM have such
77c5905afbSIngo Molnar	  branches and include support for this optimization technique.
78c5905afbSIngo Molnar
79c5905afbSIngo Molnar	  If it is detected that the compiler has support for "asm goto",
80c5905afbSIngo Molnar	  the kernel will compile such branches with just a nop
81c5905afbSIngo Molnar	  instruction. When the condition flag is toggled to true, the
82c5905afbSIngo Molnar	  nop will be converted to a jump instruction to execute the
83c5905afbSIngo Molnar	  conditional block of instructions.
84c5905afbSIngo Molnar
85c5905afbSIngo Molnar	  This technique lowers overhead and stress on the branch prediction
86c5905afbSIngo Molnar	  of the processor and generally makes the kernel faster. The update
87c5905afbSIngo Molnar	  of the condition is slower, but those are always very rare.
88c5905afbSIngo Molnar
89c5905afbSIngo Molnar	  ( On 32-bit x86, the necessary options added to the compiler
90c5905afbSIngo Molnar	    flags may increase the size of the kernel slightly. )
9145f81b1cSSteven Rostedt
921987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
931987c947SPeter Zijlstra	bool "Static key selftest"
941987c947SPeter Zijlstra	depends on JUMP_LABEL
951987c947SPeter Zijlstra	help
961987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
971987c947SPeter Zijlstra
98f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
99f03c4129SPeter Zijlstra	bool "Static call selftest"
100f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
101f03c4129SPeter Zijlstra	help
102f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
103f03c4129SPeter Zijlstra
104afd66255SMasami Hiramatsuconfig OPTPROBES
1055cc718b9SMasami Hiramatsu	def_bool y
1065cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
10701b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
108afd66255SMasami Hiramatsu
109e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
110e7dbfe34SMasami Hiramatsu	def_bool y
111e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
112e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
113e7dbfe34SMasami Hiramatsu	help
114e7dbfe34SMasami Hiramatsu	  If function tracer is enabled and the arch supports full
115e7dbfe34SMasami Hiramatsu	  passing of pt_regs to function tracing, then kprobes can
116e7dbfe34SMasami Hiramatsu	  optimize on top of function tracing.
117e7dbfe34SMasami Hiramatsu
1182b144498SSrikar Dronamrajuconfig UPROBES
11909294e31SDavid A. Long	def_bool n
120e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1212b144498SSrikar Dronamraju	help
1227b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1237b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1247b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1257b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1267b2d81d4SIngo Molnar	  are hit by user-space applications.
1277b2d81d4SIngo Molnar
1287b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1297b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1307b2d81d4SIngo Molnar	    application. )
1312b144498SSrikar Dronamraju
132adab66b7SSteven Rostedt (VMware)config HAVE_64BIT_ALIGNED_ACCESS
133adab66b7SSteven Rostedt (VMware)	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
134adab66b7SSteven Rostedt (VMware)	help
135adab66b7SSteven Rostedt (VMware)	  Some architectures require 64 bit accesses to be 64 bit
136adab66b7SSteven Rostedt (VMware)	  aligned, which also requires structs containing 64 bit values
137adab66b7SSteven Rostedt (VMware)	  to be 64 bit aligned too. This includes some 32 bit
138adab66b7SSteven Rostedt (VMware)	  architectures which can do 64 bit accesses, as well as 64 bit
139adab66b7SSteven Rostedt (VMware)	  architectures without unaligned access.
140adab66b7SSteven Rostedt (VMware)
141adab66b7SSteven Rostedt (VMware)	  This symbol should be selected by an architecture if 64 bit
142adab66b7SSteven Rostedt (VMware)	  accesses are required to be 64 bit aligned in this way even
143adab66b7SSteven Rostedt (VMware)	  though it is not a 64 bit architecture.
144adab66b7SSteven Rostedt (VMware)
145ba1a297dSLukas Bulwahn	  See Documentation/core-api/unaligned-memory-access.rst for
146ba1a297dSLukas Bulwahn	  more information on the topic of unaligned memory accesses.
147adab66b7SSteven Rostedt (VMware)
14858340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1499ba16087SJan Beulich	bool
15058340a07SJohannes Berg	help
15158340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
15258340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
15358340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
15458340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
15558340a07SJohannes Berg	  handler.)
15658340a07SJohannes Berg
15758340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
15858340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
15958340a07SJohannes Berg	  code paths to be selected for these cases. Some network
16058340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
16158340a07SJohannes Berg	  problems with received packets if doing so would not help
16258340a07SJohannes Berg	  much.
16358340a07SJohannes Berg
164c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
16558340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
16658340a07SJohannes Berg
167cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
168cf66bb93SDavid Woodhouse	bool
169cf66bb93SDavid Woodhouse	help
170cf66bb93SDavid Woodhouse	  Modern versions of GCC (since 4.4) have builtin functions
171cf66bb93SDavid Woodhouse	  for handling byte-swapping. Using these, instead of the old
172cf66bb93SDavid Woodhouse	  inline assembler that the architecture code provides in the
173cf66bb93SDavid Woodhouse	  __arch_bswapXX() macros, allows the compiler to see what's
174cf66bb93SDavid Woodhouse	  happening and offers more opportunity for optimisation. In
175cf66bb93SDavid Woodhouse	  particular, the compiler will be able to combine the byteswap
176cf66bb93SDavid Woodhouse	  with a nearby load or store and use load-and-swap or
177cf66bb93SDavid Woodhouse	  store-and-swap instructions if the architecture has them. It
178cf66bb93SDavid Woodhouse	  should almost *never* result in code which is worse than the
179cf66bb93SDavid Woodhouse	  hand-coded assembler in <asm/swab.h>.  But just in case it
180cf66bb93SDavid Woodhouse	  does, the use of the builtins is optional.
181cf66bb93SDavid Woodhouse
182cf66bb93SDavid Woodhouse	  Any architecture with load-and-swap or store-and-swap
183cf66bb93SDavid Woodhouse	  instructions should set this. And it shouldn't hurt to set it
184cf66bb93SDavid Woodhouse	  on architectures that don't have such instructions.
185cf66bb93SDavid Woodhouse
1869edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
1879edddaa2SAnanth N Mavinakayanahalli	def_bool y
18873f9b911SMasami Hiramatsu	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
18973f9b911SMasami Hiramatsu
19073f9b911SMasami Hiramatsuconfig KRETPROBE_ON_RETHOOK
19173f9b911SMasami Hiramatsu	def_bool y
19273f9b911SMasami Hiramatsu	depends on HAVE_RETHOOK
19373f9b911SMasami Hiramatsu	depends on KRETPROBES
19473f9b911SMasami Hiramatsu	select RETHOOK
1959edddaa2SAnanth N Mavinakayanahalli
1967c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
1977c68af6eSAvi Kivity	bool
1987c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
1997c68af6eSAvi Kivity	help
2007c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
2017c68af6eSAvi Kivity	  switch to user mode.
2027c68af6eSAvi Kivity
20328b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
2049ba16087SJan Beulich	bool
20528b2ee20SRik van Riel
206125e5645SMathieu Desnoyersconfig HAVE_KPROBES
2079ba16087SJan Beulich	bool
2089edddaa2SAnanth N Mavinakayanahalli
2099edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2109ba16087SJan Beulich	bool
21174bc7ceeSArthur Kepner
212afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
213afd66255SMasami Hiramatsu	bool
214d314d74cSCong Wang
215e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
216e7dbfe34SMasami Hiramatsu	bool
217e7dbfe34SMasami Hiramatsu
2181f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2191f6d3a8fSMasami Hiramatsu	bool
2201f6d3a8fSMasami Hiramatsu	help
2211f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
2221f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
2231f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2241f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2251f6d3a8fSMasami Hiramatsu
226540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2279802d865SJosef Bacik	bool
2289802d865SJosef Bacik
22942a0bb3fSPetr Mladekconfig HAVE_NMI
23042a0bb3fSPetr Mladek	bool
23142a0bb3fSPetr Mladek
232a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
233a257caccSChristophe Leroy	bool
234a257caccSChristophe Leroy
2354aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
2364aae683fSMasahiro Yamada	bool
2374aae683fSMasahiro Yamada
2384510bffbSMark Rutlandconfig TRACE_IRQFLAGS_NMI_SUPPORT
2394510bffbSMark Rutland	bool
2404510bffbSMark Rutland
2411f5a4ad9SRoland McGrath#
2421f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2431f5a4ad9SRoland McGrath#
2441f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2451f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2461f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2471f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2481f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2491f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
250153474baSEric W. Biederman#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
25103248addSEric W. Biederman#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
2521f5a4ad9SRoland McGrath#
2531f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2549ba16087SJan Beulich	bool
2551f5a4ad9SRoland McGrath
256c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
257c64be2bbSMarek Szyprowski	bool
258c64be2bbSMarek Szyprowski
25929d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
26029d5e047SThomas Gleixner	bool
26129d5e047SThomas Gleixner
262485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
263485cf5daSKevin Hilman	bool
264485cf5daSKevin Hilman
2656974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2666974f0c4SDaniel Micay	bool
2676974f0c4SDaniel Micay	help
2686974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2696974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2706974f0c4SDaniel Micay
271d8ae8a37SChristoph Hellwig#
272d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
273d8ae8a37SChristoph Hellwig# command line option
274d8ae8a37SChristoph Hellwig#
275d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
276d8ae8a37SChristoph Hellwig	bool
277d8ae8a37SChristoph Hellwig
278d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
279d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
280d2852a22SDaniel Borkmann	bool
281d2852a22SDaniel Borkmann
282d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
283d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
284d253ca0cSRick Edgecombe	bool
285d253ca0cSRick Edgecombe
286c30700dbSChristoph Hellwig#
287fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
288a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
289fa7e2247SChristoph Hellwig# to remap the page tables in place.
290c30700dbSChristoph Hellwig#
291fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
292c30700dbSChristoph Hellwig	bool
293c30700dbSChristoph Hellwig
294999a5d12SChristoph Hellwig#
295999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
296999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
297999a5d12SChristoph Hellwig#
298999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
299f5e10287SThomas Gleixner	bool
300f5e10287SThomas Gleixner
3017725acaaSThomas Gleixnerconfig ARCH_HAS_CPU_FINALIZE_INIT
3027725acaaSThomas Gleixner	bool
3037725acaaSThomas Gleixner
3048f23f5dbSJason Gunthorpe# The architecture has a per-task state that includes the mm's PASID
3058f23f5dbSJason Gunthorpeconfig ARCH_HAS_CPU_PASID
3068f23f5dbSJason Gunthorpe	bool
3078f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
3088f23f5dbSJason Gunthorpe
3095905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
3105905429aSKees Cook	bool
3115905429aSKees Cook	help
3125905429aSKees Cook	  An architecture should select this to provide hardened usercopy
3135905429aSKees Cook	  knowledge about what region of the thread_struct should be
3145905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
3155905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
3165905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
3175905429aSKees Cook	  field in task_struct will be left whitelisted.
3185905429aSKees Cook
3195aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
3205aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
3215aaeb5c0SIngo Molnar	bool
3225aaeb5c0SIngo Molnar
32351c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
32451c2ee6dSNick Desaulniers	bool
32551c2ee6dSNick Desaulniers	help
32651c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
32751c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
32851c2ee6dSNick Desaulniers	  functions and is required for correctness.
32951c2ee6dSNick Desaulniers
330942fa985SYury Norovconfig ARCH_32BIT_OFF_T
331942fa985SYury Norov	bool
332942fa985SYury Norov	depends on !64BIT
333942fa985SYury Norov	help
334942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
335942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
336942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
337942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
338942fa985SYury Norov	  architectures explicitly.
339942fa985SYury Norov
34096c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
34196c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
34296c0a6a7SHeiko Carstens	bool
34396c0a6a7SHeiko Carstens
3442ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3452ff2b7ecSMasahiro Yamada	bool
3462ff2b7ecSMasahiro Yamada	help
347a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
3482ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3492ff2b7ecSMasahiro Yamada	  exported from assembly code.
3502ff2b7ecSMasahiro Yamada
351f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
352f850c30cSHeiko Carstens	bool
353e01292b1SHeiko Carstens	help
354a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
355e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
356e01292b1SHeiko Carstens	  declared in asm/ptrace.h
357e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
358f850c30cSHeiko Carstens
359d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
360d7822b1eSMathieu Desnoyers	bool
361d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
362d7822b1eSMathieu Desnoyers	help
363d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
364d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
365d7822b1eSMathieu Desnoyers
3662f7ab126SMiguel Ojedaconfig HAVE_RUST
3672f7ab126SMiguel Ojeda	bool
3682f7ab126SMiguel Ojeda	help
3692f7ab126SMiguel Ojeda	  This symbol should be selected by an architecture if it
3702f7ab126SMiguel Ojeda	  supports Rust.
3712f7ab126SMiguel Ojeda
3723c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3733c88ee19SMasami Hiramatsu	bool
3743c88ee19SMasami Hiramatsu	help
375a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
3763c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3773c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3783c88ee19SMasami Hiramatsu
37962a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
38062a038d3SK.Prasad	bool
38199e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
38262a038d3SK.Prasad
3830102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
3840102752eSFrederic Weisbecker	bool
3850102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
3860102752eSFrederic Weisbecker	help
3870102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
3880102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
3890102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
3900102752eSFrederic Weisbecker	  them but define the access type in a control register.
3910102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
3920102752eSFrederic Weisbecker	  latter fashion.
3930102752eSFrederic Weisbecker
3947c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
3957c68af6eSAvi Kivity	bool
396a1922ed6SIngo Molnar
397c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
398c01d4323SFrederic Weisbecker	bool
39923637d47SFrederic Weisbecker	help
40023637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
40123637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
40223637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
403c01d4323SFrederic Weisbecker
40405a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
40505a4a952SNicholas Piggin	bool
40605a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
40705a4a952SNicholas Piggin	help
40805a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
40905a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
41005a4a952SNicholas Piggin
41105a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
41205a4a952SNicholas Piggin	bool
41305a4a952SNicholas Piggin	help
4141356d0b9SPetr Mladek	  The arch provides its own hardlockup detector implementation instead
4151356d0b9SPetr Mladek	  of the generic ones.
4161356d0b9SPetr Mladek
4171356d0b9SPetr Mladek	  It uses the same command line parameters, and sysctl interface,
4181356d0b9SPetr Mladek	  as the generic hardlockup detectors.
41905a4a952SNicholas Piggin
420c5e63197SJiri Olsaconfig HAVE_PERF_REGS
421c5e63197SJiri Olsa	bool
422c5e63197SJiri Olsa	help
423c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
424c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
425c5e63197SJiri Olsa
426c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
427c5ebcedbSJiri Olsa	bool
428c5ebcedbSJiri Olsa	help
429c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
430c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
431c5ebcedbSJiri Olsa	  architectures.
432c5ebcedbSJiri Olsa
433bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
434bf5438fcSJason Baron	bool
435bf5438fcSJason Baron
43650ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
43750ff18abSArd Biesheuvel	bool
43850ff18abSArd Biesheuvel
4390d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4400d6e24d4SPeter Zijlstra	bool
4410d6e24d4SPeter Zijlstra
442ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
44326723911SPeter Zijlstra	bool
4440d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
44526723911SPeter Zijlstra
4463af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
447ed6a7935SPeter Zijlstra	bool
448ed6a7935SPeter Zijlstra
44927796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
45027796d03SPeter Zijlstra	bool
4511e9fdf21SPeter Zijlstra	select MMU_GATHER_MERGE_VMAS
4521e9fdf21SPeter Zijlstra
4531e9fdf21SPeter Zijlstraconfig MMU_GATHER_NO_FLUSH_CACHE
4541e9fdf21SPeter Zijlstra	bool
4551e9fdf21SPeter Zijlstra
4561e9fdf21SPeter Zijlstraconfig MMU_GATHER_MERGE_VMAS
4571e9fdf21SPeter Zijlstra	bool
45827796d03SPeter Zijlstra
459580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
460952a31c9SMartin Schwidefsky	bool
4610d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
462952a31c9SMartin Schwidefsky
463d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
464d53c3dfbSNicholas Piggin	bool
465d53c3dfbSNicholas Piggin	help
466d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
467d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
468d53c3dfbSNicholas Piggin	  shootdowns should enable this.
469d53c3dfbSNicholas Piggin
47088e3009bSNicholas Piggin# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
47188e3009bSNicholas Piggin# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
47288e3009bSNicholas Piggin# to/from kernel threads when the same mm is running on a lot of CPUs (a large
47388e3009bSNicholas Piggin# multi-threaded application), by reducing contention on the mm refcount.
47488e3009bSNicholas Piggin#
47588e3009bSNicholas Piggin# This can be disabled if the architecture ensures no CPUs are using an mm as a
47688e3009bSNicholas Piggin# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
47788e3009bSNicholas Piggin# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
47888e3009bSNicholas Piggin# final exit(2) TLB flush, for example.
47988e3009bSNicholas Piggin#
48088e3009bSNicholas Piggin# To implement this, an arch *must*:
48188e3009bSNicholas Piggin# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
48288e3009bSNicholas Piggin# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
48388e3009bSNicholas Piggin# converted already).
48488e3009bSNicholas Pigginconfig MMU_LAZY_TLB_REFCOUNT
48588e3009bSNicholas Piggin	def_bool y
4862655421aSNicholas Piggin	depends on !MMU_LAZY_TLB_SHOOTDOWN
4872655421aSNicholas Piggin
4882655421aSNicholas Piggin# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
4892655421aSNicholas Piggin# mm as a lazy tlb beyond its last reference count, by shooting down these
4902655421aSNicholas Piggin# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
4912655421aSNicholas Piggin# be using the mm as a lazy tlb, so that they may switch themselves to using
4922655421aSNicholas Piggin# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
4932655421aSNicholas Piggin# may be using mm as a lazy tlb mm.
4942655421aSNicholas Piggin#
4952655421aSNicholas Piggin# To implement this, an arch *must*:
4962655421aSNicholas Piggin# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
4972655421aSNicholas Piggin#   at least all possible CPUs in which the mm is lazy.
4982655421aSNicholas Piggin# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
4992655421aSNicholas Pigginconfig MMU_LAZY_TLB_SHOOTDOWN
5002655421aSNicholas Piggin	bool
50188e3009bSNicholas Piggin
502df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
503df013ffbSHuang Ying	bool
504df013ffbSHuang Ying
5052e83b879SPaul E. McKenneyconfig ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
5062e83b879SPaul E. McKenney	bool
5072e83b879SPaul E. McKenney
50843570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
50943570fd2SHeiko Carstens	bool
51043570fd2SHeiko Carstens	help
51143570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
51243570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
51343570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
51443570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
51543570fd2SHeiko Carstens
5164156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
5174156153cSHeiko Carstens	bool
5184156153cSHeiko Carstens
5192565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
5202565409fSHeiko Carstens	bool
5212565409fSHeiko Carstens
52277e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
52377e58496SPaul E. McKenney	bool
52477e58496SPaul E. McKenney
525c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
526c1d7e01dSWill Deacon	bool
527c1d7e01dSWill Deacon
528c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
529c1d7e01dSWill Deacon	bool
530c1d7e01dSWill Deacon
53148b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
532c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
53348b25c43SChris Metcalf	bool
53448b25c43SChris Metcalf
535282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
536e2cfabdfSWill Drewry	bool
537e2cfabdfSWill Drewry	help
538282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
539282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
540282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
541282a181bSYiFei Zhu	  - __NR_seccomp_read_32
542282a181bSYiFei Zhu	  - __NR_seccomp_write_32
543282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
544282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
545282a181bSYiFei Zhu
546282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
547282a181bSYiFei Zhu	bool
548282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
549282a181bSYiFei Zhu	help
550fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
551282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
552bb6ea430SWill Drewry	  - syscall_get_arch()
553bb6ea430SWill Drewry	  - syscall_get_arguments()
554bb6ea430SWill Drewry	  - syscall_rollback()
555bb6ea430SWill Drewry	  - syscall_set_return_value()
556fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
557fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
558fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
559fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
56048dc92b9SKees Cook	  - seccomp syscall wired up
5610d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
5620d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
5630d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
564e2cfabdfSWill Drewry
565282a181bSYiFei Zhuconfig SECCOMP
566282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
567282a181bSYiFei Zhu	def_bool y
568282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
569282a181bSYiFei Zhu	help
570282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
571282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
572282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
573282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
574282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
575282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
576282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
577282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
578282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
579282a181bSYiFei Zhu
580282a181bSYiFei Zhu	  If unsure, say Y.
581282a181bSYiFei Zhu
582e2cfabdfSWill Drewryconfig SECCOMP_FILTER
583e2cfabdfSWill Drewry	def_bool y
584e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
585e2cfabdfSWill Drewry	help
586e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
587e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
588e2cfabdfSWill Drewry	  task-defined system call filtering polices.
589e2cfabdfSWill Drewry
5905fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
591e2cfabdfSWill Drewry
5920d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
5930d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
5940d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
5950d8315ddSYiFei Zhu	depends on PROC_FS
5960d8315ddSYiFei Zhu	help
5970d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
5980d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
5990d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
6000d8315ddSYiFei Zhu
6010d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
6020d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
6030d8315ddSYiFei Zhu
6040d8315ddSYiFei Zhu	  If unsure, say N.
6050d8315ddSYiFei Zhu
606afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
607afaef01cSAlexander Popov	bool
608afaef01cSAlexander Popov	help
609afaef01cSAlexander Popov	  An architecture should select this if it has the code which
610afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
611afaef01cSAlexander Popov	  value before returning from system calls.
612afaef01cSAlexander Popov
613d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
61419952a92SKees Cook	bool
61519952a92SKees Cook	help
61619952a92SKees Cook	  An arch should select this symbol if:
61719952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
61819952a92SKees Cook
619050e9baaSLinus Torvaldsconfig STACKPROTECTOR
6202a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
621d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
6222a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
6232a61f474SMasahiro Yamada	default y
6248779657dSKees Cook	help
6258779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
62619952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
62719952a92SKees Cook	  the stack just before the return address, and validates
62819952a92SKees Cook	  the value just before actually returning.  Stack based buffer
62919952a92SKees Cook	  overflows (that need to overwrite this return address) now also
63019952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
63119952a92SKees Cook	  neutralized via a kernel panic.
63219952a92SKees Cook
6338779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
6348779657dSKees Cook	  have an 8-byte or larger character array on the stack.
6358779657dSKees Cook
63619952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
6378779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
6388779657dSKees Cook
6398779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6408779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
6418779657dSKees Cook	  by about 0.3%.
6428779657dSKees Cook
643050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
6442a61f474SMasahiro Yamada	bool "Strong Stack Protector"
645050e9baaSLinus Torvalds	depends on STACKPROTECTOR
6462a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
6472a61f474SMasahiro Yamada	default y
6488779657dSKees Cook	help
6498779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
6508779657dSKees Cook	  of the following conditions:
6518779657dSKees Cook
6528779657dSKees Cook	  - local variable's address used as part of the right hand side of an
6538779657dSKees Cook	    assignment or function argument
6548779657dSKees Cook	  - local variable is an array (or union containing an array),
6558779657dSKees Cook	    regardless of array type or length
6568779657dSKees Cook	  - uses register local variables
6578779657dSKees Cook
6588779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
6598779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
6608779657dSKees Cook
6618779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6628779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
6638779657dSKees Cook	  size by about 2%.
6648779657dSKees Cook
665d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
666d08b9f0cSSami Tolvanen	bool
667d08b9f0cSSami Tolvanen	help
668afcf5441SDan Li	  An architecture should select this if it supports the compiler's
669afcf5441SDan Li	  Shadow Call Stack and implements runtime support for shadow stack
670aa7a65aeSWill Deacon	  switching.
671d08b9f0cSSami Tolvanen
672d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
673afcf5441SDan Li	bool "Shadow Call Stack"
674afcf5441SDan Li	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
67538792972SArd Biesheuvel	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
6766f9dc684SSamuel Holland	depends on MMU
677d08b9f0cSSami Tolvanen	help
678afcf5441SDan Li	  This option enables the compiler's Shadow Call Stack, which
679afcf5441SDan Li	  uses a shadow stack to protect function return addresses from
680afcf5441SDan Li	  being overwritten by an attacker. More information can be found
681afcf5441SDan Li	  in the compiler's documentation:
682d08b9f0cSSami Tolvanen
683afcf5441SDan Li	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
684afcf5441SDan Li	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
685d08b9f0cSSami Tolvanen
686d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
687d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
688d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
689d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
690d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
691d08b9f0cSSami Tolvanen
6929beccca0SArd Biesheuvelconfig DYNAMIC_SCS
6939beccca0SArd Biesheuvel	bool
6949beccca0SArd Biesheuvel	help
6959beccca0SArd Biesheuvel	  Set by the arch code if it relies on code patching to insert the
6969beccca0SArd Biesheuvel	  shadow call stack push and pop instructions rather than on the
6979beccca0SArd Biesheuvel	  compiler.
6989beccca0SArd Biesheuvel
699dc5723b0SSami Tolvanenconfig LTO
700dc5723b0SSami Tolvanen	bool
701dc5723b0SSami Tolvanen	help
702dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
703dc5723b0SSami Tolvanen
704dc5723b0SSami Tolvanenconfig LTO_CLANG
705dc5723b0SSami Tolvanen	bool
706dc5723b0SSami Tolvanen	select LTO
707dc5723b0SSami Tolvanen	help
708dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
709dc5723b0SSami Tolvanen
710dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
711dc5723b0SSami Tolvanen	bool
712dc5723b0SSami Tolvanen	help
713dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
714dc5723b0SSami Tolvanen	  - compiling with Clang,
715dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
716dc5723b0SSami Tolvanen	  - and linking with LLD.
717dc5723b0SSami Tolvanen
718dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
719dc5723b0SSami Tolvanen	bool
720dc5723b0SSami Tolvanen	help
721dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
722dc5723b0SSami Tolvanen	  ThinLTO mode.
723dc5723b0SSami Tolvanen
724dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
725dc5723b0SSami Tolvanen	def_bool y
7261e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
727dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
728dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
729dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
730dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
731349fde59SJakob Koschel	# https://github.com/ClangBuiltLinux/linux/issues/1721
732349fde59SJakob Koschel	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
733349fde59SJakob Koschel	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
734dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
735dc5723b0SSami Tolvanen	help
736dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
737dc5723b0SSami Tolvanen	  LTO.
738dc5723b0SSami Tolvanen
739dc5723b0SSami Tolvanenchoice
740dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
741dc5723b0SSami Tolvanen	default LTO_NONE
742dc5723b0SSami Tolvanen	help
743dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
744dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
745dc5723b0SSami Tolvanen
746dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
747dc5723b0SSami Tolvanen	  so it's disabled by default.
748dc5723b0SSami Tolvanen
749dc5723b0SSami Tolvanenconfig LTO_NONE
750dc5723b0SSami Tolvanen	bool "None"
751dc5723b0SSami Tolvanen	help
752dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
753dc5723b0SSami Tolvanen
754dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
755dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
756dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
757dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
758dc5723b0SSami Tolvanen	select LTO_CLANG
759dc5723b0SSami Tolvanen	help
760dc5723b0SSami Tolvanen	  This option enables Clang's full Link Time Optimization (LTO), which
761dc5723b0SSami Tolvanen	  allows the compiler to optimize the kernel globally. If you enable
762dc5723b0SSami Tolvanen	  this option, the compiler generates LLVM bitcode instead of ELF
763dc5723b0SSami Tolvanen	  object files, and the actual compilation from bitcode happens at
764dc5723b0SSami Tolvanen	  the LTO link step, which may take several minutes depending on the
765dc5723b0SSami Tolvanen	  kernel configuration. More information can be found from LLVM's
766dc5723b0SSami Tolvanen	  documentation:
767dc5723b0SSami Tolvanen
768dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
769dc5723b0SSami Tolvanen
770dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
771dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
772dc5723b0SSami Tolvanen
773dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
774dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
775dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
776dc5723b0SSami Tolvanen	select LTO_CLANG
777dc5723b0SSami Tolvanen	help
778dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
779dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
780dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
781dc5723b0SSami Tolvanen	  from Clang's documentation:
782dc5723b0SSami Tolvanen
783dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
784dc5723b0SSami Tolvanen
785dc5723b0SSami Tolvanen	  If unsure, say Y.
786dc5723b0SSami Tolvanenendchoice
787dc5723b0SSami Tolvanen
788cf68fffbSSami Tolvanenconfig ARCH_SUPPORTS_CFI_CLANG
789cf68fffbSSami Tolvanen	bool
790cf68fffbSSami Tolvanen	help
791cf68fffbSSami Tolvanen	  An architecture should select this option if it can support Clang's
792cf68fffbSSami Tolvanen	  Control-Flow Integrity (CFI) checking.
793cf68fffbSSami Tolvanen
79489245600SSami Tolvanenconfig ARCH_USES_CFI_TRAPS
79589245600SSami Tolvanen	bool
79689245600SSami Tolvanen
797cf68fffbSSami Tolvanenconfig CFI_CLANG
798cf68fffbSSami Tolvanen	bool "Use Clang's Control Flow Integrity (CFI)"
79989245600SSami Tolvanen	depends on ARCH_SUPPORTS_CFI_CLANG
80089245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
801cf68fffbSSami Tolvanen	help
802c4ca2276SLiu Song	  This option enables Clang's forward-edge Control Flow Integrity
803cf68fffbSSami Tolvanen	  (CFI) checking, where the compiler injects a runtime check to each
804cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
805cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
806cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
807cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
808cf68fffbSSami Tolvanen	  found from Clang's documentation:
809cf68fffbSSami Tolvanen
810cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
811cf68fffbSSami Tolvanen
812cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
813cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
814cf68fffbSSami Tolvanen	depends on CFI_CLANG
815cf68fffbSSami Tolvanen	help
816cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
817cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
818cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
819cf68fffbSSami Tolvanen
820cf68fffbSSami Tolvanen	  If unsure, say N.
821cf68fffbSSami Tolvanen
8220f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
8230f60a8efSKees Cook	bool
8240f60a8efSKees Cook	help
8250f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
8260f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
8270f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
8280f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
8290f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
8300f60a8efSKees Cook
83124a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
8322b1d5024SFrederic Weisbecker	bool
8332b1d5024SFrederic Weisbecker	help
83491d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
83591d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
836490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
837490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
838490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
8396f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
840490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
841490f561bSFrederic Weisbecker
84224a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
84383c2da2eSFrederic Weisbecker	bool
84483c2da2eSFrederic Weisbecker	help
84583c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
84683c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
84783c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
84883c2da2eSFrederic Weisbecker	  while context tracking is CONTEXT_USER. This feature reflects a sane
84983c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
85083c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
85183c2da2eSFrederic Weisbecker
85283c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
85383c2da2eSFrederic Weisbecker	    not interruptible).
854493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
85583c2da2eSFrederic Weisbecker	    got called.
85683c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
85783c2da2eSFrederic Weisbecker	    called.
85883c2da2eSFrederic Weisbecker
859490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
860490f561bSFrederic Weisbecker	bool
861490f561bSFrederic Weisbecker	help
862490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
863490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
8642b1d5024SFrederic Weisbecker
865b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
866b952741cSFrederic Weisbecker	bool
867b952741cSFrederic Weisbecker
8682b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
8692b91ec9fSFrederic Weisbecker	bool
8702b91ec9fSFrederic Weisbecker	help
8712b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
8722b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
8732b91ec9fSFrederic Weisbecker
87440565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
87540565b5aSStanislaw Gruszka	bool
87640565b5aSStanislaw Gruszka
877554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
878554b0004SKevin Hilman	bool
879554b0004SKevin Hilman	default y if 64BIT
880554b0004SKevin Hilman	help
881554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
882554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
883554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
884554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
885554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
886554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
887554b0004SKevin Hilman
888fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
889fdf9c356SFrederic Weisbecker	bool
890fdf9c356SFrederic Weisbecker	help
891fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
892fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
893fdf9c356SFrederic Weisbecker
894c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
895c49dd340SKalesh Singh	bool
896c49dd340SKalesh Singh	help
897c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
898c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
899c49dd340SKalesh Singh	  happens at the PGD level.
900c49dd340SKalesh Singh
9012c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
9022c91bd4aSJoel Fernandes (Google)	bool
9032c91bd4aSJoel Fernandes (Google)	help
9042c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
9052c91bd4aSJoel Fernandes (Google)
90615626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
90715626062SGerald Schaefer	bool
90815626062SGerald Schaefer
909a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
910a00cc7d9SMatthew Wilcox	bool
911a00cc7d9SMatthew Wilcox
9120ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
9130ddab1d2SToshi Kani	bool
9140ddab1d2SToshi Kani
915121e6f32SNicholas Piggin#
916121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
917559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
918559089e0SSong Liu#  must be used to enable allocations to use hugepages.
919121e6f32SNicholas Piggin#
920121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
921121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
922121e6f32SNicholas Piggin	bool
923121e6f32SNicholas Piggin
9243876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
9253876d4a3SAlexandre Ghiti	bool
9263876d4a3SAlexandre Ghiti
9272f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
9282f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
9292f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
9302f0584f3SRick Edgecombe	bool
9312f0584f3SRick Edgecombe
9322f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
9332f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
9342f0584f3SRick Edgecombe
9350f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
9360f8975ecSPavel Emelyanov	bool
9370f8975ecSPavel Emelyanov
938786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
939786d35d4SDavid Howells	bool
940786d35d4SDavid Howells	help
941786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
942786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
943786d35d4SDavid Howells	  should not enable this.
944786d35d4SDavid Howells
945786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
946786d35d4SDavid Howells	bool
947786d35d4SDavid Howells	help
948786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
949786d35d4SDavid Howells	  relocations will give an error.
950786d35d4SDavid Howells
951786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
952786d35d4SDavid Howells	bool
953786d35d4SDavid Howells	help
954786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
955786d35d4SDavid Howells	  relocations will give an error.
956786d35d4SDavid Howells
95701dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
95801dc0386SChristophe Leroy	bool
95901dc0386SChristophe Leroy	help
96001dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
96101dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
96201dc0386SChristophe Leroy
963cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
964cc1f0274SFrederic Weisbecker	bool
965cc1f0274SFrederic Weisbecker	help
966cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
967cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
968cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
969cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
970cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
971cc1f0274SFrederic Weisbecker	  processing.
972cc1f0274SFrederic Weisbecker
973cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
974cd1a41ceSThomas Gleixner	bool
975cd1a41ceSThomas Gleixner	help
976cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
977c226bc3cSColin Ian King	  separate stack.
978cd1a41ceSThomas Gleixner
9798cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
9808cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
9818cbb2b50SSebastian Andrzej Siewior
98212700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
98312700c17SArnd Bergmann	bool
98412700c17SArnd Bergmann	help
98512700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
98612700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
98712700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
98812700c17SArnd Bergmann
989235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
990235a8f02SKirill A. Shutemov	int
991235a8f02SKirill A. Shutemov	default 2
992235a8f02SKirill A. Shutemov
9932b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
9942b68f6caSKees Cook	bool
9952b68f6caSKees Cook	help
9962b68f6caSKees Cook	  An architecture supports choosing randomized locations for
9972b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
9982b68f6caSKees Cook	  - arch_mmap_rnd()
999204db6edSKees Cook	  - arch_randomize_brk()
10002b68f6caSKees Cook
1001d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1002d07e2259SDaniel Cashman	bool
1003d07e2259SDaniel Cashman	help
1004d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1005d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1006d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1007d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1008d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1009d07e2259SDaniel Cashman
10105f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
10115f56a5dfSJiri Slaby	bool
10125f56a5dfSJiri Slaby	help
10135f56a5dfSJiri Slaby	  An architecture implements exit_thread.
10145f56a5dfSJiri Slaby
1015d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1016d07e2259SDaniel Cashman	int
1017d07e2259SDaniel Cashman
1018d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1019d07e2259SDaniel Cashman	int
1020d07e2259SDaniel Cashman
1021d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1022d07e2259SDaniel Cashman	int
1023d07e2259SDaniel Cashman
1024d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1025d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1026d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1027d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1028d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1029d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1030d07e2259SDaniel Cashman	help
1031d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1032d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1033d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1034d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1035d07e2259SDaniel Cashman
1036d07e2259SDaniel Cashman	  This value can be changed after boot using the
1037d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1038d07e2259SDaniel Cashman
1039d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1040d07e2259SDaniel Cashman	bool
1041d07e2259SDaniel Cashman	help
1042d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1043d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1044d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1045d07e2259SDaniel Cashman	  enabled and provides values for both:
1046d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1047d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1048d07e2259SDaniel Cashman
1049d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1050d07e2259SDaniel Cashman	int
1051d07e2259SDaniel Cashman
1052d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1053d07e2259SDaniel Cashman	int
1054d07e2259SDaniel Cashman
1055d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1056d07e2259SDaniel Cashman	int
1057d07e2259SDaniel Cashman
1058d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1059d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1060d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1061d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1062d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1063d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1064d07e2259SDaniel Cashman	help
1065d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1066d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1067d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1068d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1069d07e2259SDaniel Cashman	  supported values.
1070d07e2259SDaniel Cashman
1071d07e2259SDaniel Cashman	  This value can be changed after boot using the
1072d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1073d07e2259SDaniel Cashman
10741b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
10751b028f78SDmitry Safonov	bool
10761b028f78SDmitry Safonov	help
10771b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
10781b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
10791b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
10801b028f78SDmitry Safonov
1081ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1082ba89f9c8SArnd Bergmann	bool
1083ba89f9c8SArnd Bergmann
1084ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1085ba89f9c8SArnd Bergmann	bool
1086ba89f9c8SArnd Bergmann
1087ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1088ba89f9c8SArnd Bergmann	bool
1089ba89f9c8SArnd Bergmann
1090ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1091ba89f9c8SArnd Bergmann	bool
1092ba89f9c8SArnd Bergmann
1093ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1094ba89f9c8SArnd Bergmann	bool
1095ba89f9c8SArnd Bergmann
1096ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1097ba89f9c8SArnd Bergmann	bool
1098ba89f9c8SArnd Bergmann
1099ba89f9c8SArnd Bergmannchoice
1100ba89f9c8SArnd Bergmann	prompt "MMU page size"
1101ba89f9c8SArnd Bergmann
1102ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1103ba89f9c8SArnd Bergmann	bool "4KiB pages"
1104ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1105ba89f9c8SArnd Bergmann	help
1106ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1107ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1108ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1109ba89f9c8SArnd Bergmann	  memory systems.
1110ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1111ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1112ba89f9c8SArnd Bergmann
1113ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1114ba89f9c8SArnd Bergmann	bool "8KiB pages"
1115ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1116ba89f9c8SArnd Bergmann	help
1117ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1118ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1119ba89f9c8SArnd Bergmann
1120ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1121ba89f9c8SArnd Bergmann	bool "16KiB pages"
1122ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1123ba89f9c8SArnd Bergmann	help
1124ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1125ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1126ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1127ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1128ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1129ba89f9c8SArnd Bergmann	  page cache.
1130ba89f9c8SArnd Bergmann
1131ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1132ba89f9c8SArnd Bergmann	bool "32KiB pages"
1133ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1134ba89f9c8SArnd Bergmann	help
1135ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1136ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1137ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1138ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1139ba89f9c8SArnd Bergmann	  support this.
1140ba89f9c8SArnd Bergmann
1141ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1142ba89f9c8SArnd Bergmann	bool "64KiB pages"
1143ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1144ba89f9c8SArnd Bergmann	help
1145ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1146ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1147ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1148ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1149ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1150ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1151ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1152ba89f9c8SArnd Bergmann
1153ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1154ba89f9c8SArnd Bergmann	bool "256KiB pages"
1155ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1156ba89f9c8SArnd Bergmann	help
1157ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1158ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1159ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1160ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1161ba89f9c8SArnd Bergmann
1162ba89f9c8SArnd Bergmannendchoice
1163ba89f9c8SArnd Bergmann
11641f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
11651f0e290cSGuenter Roeck	def_bool y
11661f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1167e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1168e4bbd20dSNathan Chancellor
1169e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1170e4bbd20dSNathan Chancellor	def_bool y
11711f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
11721f0e290cSGuenter Roeck
1173ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1174ba89f9c8SArnd Bergmann	int
1175ba89f9c8SArnd Bergmann	default 12 if PAGE_SIZE_4KB
1176ba89f9c8SArnd Bergmann	default 13 if PAGE_SIZE_8KB
1177ba89f9c8SArnd Bergmann	default 14 if PAGE_SIZE_16KB
1178ba89f9c8SArnd Bergmann	default 15 if PAGE_SIZE_32KB
1179ba89f9c8SArnd Bergmann	default 16 if PAGE_SIZE_64KB
1180ba89f9c8SArnd Bergmann	default 18 if PAGE_SIZE_256KB
1181ba89f9c8SArnd Bergmann
118267f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
118367f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
118467f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
118567f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
118667f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
118767f3977fSAlexandre Ghiti# - STACK_RND_MASK
118867f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
118967f3977fSAlexandre Ghiti	bool
119067f3977fSAlexandre Ghiti	depends on MMU
1191e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
119267f3977fSAlexandre Ghiti
119303f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
119403f16cd0SJosh Poimboeuf	bool
119503f16cd0SJosh Poimboeuf
11964ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
11974ab7674fSJosh Poimboeuf	bool
11984ab7674fSJosh Poimboeuf
119922102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
120022102f45SJosh Poimboeuf	bool
120122102f45SJosh Poimboeuf
1202489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1203489e355bSJosh Poimboeuf	bool
1204489e355bSJosh Poimboeuf
12055f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
12065f3da8c0SJosh Poimboeuf	bool
12075f3da8c0SJosh Poimboeuf	select OBJTOOL
12085f3da8c0SJosh Poimboeuf
1209b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1210b9ab5ebbSJosh Poimboeuf	bool
1211b9ab5ebbSJosh Poimboeuf	help
121203f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
121303f16cd0SJosh Poimboeuf	  validation.
1214b9ab5ebbSJosh Poimboeuf
1215af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1216af085d90SJosh Poimboeuf	bool
1217af085d90SJosh Poimboeuf	help
1218140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1219140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1220140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1221af085d90SJosh Poimboeuf
1222468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1223468a9428SGeorge Spelvin	bool
1224468a9428SGeorge Spelvin	default n
1225468a9428SGeorge Spelvin	help
1226468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1227468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1228468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1229468a9428SGeorge Spelvin
1230666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1231666047feSFinn Thain	bool
1232666047feSFinn Thain
12333a495511SWilliam Breathitt Grayconfig ISA_BUS_API
12343a495511SWilliam Breathitt Gray	def_bool ISA
12353a495511SWilliam Breathitt Gray
1236d2125043SAl Viro#
1237d2125043SAl Viro# ABI hall of shame
1238d2125043SAl Viro#
1239d2125043SAl Viroconfig CLONE_BACKWARDS
1240d2125043SAl Viro	bool
1241d2125043SAl Viro	help
1242d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1243d2125043SAl Viro	  not the 5th one.
1244d2125043SAl Viro
1245d2125043SAl Viroconfig CLONE_BACKWARDS2
1246d2125043SAl Viro	bool
1247d2125043SAl Viro	help
1248d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1249d2125043SAl Viro
1250dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1251dfa9771aSMichal Simek	bool
1252dfa9771aSMichal Simek	help
1253dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1254dfa9771aSMichal Simek	  not the 5th one.
1255dfa9771aSMichal Simek
1256eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1257eaca6eaeSAl Viro	bool
1258eaca6eaeSAl Viro	help
1259eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1260eaca6eaeSAl Viro
12610a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
12620a0e8cdfSAl Viro	bool
12630a0e8cdfSAl Viro	help
12640a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
12650a0e8cdfSAl Viro
12660a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
12670a0e8cdfSAl Viro	bool
12680a0e8cdfSAl Viro	help
12690a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
12700a0e8cdfSAl Viro
1271495dfbf7SAl Viroconfig OLD_SIGACTION
1272495dfbf7SAl Viro	bool
1273495dfbf7SAl Viro	help
1274495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1275495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1276495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1277495dfbf7SAl Viro	  compatibility...
1278495dfbf7SAl Viro
1279495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1280495dfbf7SAl Viro	bool
1281495dfbf7SAl Viro
128217435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1283942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1284942437c9SArnd Bergmann	default !64BIT || COMPAT
128517435e5fSDeepa Dinamani	help
128617435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
128717435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
128817435e5fSDeepa Dinamani	  as part of compat syscall handling.
128917435e5fSDeepa Dinamani
129087a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
129187a4c375SChristoph Hellwig	bool
129287a4c375SChristoph Hellwig
1293a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1294a50a3f4bSThomas Gleixner	bool
1295a50a3f4bSThomas Gleixner
1296fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1297fff7fb0bSZhaoxiu Zeng	def_bool n
1298fff7fb0bSZhaoxiu Zeng
1299ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1300ba14a194SAndy Lutomirski	def_bool n
1301ba14a194SAndy Lutomirski	help
1302ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1303ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1304ba14a194SAndy Lutomirski
1305ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1306ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1307ba14a194SAndy Lutomirski
1308ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1309ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1310ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1311ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1312ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1313ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1314ba14a194SAndy Lutomirski
1315ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1316ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1317ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1318ba14a194SAndy Lutomirski
1319ba14a194SAndy Lutomirskiconfig VMAP_STACK
1320ba14a194SAndy Lutomirski	default y
1321ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1322eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
132338dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1324a7f7f624SMasahiro Yamada	help
1325ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1326ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1327ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1328ba14a194SAndy Lutomirski	  corruption.
1329ba14a194SAndy Lutomirski
133038dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
133138dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
133238dd767dSAndrey Konovalov	  must be enabled.
1333ba14a194SAndy Lutomirski
133439218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
133539218ff4SKees Cook	def_bool n
133639218ff4SKees Cook	help
133739218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
133839218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
133939218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
134039218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
134139218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
134239218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
134339218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
134439218ff4SKees Cook	  of the static branch state.
134539218ff4SKees Cook
13468cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
13478cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
13488cb37a59SMarco Elver	default y
134939218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1350efa90c11SMarco Elver	depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
135139218ff4SKees Cook	help
135239218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
135339218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
135439218ff4SKees Cook	  attacks that depend on stack address determinism or
13558cb37a59SMarco Elver	  cross-syscall address exposures.
13568cb37a59SMarco Elver
13578cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
13588cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
13598cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
13608cb37a59SMarco Elver
13618cb37a59SMarco Elver	  If unsure, say Y.
13628cb37a59SMarco Elver
13638cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
13648cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
13658cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
13668cb37a59SMarco Elver	help
13678cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
13688cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
13698cb37a59SMarco Elver	  boot state.
137039218ff4SKees Cook
1371ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1372ad21fc4fSLaura Abbott	def_bool n
1373ad21fc4fSLaura Abbott
1374ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1375ad21fc4fSLaura Abbott	def_bool n
1376ad21fc4fSLaura Abbott
1377ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1378ad21fc4fSLaura Abbott	def_bool n
1379ad21fc4fSLaura Abbott
13800f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1381ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1382ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1383ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1384ad21fc4fSLaura Abbott	help
1385ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1386ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1387ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1388ad21fc4fSLaura Abbott	  or modifying text)
1389ad21fc4fSLaura Abbott
1390ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1391ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1392ad21fc4fSLaura Abbott
1393ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1394ad21fc4fSLaura Abbott	def_bool n
1395ad21fc4fSLaura Abbott
13960f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1397ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1398ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1399ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1400ad21fc4fSLaura Abbott	help
1401ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1402ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1403ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1404ad21fc4fSLaura Abbott
1405ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1406ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1407ea8c64acSChristoph Hellwig	bool
1408ea8c64acSChristoph Hellwig
140904f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
141004f264d3SPaul Burton	bool
141104f264d3SPaul Burton	help
141204f264d3SPaul Burton	  An architecture can select this if it provides an
141304f264d3SPaul Burton	  asm/compiler.h header that should be included after
141404f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
141504f264d3SPaul Burton	  headers generally provide.
141604f264d3SPaul Burton
1417271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1418271ca788SArd Biesheuvel	bool
1419271ca788SArd Biesheuvel	help
1420271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1421271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1422271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1423271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1424271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1425271ca788SArd Biesheuvel	  kernels.
1426271ca788SArd Biesheuvel
1427ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1428ce9084baSArd Biesheuvel	bool
1429ce9084baSArd Biesheuvel
1430fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1431fb346fd9SWaiman Long	bool "Locking event counts collection"
1432fb346fd9SWaiman Long	depends on DEBUG_FS
1433a7f7f624SMasahiro Yamada	help
1434fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1435fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1436fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1437fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1438fb346fd9SWaiman Long
14395cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
14405cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
14415cf896fbSPeter Collingbourne	bool
14425cf896fbSPeter Collingbourne
14435cf896fbSPeter Collingbourneconfig RELR
14445cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
14455cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
14465cf896fbSPeter Collingbourne	default y
14475cf896fbSPeter Collingbourne	help
14485cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
14495cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
14505cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
14515cf896fbSPeter Collingbourne	  are compatible).
14525cf896fbSPeter Collingbourne
14530c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
14540c9c1d56SThiago Jung Bauermann	bool
14550c9c1d56SThiago Jung Bauermann
145646b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
145746b49b12STom Lendacky	bool
145846b49b12STom Lendacky
14590e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
14600e242208SHassan Naveed	bool
14610e242208SHassan Naveed	help
14620e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
14630e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
14640e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
14650e242208SHassan Naveed	  related optimizations for a given architecture.
14660e242208SHassan Naveed
1467d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1468d60d7de3SSven Schnelle	bool
1469d60d7de3SSven Schnelle
1470115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1471115284d8SJosh Poimboeuf	bool
1472115284d8SJosh Poimboeuf
14739183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
14749183c3f9SJosh Poimboeuf	bool
14759183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
147603f16cd0SJosh Poimboeuf	select OBJTOOL
14779183c3f9SJosh Poimboeuf
14786ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
14796ef869e0SMichal Hocko	bool
148099cf983cSMark Rutland
148199cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
148299cf983cSMark Rutland	bool
14836ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
148499cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
14856ef869e0SMichal Hocko	help
148699cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
148799cf983cSMark Rutland	  model being selected at boot time using static calls.
148899cf983cSMark Rutland
148999cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
149099cf983cSMark Rutland	  preemption function will be patched directly.
149199cf983cSMark Rutland
149299cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
149399cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
149499cf983cSMark Rutland	  trampoline will be patched.
149599cf983cSMark Rutland
149699cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
149799cf983cSMark Rutland	  overhead.
149899cf983cSMark Rutland
149999cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
150099cf983cSMark Rutland	bool
1501a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
150299cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
150399cf983cSMark Rutland	help
150499cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
150599cf983cSMark Rutland	  model being selected at boot time using static keys.
150699cf983cSMark Rutland
150799cf983cSMark Rutland	  Each preemption function will be given an early return based on a
150899cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
150999cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
151099cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
151199cf983cSMark Rutland	  integrate better with CFI schemes.
151299cf983cSMark Rutland
151399cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
151499cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
15156ef869e0SMichal Hocko
151659612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
151759612b24SNathan Chancellor	bool
151859612b24SNathan Chancellor	help
151959612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
152059612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
152159612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
152259612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
152359612b24SNathan Chancellor	  versions.
152459612b24SNathan Chancellor
15254f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
15264f5b0c17SMike Rapoport	bool
15274f5b0c17SMike Rapoport
15285d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
15295d6ad668SMike Rapoport	bool
15305d6ad668SMike Rapoport
1531df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1532df4e817bSPasha Tatashin	bool
1533df4e817bSPasha Tatashin
15342ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
15352ca408d9SBrian Gerst	bool
15362ca408d9SBrian Gerst	help
15372ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
15382ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
15392ca408d9SBrian Gerst
15407facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
15417facdc42SAl Viro	bool
15427facdc42SAl Viro
154358e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
154458e106e7SBalbir Singh	bool
154558e106e7SBalbir Singh
1546d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1547d593d64fSPrasad Sodagudi	bool
1548d593d64fSPrasad Sodagudi
15491bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
15501bdda24cSThomas Gleixner	bool
15511bdda24cSThomas Gleixner
155250468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
155350468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
155450468e43SJarkko Sakkinen	bool
155550468e43SJarkko Sakkinen
155671ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
155771ce1ab5SKinsey Ho	bool
155871ce1ab5SKinsey Ho	help
155971ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
156071ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
156171ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
156271ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
156371ce1ab5SKinsey Ho
1564eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1565eed9a328SYu Zhao	bool
1566eed9a328SYu Zhao	help
1567eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1568eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1569eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1570eed9a328SYu Zhao	  may use this capability to reduce their search space.
1571eed9a328SYu Zhao
15722521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
157345332b1bSMasahiro Yamada
157445332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1575fa1b5d09SLinus Torvalds
1576d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1577d49a0626SPeter Zijlstra	bool
1578d49a0626SPeter Zijlstra
1579d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1580d49a0626SPeter Zijlstra	bool
1581d49a0626SPeter Zijlstra
1582d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1583d49a0626SPeter Zijlstra	bool
1584d49a0626SPeter Zijlstra
1585d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1586d49a0626SPeter Zijlstra	bool
1587d49a0626SPeter Zijlstra
1588d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1589d49a0626SPeter Zijlstra	bool
1590d49a0626SPeter Zijlstra
1591d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1592d49a0626SPeter Zijlstra	int
1593d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1594d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1595d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1596d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1597d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1598d49a0626SPeter Zijlstra	default 0
1599d49a0626SPeter Zijlstra
16005270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
16015270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
16025270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
16035270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
16045270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
16055270316cSPetr Pavlu
16065270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
16075270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
16085270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
16095270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
16105270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
16115270316cSPetr Pavlu
1612*a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1613*a88d970cSPaul E. McKenney	bool
1614*a88d970cSPaul E. McKenney
161522471e13SRandy Dunlapendmenu
1616