xref: /linux/arch/Kconfig (revision 8b8ca9c25fe69c2162e3235c7d6c341127abeed6)
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
12fe42754bSSean Christophersonconfig ARCH_CONFIGURES_CPU_MITIGATIONS
13fe42754bSSean Christopherson	bool
14fe42754bSSean Christopherson
15fe42754bSSean Christophersonif !ARCH_CONFIGURES_CPU_MITIGATIONS
16fe42754bSSean Christophersonconfig CPU_MITIGATIONS
17fe42754bSSean Christopherson	def_bool y
18fe42754bSSean Christophersonendif
19fe42754bSSean Christopherson
20de6c85bfSChristoph Hellwig#
21de6c85bfSChristoph Hellwig# Selected by architectures that need custom DMA operations for e.g. legacy
22de6c85bfSChristoph Hellwig# IOMMUs not handled by dma-iommu.  Drivers must never select this symbol.
23de6c85bfSChristoph Hellwig#
24de6c85bfSChristoph Hellwigconfig ARCH_HAS_DMA_OPS
25de6c85bfSChristoph Hellwig	depends on HAS_DMA
26de6c85bfSChristoph Hellwig	select DMA_OPS_HELPERS
27de6c85bfSChristoph Hellwig	bool
28de6c85bfSChristoph Hellwig
2922471e13SRandy Dunlapmenu "General architecture-dependent options"
3022471e13SRandy Dunlap
31da32b581SCatalin Marinasconfig ARCH_HAS_SUBPAGE_FAULTS
32da32b581SCatalin Marinas	bool
33da32b581SCatalin Marinas	help
34da32b581SCatalin Marinas	  Select if the architecture can check permissions at sub-page
35da32b581SCatalin Marinas	  granularity (e.g. arm64 MTE). The probe_user_*() functions
36da32b581SCatalin Marinas	  must be implemented.
37da32b581SCatalin Marinas
3805736e4aSThomas Gleixnerconfig HOTPLUG_SMT
3905736e4aSThomas Gleixner	bool
4005736e4aSThomas Gleixner
4138253464SMichael Ellermanconfig SMT_NUM_THREADS_DYNAMIC
4238253464SMichael Ellerman	bool
4338253464SMichael Ellerman
446f062123SThomas Gleixner# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
456f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC
466f062123SThomas Gleixner	bool
476f062123SThomas Gleixner
486f062123SThomas Gleixner# Basic CPU dead synchronization selected by architecture
496f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_DEAD
506f062123SThomas Gleixner	bool
516f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
526f062123SThomas Gleixner
536f062123SThomas Gleixner# Full CPU synchronization with alive state selected by architecture
546f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_FULL
556f062123SThomas Gleixner	bool
566f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
576f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
586f062123SThomas Gleixner
59a631be92SThomas Gleixnerconfig HOTPLUG_SPLIT_STARTUP
60a631be92SThomas Gleixner	bool
61a631be92SThomas Gleixner	select HOTPLUG_CORE_SYNC_FULL
62a631be92SThomas Gleixner
6318415f33SThomas Gleixnerconfig HOTPLUG_PARALLEL
6418415f33SThomas Gleixner	bool
6518415f33SThomas Gleixner	select HOTPLUG_SPLIT_STARTUP
6618415f33SThomas Gleixner
67142781e1SThomas Gleixnerconfig GENERIC_ENTRY
68142781e1SThomas Gleixner	bool
69142781e1SThomas Gleixner
70125e5645SMathieu Desnoyersconfig KPROBES
71125e5645SMathieu Desnoyers	bool "Kprobes"
72125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
7305ed160eSMasami Hiramatsu	select KALLSYMS
747582b7beSMike Rapoport (IBM)	select EXECMEM
75900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
76125e5645SMathieu Desnoyers	help
77125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
78125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
79125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
80125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
81125e5645SMathieu Desnoyers	  If in doubt, say "N".
82125e5645SMathieu Desnoyers
8345f81b1cSSteven Rostedtconfig JUMP_LABEL
84c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
8545f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
864ab7674fSJosh Poimboeuf	select OBJTOOL if HAVE_JUMP_LABEL_HACK
8745f81b1cSSteven Rostedt	help
88c5905afbSIngo Molnar	  This option enables a transparent branch optimization that
89c5905afbSIngo Molnar	  makes certain almost-always-true or almost-always-false branch
90c5905afbSIngo Molnar	  conditions even cheaper to execute within the kernel.
9145f81b1cSSteven Rostedt
92c5905afbSIngo Molnar	  Certain performance-sensitive kernel code, such as trace points,
93c5905afbSIngo Molnar	  scheduler functionality, networking code and KVM have such
94c5905afbSIngo Molnar	  branches and include support for this optimization technique.
95c5905afbSIngo Molnar
96c5905afbSIngo Molnar	  If it is detected that the compiler has support for "asm goto",
97c5905afbSIngo Molnar	  the kernel will compile such branches with just a nop
98c5905afbSIngo Molnar	  instruction. When the condition flag is toggled to true, the
99c5905afbSIngo Molnar	  nop will be converted to a jump instruction to execute the
100c5905afbSIngo Molnar	  conditional block of instructions.
101c5905afbSIngo Molnar
102c5905afbSIngo Molnar	  This technique lowers overhead and stress on the branch prediction
103c5905afbSIngo Molnar	  of the processor and generally makes the kernel faster. The update
104c5905afbSIngo Molnar	  of the condition is slower, but those are always very rare.
105c5905afbSIngo Molnar
106c5905afbSIngo Molnar	  ( On 32-bit x86, the necessary options added to the compiler
107c5905afbSIngo Molnar	    flags may increase the size of the kernel slightly. )
10845f81b1cSSteven Rostedt
1091987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
1101987c947SPeter Zijlstra	bool "Static key selftest"
1111987c947SPeter Zijlstra	depends on JUMP_LABEL
1121987c947SPeter Zijlstra	help
1131987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
1141987c947SPeter Zijlstra
115f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
116f03c4129SPeter Zijlstra	bool "Static call selftest"
117f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
118f03c4129SPeter Zijlstra	help
119f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
120f03c4129SPeter Zijlstra
121afd66255SMasami Hiramatsuconfig OPTPROBES
1225cc718b9SMasami Hiramatsu	def_bool y
1235cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
124900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
125afd66255SMasami Hiramatsu
126e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
127e7dbfe34SMasami Hiramatsu	def_bool y
128e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
129e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
130e7dbfe34SMasami Hiramatsu	help
131e7dbfe34SMasami Hiramatsu	  If function tracer is enabled and the arch supports full
132e7dbfe34SMasami Hiramatsu	  passing of pt_regs to function tracing, then kprobes can
133e7dbfe34SMasami Hiramatsu	  optimize on top of function tracing.
134e7dbfe34SMasami Hiramatsu
1352b144498SSrikar Dronamrajuconfig UPROBES
13609294e31SDavid A. Long	def_bool n
137e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
1382b144498SSrikar Dronamraju	help
1397b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1407b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1417b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1427b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1437b2d81d4SIngo Molnar	  are hit by user-space applications.
1447b2d81d4SIngo Molnar
1457b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1467b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1477b2d81d4SIngo Molnar	    application. )
1482b144498SSrikar Dronamraju
149adab66b7SSteven Rostedt (VMware)config HAVE_64BIT_ALIGNED_ACCESS
150adab66b7SSteven Rostedt (VMware)	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
151adab66b7SSteven Rostedt (VMware)	help
152adab66b7SSteven Rostedt (VMware)	  Some architectures require 64 bit accesses to be 64 bit
153adab66b7SSteven Rostedt (VMware)	  aligned, which also requires structs containing 64 bit values
154adab66b7SSteven Rostedt (VMware)	  to be 64 bit aligned too. This includes some 32 bit
155adab66b7SSteven Rostedt (VMware)	  architectures which can do 64 bit accesses, as well as 64 bit
156adab66b7SSteven Rostedt (VMware)	  architectures without unaligned access.
157adab66b7SSteven Rostedt (VMware)
158adab66b7SSteven Rostedt (VMware)	  This symbol should be selected by an architecture if 64 bit
159adab66b7SSteven Rostedt (VMware)	  accesses are required to be 64 bit aligned in this way even
160adab66b7SSteven Rostedt (VMware)	  though it is not a 64 bit architecture.
161adab66b7SSteven Rostedt (VMware)
162ba1a297dSLukas Bulwahn	  See Documentation/core-api/unaligned-memory-access.rst for
163ba1a297dSLukas Bulwahn	  more information on the topic of unaligned memory accesses.
164adab66b7SSteven Rostedt (VMware)
16558340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1669ba16087SJan Beulich	bool
16758340a07SJohannes Berg	help
16858340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
16958340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
17058340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
17158340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
17258340a07SJohannes Berg	  handler.)
17358340a07SJohannes Berg
17458340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
17558340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
17658340a07SJohannes Berg	  code paths to be selected for these cases. Some network
17758340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
17858340a07SJohannes Berg	  problems with received packets if doing so would not help
17958340a07SJohannes Berg	  much.
18058340a07SJohannes Berg
181c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
18258340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
18358340a07SJohannes Berg
184cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
185cf66bb93SDavid Woodhouse	bool
186cf66bb93SDavid Woodhouse	help
187cf66bb93SDavid Woodhouse	  Modern versions of GCC (since 4.4) have builtin functions
188cf66bb93SDavid Woodhouse	  for handling byte-swapping. Using these, instead of the old
189cf66bb93SDavid Woodhouse	  inline assembler that the architecture code provides in the
190cf66bb93SDavid Woodhouse	  __arch_bswapXX() macros, allows the compiler to see what's
191cf66bb93SDavid Woodhouse	  happening and offers more opportunity for optimisation. In
192cf66bb93SDavid Woodhouse	  particular, the compiler will be able to combine the byteswap
193cf66bb93SDavid Woodhouse	  with a nearby load or store and use load-and-swap or
194cf66bb93SDavid Woodhouse	  store-and-swap instructions if the architecture has them. It
195cf66bb93SDavid Woodhouse	  should almost *never* result in code which is worse than the
196cf66bb93SDavid Woodhouse	  hand-coded assembler in <asm/swab.h>.  But just in case it
197cf66bb93SDavid Woodhouse	  does, the use of the builtins is optional.
198cf66bb93SDavid Woodhouse
199cf66bb93SDavid Woodhouse	  Any architecture with load-and-swap or store-and-swap
200cf66bb93SDavid Woodhouse	  instructions should set this. And it shouldn't hurt to set it
201cf66bb93SDavid Woodhouse	  on architectures that don't have such instructions.
202cf66bb93SDavid Woodhouse
2039edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
2049edddaa2SAnanth N Mavinakayanahalli	def_bool y
20573f9b911SMasami Hiramatsu	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
20673f9b911SMasami Hiramatsu
20773f9b911SMasami Hiramatsuconfig KRETPROBE_ON_RETHOOK
20873f9b911SMasami Hiramatsu	def_bool y
20973f9b911SMasami Hiramatsu	depends on HAVE_RETHOOK
21073f9b911SMasami Hiramatsu	depends on KRETPROBES
21173f9b911SMasami Hiramatsu	select RETHOOK
2129edddaa2SAnanth N Mavinakayanahalli
2137c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
2147c68af6eSAvi Kivity	bool
2157c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
2167c68af6eSAvi Kivity	help
2177c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
2187c68af6eSAvi Kivity	  switch to user mode.
2197c68af6eSAvi Kivity
22028b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
2219ba16087SJan Beulich	bool
22228b2ee20SRik van Riel
223125e5645SMathieu Desnoyersconfig HAVE_KPROBES
2249ba16087SJan Beulich	bool
2259edddaa2SAnanth N Mavinakayanahalli
2269edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2279ba16087SJan Beulich	bool
22874bc7ceeSArthur Kepner
229afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
230afd66255SMasami Hiramatsu	bool
231d314d74cSCong Wang
232e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
233e7dbfe34SMasami Hiramatsu	bool
234e7dbfe34SMasami Hiramatsu
2351f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2361f6d3a8fSMasami Hiramatsu	bool
2371f6d3a8fSMasami Hiramatsu	help
2381f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
2391f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
2401f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2411f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2421f6d3a8fSMasami Hiramatsu
243540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2449802d865SJosef Bacik	bool
2459802d865SJosef Bacik
24642a0bb3fSPetr Mladekconfig HAVE_NMI
24742a0bb3fSPetr Mladek	bool
24842a0bb3fSPetr Mladek
249a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
250a257caccSChristophe Leroy	bool
251a257caccSChristophe Leroy
2524aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
2534aae683fSMasahiro Yamada	bool
2544aae683fSMasahiro Yamada
2554510bffbSMark Rutlandconfig TRACE_IRQFLAGS_NMI_SUPPORT
2564510bffbSMark Rutland	bool
2574510bffbSMark Rutland
2581f5a4ad9SRoland McGrath#
2591f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2601f5a4ad9SRoland McGrath#
2611f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2621f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2631f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2641f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2651f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2661f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
267153474baSEric W. Biederman#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
26803248addSEric W. Biederman#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
2691f5a4ad9SRoland McGrath#
2701f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2719ba16087SJan Beulich	bool
2721f5a4ad9SRoland McGrath
273c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
274c64be2bbSMarek Szyprowski	bool
275c64be2bbSMarek Szyprowski
27629d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
27729d5e047SThomas Gleixner	bool
27829d5e047SThomas Gleixner
279485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
280485cf5daSKevin Hilman	bool
281485cf5daSKevin Hilman
2826974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2836974f0c4SDaniel Micay	bool
2846974f0c4SDaniel Micay	help
2856974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2866974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2876974f0c4SDaniel Micay
288d8ae8a37SChristoph Hellwig#
289d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
290d8ae8a37SChristoph Hellwig# command line option
291d8ae8a37SChristoph Hellwig#
292d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
293d8ae8a37SChristoph Hellwig	bool
294d8ae8a37SChristoph Hellwig
295d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
296d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
297d2852a22SDaniel Borkmann	bool
298d2852a22SDaniel Borkmann
299d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
300d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
301d253ca0cSRick Edgecombe	bool
302d253ca0cSRick Edgecombe
303c30700dbSChristoph Hellwig#
304fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
305a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
306fa7e2247SChristoph Hellwig# to remap the page tables in place.
307c30700dbSChristoph Hellwig#
308fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
309c30700dbSChristoph Hellwig	bool
310c30700dbSChristoph Hellwig
311999a5d12SChristoph Hellwig#
312999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
313999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
314999a5d12SChristoph Hellwig#
315999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
316f5e10287SThomas Gleixner	bool
317f5e10287SThomas Gleixner
3187725acaaSThomas Gleixnerconfig ARCH_HAS_CPU_FINALIZE_INIT
3197725acaaSThomas Gleixner	bool
3207725acaaSThomas Gleixner
3218f23f5dbSJason Gunthorpe# The architecture has a per-task state that includes the mm's PASID
3228f23f5dbSJason Gunthorpeconfig ARCH_HAS_CPU_PASID
3238f23f5dbSJason Gunthorpe	bool
3248f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
3258f23f5dbSJason Gunthorpe
3265905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
3275905429aSKees Cook	bool
3285905429aSKees Cook	help
3295905429aSKees Cook	  An architecture should select this to provide hardened usercopy
3305905429aSKees Cook	  knowledge about what region of the thread_struct should be
3315905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
3325905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
3335905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
3345905429aSKees Cook	  field in task_struct will be left whitelisted.
3355905429aSKees Cook
3365aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
3375aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
3385aaeb5c0SIngo Molnar	bool
3395aaeb5c0SIngo Molnar
34051c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
34151c2ee6dSNick Desaulniers	bool
34251c2ee6dSNick Desaulniers	help
34351c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
34451c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
34551c2ee6dSNick Desaulniers	  functions and is required for correctness.
34651c2ee6dSNick Desaulniers
347942fa985SYury Norovconfig ARCH_32BIT_OFF_T
348942fa985SYury Norov	bool
349942fa985SYury Norov	depends on !64BIT
350942fa985SYury Norov	help
351942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
352942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
353942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
354942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
355942fa985SYury Norov	  architectures explicitly.
356942fa985SYury Norov
35796c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
35896c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
35996c0a6a7SHeiko Carstens	bool
36096c0a6a7SHeiko Carstens
3612ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3622ff2b7ecSMasahiro Yamada	bool
3632ff2b7ecSMasahiro Yamada	help
364a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
3652ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3662ff2b7ecSMasahiro Yamada	  exported from assembly code.
3672ff2b7ecSMasahiro Yamada
368f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
369f850c30cSHeiko Carstens	bool
370e01292b1SHeiko Carstens	help
371a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
372e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
373e01292b1SHeiko Carstens	  declared in asm/ptrace.h
374e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
375f850c30cSHeiko Carstens
376d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
377d7822b1eSMathieu Desnoyers	bool
378d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
379d7822b1eSMathieu Desnoyers	help
380d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
381d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
382d7822b1eSMathieu Desnoyers
3832f7ab126SMiguel Ojedaconfig HAVE_RUST
3842f7ab126SMiguel Ojeda	bool
3852f7ab126SMiguel Ojeda	help
3862f7ab126SMiguel Ojeda	  This symbol should be selected by an architecture if it
3872f7ab126SMiguel Ojeda	  supports Rust.
3882f7ab126SMiguel Ojeda
3893c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
3903c88ee19SMasami Hiramatsu	bool
3913c88ee19SMasami Hiramatsu	help
392a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
3933c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
3943c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
3953c88ee19SMasami Hiramatsu
39662a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
39762a038d3SK.Prasad	bool
39899e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
39962a038d3SK.Prasad
4000102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
4010102752eSFrederic Weisbecker	bool
4020102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
4030102752eSFrederic Weisbecker	help
4040102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
4050102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
4060102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
4070102752eSFrederic Weisbecker	  them but define the access type in a control register.
4080102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
4090102752eSFrederic Weisbecker	  latter fashion.
4100102752eSFrederic Weisbecker
4117c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
4127c68af6eSAvi Kivity	bool
413a1922ed6SIngo Molnar
414c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
415c01d4323SFrederic Weisbecker	bool
41623637d47SFrederic Weisbecker	help
41723637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
41823637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
41923637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
420c01d4323SFrederic Weisbecker
42105a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
42205a4a952SNicholas Piggin	bool
42305a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
42405a4a952SNicholas Piggin	help
42505a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
42605a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
42705a4a952SNicholas Piggin
42805a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
42905a4a952SNicholas Piggin	bool
43005a4a952SNicholas Piggin	help
4311356d0b9SPetr Mladek	  The arch provides its own hardlockup detector implementation instead
4321356d0b9SPetr Mladek	  of the generic ones.
4331356d0b9SPetr Mladek
4341356d0b9SPetr Mladek	  It uses the same command line parameters, and sysctl interface,
4351356d0b9SPetr Mladek	  as the generic hardlockup detectors.
43605a4a952SNicholas Piggin
437c5e63197SJiri Olsaconfig HAVE_PERF_REGS
438c5e63197SJiri Olsa	bool
439c5e63197SJiri Olsa	help
440c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
441c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
442c5e63197SJiri Olsa
443c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
444c5ebcedbSJiri Olsa	bool
445c5ebcedbSJiri Olsa	help
446c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
447c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
448c5ebcedbSJiri Olsa	  architectures.
449c5ebcedbSJiri Olsa
450bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
451bf5438fcSJason Baron	bool
452bf5438fcSJason Baron
45350ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
45450ff18abSArd Biesheuvel	bool
45550ff18abSArd Biesheuvel
4560d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4570d6e24d4SPeter Zijlstra	bool
4580d6e24d4SPeter Zijlstra
459ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
46026723911SPeter Zijlstra	bool
4610d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
46226723911SPeter Zijlstra
4633af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
464ed6a7935SPeter Zijlstra	bool
465ed6a7935SPeter Zijlstra
46627796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
46727796d03SPeter Zijlstra	bool
4681e9fdf21SPeter Zijlstra	select MMU_GATHER_MERGE_VMAS
4691e9fdf21SPeter Zijlstra
4701e9fdf21SPeter Zijlstraconfig MMU_GATHER_NO_FLUSH_CACHE
4711e9fdf21SPeter Zijlstra	bool
4721e9fdf21SPeter Zijlstra
4731e9fdf21SPeter Zijlstraconfig MMU_GATHER_MERGE_VMAS
4741e9fdf21SPeter Zijlstra	bool
47527796d03SPeter Zijlstra
476580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
477952a31c9SMartin Schwidefsky	bool
4780d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
479952a31c9SMartin Schwidefsky
480d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
481d53c3dfbSNicholas Piggin	bool
482d53c3dfbSNicholas Piggin	help
483d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
484d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
485d53c3dfbSNicholas Piggin	  shootdowns should enable this.
486d53c3dfbSNicholas Piggin
48788e3009bSNicholas Piggin# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
48888e3009bSNicholas Piggin# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
48988e3009bSNicholas Piggin# to/from kernel threads when the same mm is running on a lot of CPUs (a large
49088e3009bSNicholas Piggin# multi-threaded application), by reducing contention on the mm refcount.
49188e3009bSNicholas Piggin#
49288e3009bSNicholas Piggin# This can be disabled if the architecture ensures no CPUs are using an mm as a
49388e3009bSNicholas Piggin# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
49488e3009bSNicholas Piggin# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
49588e3009bSNicholas Piggin# final exit(2) TLB flush, for example.
49688e3009bSNicholas Piggin#
49788e3009bSNicholas Piggin# To implement this, an arch *must*:
49888e3009bSNicholas Piggin# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
49988e3009bSNicholas Piggin# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
50088e3009bSNicholas Piggin# converted already).
50188e3009bSNicholas Pigginconfig MMU_LAZY_TLB_REFCOUNT
50288e3009bSNicholas Piggin	def_bool y
5032655421aSNicholas Piggin	depends on !MMU_LAZY_TLB_SHOOTDOWN
5042655421aSNicholas Piggin
5052655421aSNicholas Piggin# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
5062655421aSNicholas Piggin# mm as a lazy tlb beyond its last reference count, by shooting down these
5072655421aSNicholas Piggin# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
5082655421aSNicholas Piggin# be using the mm as a lazy tlb, so that they may switch themselves to using
5092655421aSNicholas Piggin# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
5102655421aSNicholas Piggin# may be using mm as a lazy tlb mm.
5112655421aSNicholas Piggin#
5122655421aSNicholas Piggin# To implement this, an arch *must*:
5132655421aSNicholas Piggin# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
5142655421aSNicholas Piggin#   at least all possible CPUs in which the mm is lazy.
5152655421aSNicholas Piggin# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
5162655421aSNicholas Pigginconfig MMU_LAZY_TLB_SHOOTDOWN
5172655421aSNicholas Piggin	bool
51888e3009bSNicholas Piggin
519df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
520df013ffbSHuang Ying	bool
521df013ffbSHuang Ying
522a9c3475dSVignesh Balasubramanianconfig ARCH_HAVE_EXTRA_ELF_NOTES
523a9c3475dSVignesh Balasubramanian	bool
524a9c3475dSVignesh Balasubramanian	help
525a9c3475dSVignesh Balasubramanian	  An architecture should select this in order to enable adding an
526a9c3475dSVignesh Balasubramanian	  arch-specific ELF note section to core files. It must provide two
527a9c3475dSVignesh Balasubramanian	  functions: elf_coredump_extra_notes_size() and
528a9c3475dSVignesh Balasubramanian	  elf_coredump_extra_notes_write() which are invoked by the ELF core
529a9c3475dSVignesh Balasubramanian	  dumper.
530a9c3475dSVignesh Balasubramanian
5312e83b879SPaul E. McKenneyconfig ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
5322e83b879SPaul E. McKenney	bool
5332e83b879SPaul E. McKenney
53443570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
53543570fd2SHeiko Carstens	bool
53643570fd2SHeiko Carstens	help
53743570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
53843570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
53943570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
54043570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
54143570fd2SHeiko Carstens
5424156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
5434156153cSHeiko Carstens	bool
5444156153cSHeiko Carstens
5452565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
5462565409fSHeiko Carstens	bool
5472565409fSHeiko Carstens
54877e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
54977e58496SPaul E. McKenney	bool
55077e58496SPaul E. McKenney
551c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
552c1d7e01dSWill Deacon	bool
553c1d7e01dSWill Deacon
554c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
555c1d7e01dSWill Deacon	bool
556c1d7e01dSWill Deacon
55748b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
558c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
55948b25c43SChris Metcalf	bool
56048b25c43SChris Metcalf
561282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
562e2cfabdfSWill Drewry	bool
563e2cfabdfSWill Drewry	help
564282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
565282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
566282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
567282a181bSYiFei Zhu	  - __NR_seccomp_read_32
568282a181bSYiFei Zhu	  - __NR_seccomp_write_32
569282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
570282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
571282a181bSYiFei Zhu
572282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
573282a181bSYiFei Zhu	bool
574282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
575282a181bSYiFei Zhu	help
576fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
577282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
578bb6ea430SWill Drewry	  - syscall_get_arch()
579bb6ea430SWill Drewry	  - syscall_get_arguments()
580bb6ea430SWill Drewry	  - syscall_rollback()
581bb6ea430SWill Drewry	  - syscall_set_return_value()
582fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
583fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
584fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
585fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
58648dc92b9SKees Cook	  - seccomp syscall wired up
5870d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
5880d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
5890d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
590e2cfabdfSWill Drewry
591282a181bSYiFei Zhuconfig SECCOMP
592282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
593282a181bSYiFei Zhu	def_bool y
594282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
595282a181bSYiFei Zhu	help
596282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
597282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
598282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
599282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
600282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
601282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
602282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
603282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
604282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
605282a181bSYiFei Zhu
606282a181bSYiFei Zhu	  If unsure, say Y.
607282a181bSYiFei Zhu
608e2cfabdfSWill Drewryconfig SECCOMP_FILTER
609e2cfabdfSWill Drewry	def_bool y
610e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
611e2cfabdfSWill Drewry	help
612e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
613e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
614e2cfabdfSWill Drewry	  task-defined system call filtering polices.
615e2cfabdfSWill Drewry
6165fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
617e2cfabdfSWill Drewry
6180d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
6190d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
6200d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
6210d8315ddSYiFei Zhu	depends on PROC_FS
6220d8315ddSYiFei Zhu	help
6230d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
6240d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
6250d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
6260d8315ddSYiFei Zhu
6270d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
6280d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
6290d8315ddSYiFei Zhu
6300d8315ddSYiFei Zhu	  If unsure, say N.
6310d8315ddSYiFei Zhu
632afaef01cSAlexander Popovconfig HAVE_ARCH_STACKLEAK
633afaef01cSAlexander Popov	bool
634afaef01cSAlexander Popov	help
635afaef01cSAlexander Popov	  An architecture should select this if it has the code which
636afaef01cSAlexander Popov	  fills the used part of the kernel stack with the STACKLEAK_POISON
637afaef01cSAlexander Popov	  value before returning from system calls.
638afaef01cSAlexander Popov
639d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
64019952a92SKees Cook	bool
64119952a92SKees Cook	help
64219952a92SKees Cook	  An arch should select this symbol if:
64319952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
64419952a92SKees Cook
645050e9baaSLinus Torvaldsconfig STACKPROTECTOR
6462a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
647d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
6482a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
6492a61f474SMasahiro Yamada	default y
6508779657dSKees Cook	help
6518779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
65219952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
65319952a92SKees Cook	  the stack just before the return address, and validates
65419952a92SKees Cook	  the value just before actually returning.  Stack based buffer
65519952a92SKees Cook	  overflows (that need to overwrite this return address) now also
65619952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
65719952a92SKees Cook	  neutralized via a kernel panic.
65819952a92SKees Cook
6598779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
6608779657dSKees Cook	  have an 8-byte or larger character array on the stack.
6618779657dSKees Cook
66219952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
6638779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
6648779657dSKees Cook
6658779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6668779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
6678779657dSKees Cook	  by about 0.3%.
6688779657dSKees Cook
669050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
6702a61f474SMasahiro Yamada	bool "Strong Stack Protector"
671050e9baaSLinus Torvalds	depends on STACKPROTECTOR
6722a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
6732a61f474SMasahiro Yamada	default y
6748779657dSKees Cook	help
6758779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
6768779657dSKees Cook	  of the following conditions:
6778779657dSKees Cook
6788779657dSKees Cook	  - local variable's address used as part of the right hand side of an
6798779657dSKees Cook	    assignment or function argument
6808779657dSKees Cook	  - local variable is an array (or union containing an array),
6818779657dSKees Cook	    regardless of array type or length
6828779657dSKees Cook	  - uses register local variables
6838779657dSKees Cook
6848779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
6858779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
6868779657dSKees Cook
6878779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6888779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
6898779657dSKees Cook	  size by about 2%.
6908779657dSKees Cook
691d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
692d08b9f0cSSami Tolvanen	bool
693d08b9f0cSSami Tolvanen	help
694afcf5441SDan Li	  An architecture should select this if it supports the compiler's
695afcf5441SDan Li	  Shadow Call Stack and implements runtime support for shadow stack
696aa7a65aeSWill Deacon	  switching.
697d08b9f0cSSami Tolvanen
698d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
699afcf5441SDan Li	bool "Shadow Call Stack"
700afcf5441SDan Li	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
70138792972SArd Biesheuvel	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
7026f9dc684SSamuel Holland	depends on MMU
703d08b9f0cSSami Tolvanen	help
704afcf5441SDan Li	  This option enables the compiler's Shadow Call Stack, which
705afcf5441SDan Li	  uses a shadow stack to protect function return addresses from
706afcf5441SDan Li	  being overwritten by an attacker. More information can be found
707afcf5441SDan Li	  in the compiler's documentation:
708d08b9f0cSSami Tolvanen
709afcf5441SDan Li	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
710afcf5441SDan Li	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
711d08b9f0cSSami Tolvanen
712d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
713d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
714d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
715d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
716d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
717d08b9f0cSSami Tolvanen
7189beccca0SArd Biesheuvelconfig DYNAMIC_SCS
7199beccca0SArd Biesheuvel	bool
7209beccca0SArd Biesheuvel	help
7219beccca0SArd Biesheuvel	  Set by the arch code if it relies on code patching to insert the
7229beccca0SArd Biesheuvel	  shadow call stack push and pop instructions rather than on the
7239beccca0SArd Biesheuvel	  compiler.
7249beccca0SArd Biesheuvel
725dc5723b0SSami Tolvanenconfig LTO
726dc5723b0SSami Tolvanen	bool
727dc5723b0SSami Tolvanen	help
728dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
729dc5723b0SSami Tolvanen
730dc5723b0SSami Tolvanenconfig LTO_CLANG
731dc5723b0SSami Tolvanen	bool
732dc5723b0SSami Tolvanen	select LTO
733dc5723b0SSami Tolvanen	help
734dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
735dc5723b0SSami Tolvanen
736dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
737dc5723b0SSami Tolvanen	bool
738dc5723b0SSami Tolvanen	help
739dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
740dc5723b0SSami Tolvanen	  - compiling with Clang,
741dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
742dc5723b0SSami Tolvanen	  - and linking with LLD.
743dc5723b0SSami Tolvanen
744dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
745dc5723b0SSami Tolvanen	bool
746dc5723b0SSami Tolvanen	help
747dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
748dc5723b0SSami Tolvanen	  ThinLTO mode.
749dc5723b0SSami Tolvanen
750dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
751dc5723b0SSami Tolvanen	def_bool y
7521e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
753dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
754dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
755dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
756dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
757349fde59SJakob Koschel	# https://github.com/ClangBuiltLinux/linux/issues/1721
758349fde59SJakob Koschel	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
759349fde59SJakob Koschel	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
760dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
761dc5723b0SSami Tolvanen	help
762dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
763dc5723b0SSami Tolvanen	  LTO.
764dc5723b0SSami Tolvanen
765dc5723b0SSami Tolvanenchoice
766dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
767dc5723b0SSami Tolvanen	default LTO_NONE
768dc5723b0SSami Tolvanen	help
769dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
770dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
771dc5723b0SSami Tolvanen
772dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
773dc5723b0SSami Tolvanen	  so it's disabled by default.
774dc5723b0SSami Tolvanen
775dc5723b0SSami Tolvanenconfig LTO_NONE
776dc5723b0SSami Tolvanen	bool "None"
777dc5723b0SSami Tolvanen	help
778dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
779dc5723b0SSami Tolvanen
780dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
781dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
782dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
783dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
784dc5723b0SSami Tolvanen	select LTO_CLANG
785dc5723b0SSami Tolvanen	help
786dc5723b0SSami Tolvanen	  This option enables Clang's full Link Time Optimization (LTO), which
787dc5723b0SSami Tolvanen	  allows the compiler to optimize the kernel globally. If you enable
788dc5723b0SSami Tolvanen	  this option, the compiler generates LLVM bitcode instead of ELF
789dc5723b0SSami Tolvanen	  object files, and the actual compilation from bitcode happens at
790dc5723b0SSami Tolvanen	  the LTO link step, which may take several minutes depending on the
791dc5723b0SSami Tolvanen	  kernel configuration. More information can be found from LLVM's
792dc5723b0SSami Tolvanen	  documentation:
793dc5723b0SSami Tolvanen
794dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
795dc5723b0SSami Tolvanen
796dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
797dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
798dc5723b0SSami Tolvanen
799dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
800dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
801dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
802dc5723b0SSami Tolvanen	select LTO_CLANG
803dc5723b0SSami Tolvanen	help
804dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
805dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
806dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
807dc5723b0SSami Tolvanen	  from Clang's documentation:
808dc5723b0SSami Tolvanen
809dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
810dc5723b0SSami Tolvanen
811dc5723b0SSami Tolvanen	  If unsure, say Y.
812dc5723b0SSami Tolvanenendchoice
813dc5723b0SSami Tolvanen
814cf68fffbSSami Tolvanenconfig ARCH_SUPPORTS_CFI_CLANG
815cf68fffbSSami Tolvanen	bool
816cf68fffbSSami Tolvanen	help
817cf68fffbSSami Tolvanen	  An architecture should select this option if it can support Clang's
818cf68fffbSSami Tolvanen	  Control-Flow Integrity (CFI) checking.
819cf68fffbSSami Tolvanen
82089245600SSami Tolvanenconfig ARCH_USES_CFI_TRAPS
82189245600SSami Tolvanen	bool
82289245600SSami Tolvanen
823cf68fffbSSami Tolvanenconfig CFI_CLANG
824cf68fffbSSami Tolvanen	bool "Use Clang's Control Flow Integrity (CFI)"
82589245600SSami Tolvanen	depends on ARCH_SUPPORTS_CFI_CLANG
82689245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
827cf68fffbSSami Tolvanen	help
828c4ca2276SLiu Song	  This option enables Clang's forward-edge Control Flow Integrity
829cf68fffbSSami Tolvanen	  (CFI) checking, where the compiler injects a runtime check to each
830cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
831cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
832cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
833cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
834cf68fffbSSami Tolvanen	  found from Clang's documentation:
835cf68fffbSSami Tolvanen
836cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
837cf68fffbSSami Tolvanen
838ce4a2620SAlice Ryhlconfig CFI_ICALL_NORMALIZE_INTEGERS
839ce4a2620SAlice Ryhl	bool "Normalize CFI tags for integers"
840ce4a2620SAlice Ryhl	depends on CFI_CLANG
841*8b8ca9c2SAlice Ryhl	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
842ce4a2620SAlice Ryhl	help
843ce4a2620SAlice Ryhl	  This option normalizes the CFI tags for integer types so that all
844ce4a2620SAlice Ryhl	  integer types of the same size and signedness receive the same CFI
845ce4a2620SAlice Ryhl	  tag.
846ce4a2620SAlice Ryhl
847ce4a2620SAlice Ryhl	  The option is separate from CONFIG_RUST because it affects the ABI.
848ce4a2620SAlice Ryhl	  When working with build systems that care about the ABI, it is
849ce4a2620SAlice Ryhl	  convenient to be able to turn on this flag first, before Rust is
850ce4a2620SAlice Ryhl	  turned on.
851ce4a2620SAlice Ryhl
852ce4a2620SAlice Ryhl	  This option is necessary for using CFI with Rust. If unsure, say N.
853ce4a2620SAlice Ryhl
854*8b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
855*8b8ca9c2SAlice Ryhl	def_bool y
8564c66f830SAlice Ryhl	depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
857*8b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
858*8b8ca9c2SAlice Ryhl	depends on CLANG_VERSION >= 190000 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
8594c66f830SAlice Ryhl
860*8b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
861*8b8ca9c2SAlice Ryhl	def_bool y
862*8b8ca9c2SAlice Ryhl	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
863*8b8ca9c2SAlice Ryhl	depends on RUSTC_VERSION >= 107900
864*8b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
865*8b8ca9c2SAlice Ryhl	depends on (RUSTC_LLVM_VERSION >= 190000 && RUSTC_VERSION >= 108200) || \
866*8b8ca9c2SAlice Ryhl		(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
8674c66f830SAlice Ryhl
868cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
869cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
870cf68fffbSSami Tolvanen	depends on CFI_CLANG
871cf68fffbSSami Tolvanen	help
872cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
873cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
874cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
875cf68fffbSSami Tolvanen
876cf68fffbSSami Tolvanen	  If unsure, say N.
877cf68fffbSSami Tolvanen
8780f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
8790f60a8efSKees Cook	bool
8800f60a8efSKees Cook	help
8810f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
8820f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
8830f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
8840f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
8850f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
8860f60a8efSKees Cook
88724a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
8882b1d5024SFrederic Weisbecker	bool
8892b1d5024SFrederic Weisbecker	help
89091d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
89191d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
892490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
893490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
894490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
8956f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
896490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
897490f561bSFrederic Weisbecker
89824a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
89983c2da2eSFrederic Weisbecker	bool
90083c2da2eSFrederic Weisbecker	help
90183c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
90283c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
90383c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
904d65d411cSValentin Schneider	  while context tracking is CT_STATE_USER. This feature reflects a sane
90583c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
90683c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
90783c2da2eSFrederic Weisbecker
90883c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
90983c2da2eSFrederic Weisbecker	    not interruptible).
910493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
91183c2da2eSFrederic Weisbecker	    got called.
91283c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
91383c2da2eSFrederic Weisbecker	    called.
91483c2da2eSFrederic Weisbecker
915490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
916490f561bSFrederic Weisbecker	bool
917490f561bSFrederic Weisbecker	help
918490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
919490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
9202b1d5024SFrederic Weisbecker
921b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
922b952741cSFrederic Weisbecker	bool
923b952741cSFrederic Weisbecker
9242b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
9252b91ec9fSFrederic Weisbecker	bool
9262b91ec9fSFrederic Weisbecker	help
9272b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
9282b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
9292b91ec9fSFrederic Weisbecker
93040565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
93140565b5aSStanislaw Gruszka	bool
93240565b5aSStanislaw Gruszka
933554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
934554b0004SKevin Hilman	bool
935554b0004SKevin Hilman	default y if 64BIT
936554b0004SKevin Hilman	help
937554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
938554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
939554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
940554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
941554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
942554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
943554b0004SKevin Hilman
944fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
945fdf9c356SFrederic Weisbecker	bool
946fdf9c356SFrederic Weisbecker	help
947fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
948fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
949fdf9c356SFrederic Weisbecker
950c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
951c49dd340SKalesh Singh	bool
952c49dd340SKalesh Singh	help
953c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
954c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
955c49dd340SKalesh Singh	  happens at the PGD level.
956c49dd340SKalesh Singh
9572c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
9582c91bd4aSJoel Fernandes (Google)	bool
9592c91bd4aSJoel Fernandes (Google)	help
9602c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
9612c91bd4aSJoel Fernandes (Google)
96215626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
96315626062SGerald Schaefer	bool
96415626062SGerald Schaefer
965a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
966a00cc7d9SMatthew Wilcox	bool
967a00cc7d9SMatthew Wilcox
9680ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
9690ddab1d2SToshi Kani	bool
9700ddab1d2SToshi Kani
971121e6f32SNicholas Piggin#
972121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
973559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
974559089e0SSong Liu#  must be used to enable allocations to use hugepages.
975121e6f32SNicholas Piggin#
976121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
977121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
978121e6f32SNicholas Piggin	bool
979121e6f32SNicholas Piggin
9803876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
9813876d4a3SAlexandre Ghiti	bool
9823876d4a3SAlexandre Ghiti
9832f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
9842f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
9852f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
9862f0584f3SRick Edgecombe	bool
9872f0584f3SRick Edgecombe
9882f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
9892f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
9902f0584f3SRick Edgecombe
9910f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
9920f8975ecSPavel Emelyanov	bool
9930f8975ecSPavel Emelyanov
994786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
995786d35d4SDavid Howells	bool
996786d35d4SDavid Howells	help
997786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
998786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
999786d35d4SDavid Howells	  should not enable this.
1000786d35d4SDavid Howells
1001786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
1002786d35d4SDavid Howells	bool
1003786d35d4SDavid Howells	help
1004786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
1005786d35d4SDavid Howells	  relocations will give an error.
1006786d35d4SDavid Howells
1007786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
1008786d35d4SDavid Howells	bool
1009786d35d4SDavid Howells	help
1010786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
1011786d35d4SDavid Howells	  relocations will give an error.
1012786d35d4SDavid Howells
101301dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
101401dc0386SChristophe Leroy	bool
101501dc0386SChristophe Leroy	help
101601dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
101701dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
101801dc0386SChristophe Leroy
1019223b5e57SMike Rapoport (IBM)config ARCH_WANTS_EXECMEM_LATE
1020223b5e57SMike Rapoport (IBM)	bool
1021223b5e57SMike Rapoport (IBM)	help
1022223b5e57SMike Rapoport (IBM)	  For architectures that do not allocate executable memory early on
1023223b5e57SMike Rapoport (IBM)	  boot, but rather require its initialization late when there is
1024223b5e57SMike Rapoport (IBM)	  enough entropy for module space randomization, for instance
1025223b5e57SMike Rapoport (IBM)	  arm64.
1026223b5e57SMike Rapoport (IBM)
1027cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
1028cc1f0274SFrederic Weisbecker	bool
1029cc1f0274SFrederic Weisbecker	help
1030cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
1031cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
1032cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
1033cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
1034cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
1035cc1f0274SFrederic Weisbecker	  processing.
1036cc1f0274SFrederic Weisbecker
1037cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
1038cd1a41ceSThomas Gleixner	bool
1039cd1a41ceSThomas Gleixner	help
1040cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
1041c226bc3cSColin Ian King	  separate stack.
1042cd1a41ceSThomas Gleixner
10438cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
10448cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
10458cbb2b50SSebastian Andrzej Siewior
104612700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
104712700c17SArnd Bergmann	bool
104812700c17SArnd Bergmann	help
104912700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
105012700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
105112700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
105212700c17SArnd Bergmann
1053235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
1054235a8f02SKirill A. Shutemov	int
1055235a8f02SKirill A. Shutemov	default 2
1056235a8f02SKirill A. Shutemov
10572b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
10582b68f6caSKees Cook	bool
10592b68f6caSKees Cook	help
10602b68f6caSKees Cook	  An architecture supports choosing randomized locations for
10612b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
10622b68f6caSKees Cook	  - arch_mmap_rnd()
1063204db6edSKees Cook	  - arch_randomize_brk()
10642b68f6caSKees Cook
1065d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1066d07e2259SDaniel Cashman	bool
1067d07e2259SDaniel Cashman	help
1068d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1069d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1070d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1071d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1072d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1073d07e2259SDaniel Cashman
10745f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
10755f56a5dfSJiri Slaby	bool
10765f56a5dfSJiri Slaby	help
10775f56a5dfSJiri Slaby	  An architecture implements exit_thread.
10785f56a5dfSJiri Slaby
1079d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1080d07e2259SDaniel Cashman	int
1081d07e2259SDaniel Cashman
1082d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1083d07e2259SDaniel Cashman	int
1084d07e2259SDaniel Cashman
1085d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1086d07e2259SDaniel Cashman	int
1087d07e2259SDaniel Cashman
1088d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1089d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1090d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1091d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1092d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1093d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1094d07e2259SDaniel Cashman	help
1095d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1096d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1097d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1098d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1099d07e2259SDaniel Cashman
1100d07e2259SDaniel Cashman	  This value can be changed after boot using the
1101d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1102d07e2259SDaniel Cashman
1103d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1104d07e2259SDaniel Cashman	bool
1105d07e2259SDaniel Cashman	help
1106d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1107d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1108d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1109d07e2259SDaniel Cashman	  enabled and provides values for both:
1110d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1111d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1112d07e2259SDaniel Cashman
1113d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1114d07e2259SDaniel Cashman	int
1115d07e2259SDaniel Cashman
1116d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1117d07e2259SDaniel Cashman	int
1118d07e2259SDaniel Cashman
1119d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1120d07e2259SDaniel Cashman	int
1121d07e2259SDaniel Cashman
1122d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1123d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1124d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1125d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1126d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1127d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1128d07e2259SDaniel Cashman	help
1129d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1130d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1131d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1132d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1133d07e2259SDaniel Cashman	  supported values.
1134d07e2259SDaniel Cashman
1135d07e2259SDaniel Cashman	  This value can be changed after boot using the
1136d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1137d07e2259SDaniel Cashman
11381b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
11391b028f78SDmitry Safonov	bool
11401b028f78SDmitry Safonov	help
11411b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
11421b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
11431b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
11441b028f78SDmitry Safonov
1145ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1146ba89f9c8SArnd Bergmann	bool
1147ba89f9c8SArnd Bergmann
1148ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1149ba89f9c8SArnd Bergmann	bool
1150ba89f9c8SArnd Bergmann
1151ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1152ba89f9c8SArnd Bergmann	bool
1153ba89f9c8SArnd Bergmann
1154ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1155ba89f9c8SArnd Bergmann	bool
1156ba89f9c8SArnd Bergmann
1157ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1158ba89f9c8SArnd Bergmann	bool
1159ba89f9c8SArnd Bergmann
1160ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1161ba89f9c8SArnd Bergmann	bool
1162ba89f9c8SArnd Bergmann
1163ba89f9c8SArnd Bergmannchoice
1164ba89f9c8SArnd Bergmann	prompt "MMU page size"
1165ba89f9c8SArnd Bergmann
1166ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1167ba89f9c8SArnd Bergmann	bool "4KiB pages"
1168ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1169ba89f9c8SArnd Bergmann	help
1170ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1171ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1172ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1173ba89f9c8SArnd Bergmann	  memory systems.
1174ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1175ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1176ba89f9c8SArnd Bergmann
1177ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1178ba89f9c8SArnd Bergmann	bool "8KiB pages"
1179ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1180ba89f9c8SArnd Bergmann	help
1181ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1182ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1183ba89f9c8SArnd Bergmann
1184ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1185ba89f9c8SArnd Bergmann	bool "16KiB pages"
1186ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1187ba89f9c8SArnd Bergmann	help
1188ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1189ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1190ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1191ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1192ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1193ba89f9c8SArnd Bergmann	  page cache.
1194ba89f9c8SArnd Bergmann
1195ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1196ba89f9c8SArnd Bergmann	bool "32KiB pages"
1197ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1198ba89f9c8SArnd Bergmann	help
1199ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1200ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1201ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1202ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1203ba89f9c8SArnd Bergmann	  support this.
1204ba89f9c8SArnd Bergmann
1205ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1206ba89f9c8SArnd Bergmann	bool "64KiB pages"
1207ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1208ba89f9c8SArnd Bergmann	help
1209ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1210ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1211ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1212ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1213ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1214ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1215ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1216ba89f9c8SArnd Bergmann
1217ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1218ba89f9c8SArnd Bergmann	bool "256KiB pages"
1219ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1220ba89f9c8SArnd Bergmann	help
1221ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1222ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1223ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1224ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1225ba89f9c8SArnd Bergmann
1226ba89f9c8SArnd Bergmannendchoice
1227ba89f9c8SArnd Bergmann
12281f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
12291f0e290cSGuenter Roeck	def_bool y
12301f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1231e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1232e4bbd20dSNathan Chancellor
1233e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1234e4bbd20dSNathan Chancellor	def_bool y
12351f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
12361f0e290cSGuenter Roeck
1237ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1238ba89f9c8SArnd Bergmann	int
1239ba89f9c8SArnd Bergmann	default	12 if PAGE_SIZE_4KB
1240ba89f9c8SArnd Bergmann	default	13 if PAGE_SIZE_8KB
1241ba89f9c8SArnd Bergmann	default	14 if PAGE_SIZE_16KB
1242ba89f9c8SArnd Bergmann	default	15 if PAGE_SIZE_32KB
1243ba89f9c8SArnd Bergmann	default	16 if PAGE_SIZE_64KB
1244ba89f9c8SArnd Bergmann	default	18 if PAGE_SIZE_256KB
1245ba89f9c8SArnd Bergmann
124667f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
124767f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
124867f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
124967f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
125067f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
125167f3977fSAlexandre Ghiti# - STACK_RND_MASK
125267f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
125367f3977fSAlexandre Ghiti	bool
125467f3977fSAlexandre Ghiti	depends on MMU
1255e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
125667f3977fSAlexandre Ghiti
125703f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
125803f16cd0SJosh Poimboeuf	bool
125903f16cd0SJosh Poimboeuf
12604ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
12614ab7674fSJosh Poimboeuf	bool
12624ab7674fSJosh Poimboeuf
126322102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
126422102f45SJosh Poimboeuf	bool
126522102f45SJosh Poimboeuf
1266489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1267489e355bSJosh Poimboeuf	bool
1268489e355bSJosh Poimboeuf
12695f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
12705f3da8c0SJosh Poimboeuf	bool
12715f3da8c0SJosh Poimboeuf	select OBJTOOL
12725f3da8c0SJosh Poimboeuf
1273b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1274b9ab5ebbSJosh Poimboeuf	bool
1275b9ab5ebbSJosh Poimboeuf	help
127603f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
127703f16cd0SJosh Poimboeuf	  validation.
1278b9ab5ebbSJosh Poimboeuf
1279af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1280af085d90SJosh Poimboeuf	bool
1281af085d90SJosh Poimboeuf	help
1282140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1283140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1284140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1285af085d90SJosh Poimboeuf
1286468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1287468a9428SGeorge Spelvin	bool
1288468a9428SGeorge Spelvin	default n
1289468a9428SGeorge Spelvin	help
1290468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1291468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1292468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1293468a9428SGeorge Spelvin
1294666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1295666047feSFinn Thain	bool
1296666047feSFinn Thain
12973a495511SWilliam Breathitt Grayconfig ISA_BUS_API
12983a495511SWilliam Breathitt Gray	def_bool ISA
12993a495511SWilliam Breathitt Gray
1300d2125043SAl Viro#
1301d2125043SAl Viro# ABI hall of shame
1302d2125043SAl Viro#
1303d2125043SAl Viroconfig CLONE_BACKWARDS
1304d2125043SAl Viro	bool
1305d2125043SAl Viro	help
1306d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1307d2125043SAl Viro	  not the 5th one.
1308d2125043SAl Viro
1309d2125043SAl Viroconfig CLONE_BACKWARDS2
1310d2125043SAl Viro	bool
1311d2125043SAl Viro	help
1312d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1313d2125043SAl Viro
1314dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1315dfa9771aSMichal Simek	bool
1316dfa9771aSMichal Simek	help
1317dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1318dfa9771aSMichal Simek	  not the 5th one.
1319dfa9771aSMichal Simek
1320eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1321eaca6eaeSAl Viro	bool
1322eaca6eaeSAl Viro	help
1323eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1324eaca6eaeSAl Viro
13250a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
13260a0e8cdfSAl Viro	bool
13270a0e8cdfSAl Viro	help
13280a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
13290a0e8cdfSAl Viro
13300a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
13310a0e8cdfSAl Viro	bool
13320a0e8cdfSAl Viro	help
13330a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
13340a0e8cdfSAl Viro
1335495dfbf7SAl Viroconfig OLD_SIGACTION
1336495dfbf7SAl Viro	bool
1337495dfbf7SAl Viro	help
1338495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1339495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1340495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1341495dfbf7SAl Viro	  compatibility...
1342495dfbf7SAl Viro
1343495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1344495dfbf7SAl Viro	bool
1345495dfbf7SAl Viro
134617435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1347942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1348942437c9SArnd Bergmann	default !64BIT || COMPAT
134917435e5fSDeepa Dinamani	help
135017435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
135117435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
135217435e5fSDeepa Dinamani	  as part of compat syscall handling.
135317435e5fSDeepa Dinamani
135487a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
135587a4c375SChristoph Hellwig	bool
135687a4c375SChristoph Hellwig
1357a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1358a50a3f4bSThomas Gleixner	bool
1359a50a3f4bSThomas Gleixner
1360fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1361fff7fb0bSZhaoxiu Zeng	def_bool n
1362fff7fb0bSZhaoxiu Zeng
1363ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1364ba14a194SAndy Lutomirski	def_bool n
1365ba14a194SAndy Lutomirski	help
1366ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1367ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1368ba14a194SAndy Lutomirski
1369ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1370ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1371ba14a194SAndy Lutomirski
1372ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1373ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1374ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1375ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1376ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1377ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1378ba14a194SAndy Lutomirski
1379ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1380ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1381ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1382ba14a194SAndy Lutomirski
1383ba14a194SAndy Lutomirskiconfig VMAP_STACK
1384ba14a194SAndy Lutomirski	default y
1385ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1386eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
138738dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1388a7f7f624SMasahiro Yamada	help
1389ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1390ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1391ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1392ba14a194SAndy Lutomirski	  corruption.
1393ba14a194SAndy Lutomirski
139438dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
139538dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
139638dd767dSAndrey Konovalov	  must be enabled.
1397ba14a194SAndy Lutomirski
139839218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
139939218ff4SKees Cook	def_bool n
140039218ff4SKees Cook	help
140139218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
140239218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
140339218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
140439218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
140539218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
140639218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
140739218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
140839218ff4SKees Cook	  of the static branch state.
140939218ff4SKees Cook
14108cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
14118cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
14128cb37a59SMarco Elver	default y
141339218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1414efa90c11SMarco Elver	depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
141539218ff4SKees Cook	help
141639218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
141739218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
141839218ff4SKees Cook	  attacks that depend on stack address determinism or
14198cb37a59SMarco Elver	  cross-syscall address exposures.
14208cb37a59SMarco Elver
14218cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
14228cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
14238cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
14248cb37a59SMarco Elver
14258cb37a59SMarco Elver	  If unsure, say Y.
14268cb37a59SMarco Elver
14278cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
14288cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
14298cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
14308cb37a59SMarco Elver	help
14318cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
14328cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
14338cb37a59SMarco Elver	  boot state.
143439218ff4SKees Cook
1435ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1436ad21fc4fSLaura Abbott	def_bool n
1437ad21fc4fSLaura Abbott
1438ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1439ad21fc4fSLaura Abbott	def_bool n
1440ad21fc4fSLaura Abbott
1441ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1442ad21fc4fSLaura Abbott	def_bool n
1443ad21fc4fSLaura Abbott
14440f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1445ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1446ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1447ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1448ad21fc4fSLaura Abbott	help
1449ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1450ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1451ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1452ad21fc4fSLaura Abbott	  or modifying text)
1453ad21fc4fSLaura Abbott
1454ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1455ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1456ad21fc4fSLaura Abbott
1457ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1458ad21fc4fSLaura Abbott	def_bool n
1459ad21fc4fSLaura Abbott
14600f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1461ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1462ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1463ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1464ad21fc4fSLaura Abbott	help
1465ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1466ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1467ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1468ad21fc4fSLaura Abbott
1469ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1470ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1471ea8c64acSChristoph Hellwig	bool
1472ea8c64acSChristoph Hellwig
147304f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
147404f264d3SPaul Burton	bool
147504f264d3SPaul Burton	help
147604f264d3SPaul Burton	  An architecture can select this if it provides an
147704f264d3SPaul Burton	  asm/compiler.h header that should be included after
147804f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
147904f264d3SPaul Burton	  headers generally provide.
148004f264d3SPaul Burton
1481271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1482271ca788SArd Biesheuvel	bool
1483271ca788SArd Biesheuvel	help
1484271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1485271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1486271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1487271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1488271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1489271ca788SArd Biesheuvel	  kernels.
1490271ca788SArd Biesheuvel
1491ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1492ce9084baSArd Biesheuvel	bool
1493ce9084baSArd Biesheuvel
1494fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1495fb346fd9SWaiman Long	bool "Locking event counts collection"
1496fb346fd9SWaiman Long	depends on DEBUG_FS
1497a7f7f624SMasahiro Yamada	help
1498fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1499fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1500fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1501fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1502fb346fd9SWaiman Long
15035cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
15045cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
15055cf896fbSPeter Collingbourne	bool
15065cf896fbSPeter Collingbourne
15075cf896fbSPeter Collingbourneconfig RELR
15085cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
15095cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
15105cf896fbSPeter Collingbourne	default y
15115cf896fbSPeter Collingbourne	help
15125cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
15135cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
15145cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
15155cf896fbSPeter Collingbourne	  are compatible).
15165cf896fbSPeter Collingbourne
15170c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
15180c9c1d56SThiago Jung Bauermann	bool
15190c9c1d56SThiago Jung Bauermann
152046b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
152146b49b12STom Lendacky	bool
152246b49b12STom Lendacky
15230e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
15240e242208SHassan Naveed	bool
15250e242208SHassan Naveed	help
15260e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
15270e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
15280e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
15290e242208SHassan Naveed	  related optimizations for a given architecture.
15300e242208SHassan Naveed
1531d60d7de3SSven Schnelleconfig ARCH_HAS_VDSO_DATA
1532d60d7de3SSven Schnelle	bool
1533d60d7de3SSven Schnelle
1534115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1535115284d8SJosh Poimboeuf	bool
1536115284d8SJosh Poimboeuf
15379183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
15389183c3f9SJosh Poimboeuf	bool
15399183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
154003f16cd0SJosh Poimboeuf	select OBJTOOL
15419183c3f9SJosh Poimboeuf
15426ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
15436ef869e0SMichal Hocko	bool
154499cf983cSMark Rutland
154599cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
154699cf983cSMark Rutland	bool
15476ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
154899cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
15496ef869e0SMichal Hocko	help
155099cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
155199cf983cSMark Rutland	  model being selected at boot time using static calls.
155299cf983cSMark Rutland
155399cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
155499cf983cSMark Rutland	  preemption function will be patched directly.
155599cf983cSMark Rutland
155699cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
155799cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
155899cf983cSMark Rutland	  trampoline will be patched.
155999cf983cSMark Rutland
156099cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
156199cf983cSMark Rutland	  overhead.
156299cf983cSMark Rutland
156399cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
156499cf983cSMark Rutland	bool
1565a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
156699cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
156799cf983cSMark Rutland	help
156899cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
156999cf983cSMark Rutland	  model being selected at boot time using static keys.
157099cf983cSMark Rutland
157199cf983cSMark Rutland	  Each preemption function will be given an early return based on a
157299cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
157399cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
157499cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
157599cf983cSMark Rutland	  integrate better with CFI schemes.
157699cf983cSMark Rutland
157799cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
157899cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
15796ef869e0SMichal Hocko
158059612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
158159612b24SNathan Chancellor	bool
158259612b24SNathan Chancellor	help
158359612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
158459612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
158559612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
158659612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
158759612b24SNathan Chancellor	  versions.
158859612b24SNathan Chancellor
15894f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
15904f5b0c17SMike Rapoport	bool
15914f5b0c17SMike Rapoport
15925d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
15935d6ad668SMike Rapoport	bool
15945d6ad668SMike Rapoport
1595df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1596df4e817bSPasha Tatashin	bool
1597df4e817bSPasha Tatashin
15982ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
15992ca408d9SBrian Gerst	bool
16002ca408d9SBrian Gerst	help
16012ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
16022ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
16032ca408d9SBrian Gerst
16047facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
16057facdc42SAl Viro	bool
16067facdc42SAl Viro
160758e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
160858e106e7SBalbir Singh	bool
160958e106e7SBalbir Singh
1610d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1611d593d64fSPrasad Sodagudi	bool
1612d593d64fSPrasad Sodagudi
16131bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
16141bdda24cSThomas Gleixner	bool
16151bdda24cSThomas Gleixner
161650468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
161750468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
161850468e43SJarkko Sakkinen	bool
161950468e43SJarkko Sakkinen
162071ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
162171ce1ab5SKinsey Ho	bool
162271ce1ab5SKinsey Ho	help
162371ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
162471ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
162571ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
162671ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
162771ce1ab5SKinsey Ho
1628eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1629eed9a328SYu Zhao	bool
1630eed9a328SYu Zhao	help
1631eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1632eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1633eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1634eed9a328SYu Zhao	  may use this capability to reduce their search space.
1635eed9a328SYu Zhao
16366cbd1d6dSSamuel Hollandconfig ARCH_HAS_KERNEL_FPU_SUPPORT
16376cbd1d6dSSamuel Holland	bool
16386cbd1d6dSSamuel Holland	help
16396cbd1d6dSSamuel Holland	  Architectures that select this option can run floating-point code in
16406cbd1d6dSSamuel Holland	  the kernel, as described in Documentation/core-api/floating-point.rst.
16416cbd1d6dSSamuel Holland
16422521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
164345332b1bSMasahiro Yamada
164445332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1645fa1b5d09SLinus Torvalds
1646d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1647d49a0626SPeter Zijlstra	bool
1648d49a0626SPeter Zijlstra
1649d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1650d49a0626SPeter Zijlstra	bool
1651d49a0626SPeter Zijlstra
1652d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1653d49a0626SPeter Zijlstra	bool
1654d49a0626SPeter Zijlstra
1655d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1656d49a0626SPeter Zijlstra	bool
1657d49a0626SPeter Zijlstra
1658d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1659d49a0626SPeter Zijlstra	bool
1660d49a0626SPeter Zijlstra
1661d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1662d49a0626SPeter Zijlstra	int
1663d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1664d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1665d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1666d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1667d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1668d49a0626SPeter Zijlstra	default 0
1669d49a0626SPeter Zijlstra
16705270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
16715270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
16725270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
16735270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
16745270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
16755270316cSPetr Pavlu
16765270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
16775270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
16785270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
16795270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
16805270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
16815270316cSPetr Pavlu
1682a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1683a88d970cSPaul E. McKenney	bool
1684a88d970cSPaul E. McKenney
168522471e13SRandy Dunlapendmenu
1686