xref: /linux/arch/Kconfig (revision c6439bfaabf25b736154ac5640c677da2c085db4)
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
67a70e9f64SJinjie Ruanconfig GENERIC_IRQ_ENTRY
68a70e9f64SJinjie Ruan	bool
69a70e9f64SJinjie Ruan
70a70e9f64SJinjie Ruanconfig GENERIC_SYSCALL
71a70e9f64SJinjie Ruan	bool
72a70e9f64SJinjie Ruan	depends on GENERIC_IRQ_ENTRY
73a70e9f64SJinjie Ruan
74142781e1SThomas Gleixnerconfig GENERIC_ENTRY
75142781e1SThomas Gleixner	bool
76a70e9f64SJinjie Ruan	select GENERIC_IRQ_ENTRY
77a70e9f64SJinjie Ruan	select GENERIC_SYSCALL
78142781e1SThomas Gleixner
79125e5645SMathieu Desnoyersconfig KPROBES
80125e5645SMathieu Desnoyers	bool "Kprobes"
81125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
8205ed160eSMasami Hiramatsu	select KALLSYMS
837582b7beSMike Rapoport (IBM)	select EXECMEM
84900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
85125e5645SMathieu Desnoyers	help
86125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
87125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
88125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
89125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
90125e5645SMathieu Desnoyers	  If in doubt, say "N".
91125e5645SMathieu Desnoyers
9245f81b1cSSteven Rostedtconfig JUMP_LABEL
93c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
9445f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
954ab7674fSJosh Poimboeuf	select OBJTOOL if HAVE_JUMP_LABEL_HACK
9645f81b1cSSteven Rostedt	help
97c5905afbSIngo Molnar	  This option enables a transparent branch optimization that
98c5905afbSIngo Molnar	  makes certain almost-always-true or almost-always-false branch
99c5905afbSIngo Molnar	  conditions even cheaper to execute within the kernel.
10045f81b1cSSteven Rostedt
101c5905afbSIngo Molnar	  Certain performance-sensitive kernel code, such as trace points,
102c5905afbSIngo Molnar	  scheduler functionality, networking code and KVM have such
103c5905afbSIngo Molnar	  branches and include support for this optimization technique.
104c5905afbSIngo Molnar
105c5905afbSIngo Molnar	  If it is detected that the compiler has support for "asm goto",
106c5905afbSIngo Molnar	  the kernel will compile such branches with just a nop
107c5905afbSIngo Molnar	  instruction. When the condition flag is toggled to true, the
108c5905afbSIngo Molnar	  nop will be converted to a jump instruction to execute the
109c5905afbSIngo Molnar	  conditional block of instructions.
110c5905afbSIngo Molnar
111c5905afbSIngo Molnar	  This technique lowers overhead and stress on the branch prediction
112c5905afbSIngo Molnar	  of the processor and generally makes the kernel faster. The update
113c5905afbSIngo Molnar	  of the condition is slower, but those are always very rare.
114c5905afbSIngo Molnar
115c5905afbSIngo Molnar	  ( On 32-bit x86, the necessary options added to the compiler
116c5905afbSIngo Molnar	    flags may increase the size of the kernel slightly. )
11745f81b1cSSteven Rostedt
1181987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
1191987c947SPeter Zijlstra	bool "Static key selftest"
1201987c947SPeter Zijlstra	depends on JUMP_LABEL
1211987c947SPeter Zijlstra	help
1221987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
1231987c947SPeter Zijlstra
124f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
125f03c4129SPeter Zijlstra	bool "Static call selftest"
126f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
127f03c4129SPeter Zijlstra	help
128f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
129f03c4129SPeter Zijlstra
130afd66255SMasami Hiramatsuconfig OPTPROBES
1315cc718b9SMasami Hiramatsu	def_bool y
1325cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
133900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
134afd66255SMasami Hiramatsu
135e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
136e7dbfe34SMasami Hiramatsu	def_bool y
137e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
138e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
139e7dbfe34SMasami Hiramatsu	help
140e7dbfe34SMasami Hiramatsu	  If function tracer is enabled and the arch supports full
141e7dbfe34SMasami Hiramatsu	  passing of pt_regs to function tracing, then kprobes can
142e7dbfe34SMasami Hiramatsu	  optimize on top of function tracing.
143e7dbfe34SMasami Hiramatsu
1442b144498SSrikar Dronamrajuconfig UPROBES
14509294e31SDavid A. Long	def_bool n
146e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
14787195a1eSAndrii Nakryiko	select TASKS_TRACE_RCU
1482b144498SSrikar Dronamraju	help
1497b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1507b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1517b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1527b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1537b2d81d4SIngo Molnar	  are hit by user-space applications.
1547b2d81d4SIngo Molnar
1557b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1567b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1577b2d81d4SIngo Molnar	    application. )
1582b144498SSrikar Dronamraju
159adab66b7SSteven Rostedt (VMware)config HAVE_64BIT_ALIGNED_ACCESS
160adab66b7SSteven Rostedt (VMware)	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
161adab66b7SSteven Rostedt (VMware)	help
162adab66b7SSteven Rostedt (VMware)	  Some architectures require 64 bit accesses to be 64 bit
163adab66b7SSteven Rostedt (VMware)	  aligned, which also requires structs containing 64 bit values
164adab66b7SSteven Rostedt (VMware)	  to be 64 bit aligned too. This includes some 32 bit
165adab66b7SSteven Rostedt (VMware)	  architectures which can do 64 bit accesses, as well as 64 bit
166adab66b7SSteven Rostedt (VMware)	  architectures without unaligned access.
167adab66b7SSteven Rostedt (VMware)
168adab66b7SSteven Rostedt (VMware)	  This symbol should be selected by an architecture if 64 bit
169adab66b7SSteven Rostedt (VMware)	  accesses are required to be 64 bit aligned in this way even
170adab66b7SSteven Rostedt (VMware)	  though it is not a 64 bit architecture.
171adab66b7SSteven Rostedt (VMware)
172ba1a297dSLukas Bulwahn	  See Documentation/core-api/unaligned-memory-access.rst for
173ba1a297dSLukas Bulwahn	  more information on the topic of unaligned memory accesses.
174adab66b7SSteven Rostedt (VMware)
17558340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
1769ba16087SJan Beulich	bool
17758340a07SJohannes Berg	help
17858340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
17958340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
18058340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
18158340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
18258340a07SJohannes Berg	  handler.)
18358340a07SJohannes Berg
18458340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
18558340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
18658340a07SJohannes Berg	  code paths to be selected for these cases. Some network
18758340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
18858340a07SJohannes Berg	  problems with received packets if doing so would not help
18958340a07SJohannes Berg	  much.
19058340a07SJohannes Berg
191c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
19258340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
19358340a07SJohannes Berg
194cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
195cf66bb93SDavid Woodhouse	bool
196cf66bb93SDavid Woodhouse	help
197cf66bb93SDavid Woodhouse	  Modern versions of GCC (since 4.4) have builtin functions
198cf66bb93SDavid Woodhouse	  for handling byte-swapping. Using these, instead of the old
199cf66bb93SDavid Woodhouse	  inline assembler that the architecture code provides in the
200cf66bb93SDavid Woodhouse	  __arch_bswapXX() macros, allows the compiler to see what's
201cf66bb93SDavid Woodhouse	  happening and offers more opportunity for optimisation. In
202cf66bb93SDavid Woodhouse	  particular, the compiler will be able to combine the byteswap
203cf66bb93SDavid Woodhouse	  with a nearby load or store and use load-and-swap or
204cf66bb93SDavid Woodhouse	  store-and-swap instructions if the architecture has them. It
205cf66bb93SDavid Woodhouse	  should almost *never* result in code which is worse than the
206cf66bb93SDavid Woodhouse	  hand-coded assembler in <asm/swab.h>.  But just in case it
207cf66bb93SDavid Woodhouse	  does, the use of the builtins is optional.
208cf66bb93SDavid Woodhouse
209cf66bb93SDavid Woodhouse	  Any architecture with load-and-swap or store-and-swap
210cf66bb93SDavid Woodhouse	  instructions should set this. And it shouldn't hurt to set it
211cf66bb93SDavid Woodhouse	  on architectures that don't have such instructions.
212cf66bb93SDavid Woodhouse
2139edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
2149edddaa2SAnanth N Mavinakayanahalli	def_bool y
21573f9b911SMasami Hiramatsu	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
21673f9b911SMasami Hiramatsu
21773f9b911SMasami Hiramatsuconfig KRETPROBE_ON_RETHOOK
21873f9b911SMasami Hiramatsu	def_bool y
21973f9b911SMasami Hiramatsu	depends on HAVE_RETHOOK
22073f9b911SMasami Hiramatsu	depends on KRETPROBES
22173f9b911SMasami Hiramatsu	select RETHOOK
2229edddaa2SAnanth N Mavinakayanahalli
2237c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
2247c68af6eSAvi Kivity	bool
2257c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
2267c68af6eSAvi Kivity	help
2277c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
2287c68af6eSAvi Kivity	  switch to user mode.
2297c68af6eSAvi Kivity
23028b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
2319ba16087SJan Beulich	bool
23228b2ee20SRik van Riel
233125e5645SMathieu Desnoyersconfig HAVE_KPROBES
2349ba16087SJan Beulich	bool
2359edddaa2SAnanth N Mavinakayanahalli
2369edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2379ba16087SJan Beulich	bool
23874bc7ceeSArthur Kepner
239afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
240afd66255SMasami Hiramatsu	bool
241d314d74cSCong Wang
242e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
243e7dbfe34SMasami Hiramatsu	bool
244e7dbfe34SMasami Hiramatsu
2451f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2461f6d3a8fSMasami Hiramatsu	bool
2471f6d3a8fSMasami Hiramatsu	help
2481f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
2491f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
2501f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2511f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2521f6d3a8fSMasami Hiramatsu
253540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2549802d865SJosef Bacik	bool
2559802d865SJosef Bacik
25642a0bb3fSPetr Mladekconfig HAVE_NMI
25742a0bb3fSPetr Mladek	bool
25842a0bb3fSPetr Mladek
259a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
260a257caccSChristophe Leroy	bool
261a257caccSChristophe Leroy
2624aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
2634aae683fSMasahiro Yamada	bool
2644aae683fSMasahiro Yamada
2654510bffbSMark Rutlandconfig TRACE_IRQFLAGS_NMI_SUPPORT
2664510bffbSMark Rutland	bool
2674510bffbSMark Rutland
2681f5a4ad9SRoland McGrath#
2691f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
2701f5a4ad9SRoland McGrath#
2711f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
2721f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
2731f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
2741f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
2751f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
2761f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
277153474baSEric W. Biederman#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
27803248addSEric W. Biederman#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
2791f5a4ad9SRoland McGrath#
2801f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
2819ba16087SJan Beulich	bool
2821f5a4ad9SRoland McGrath
283c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
284c64be2bbSMarek Szyprowski	bool
285c64be2bbSMarek Szyprowski
28629d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
28729d5e047SThomas Gleixner	bool
28829d5e047SThomas Gleixner
289485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
290485cf5daSKevin Hilman	bool
291485cf5daSKevin Hilman
2926974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
2936974f0c4SDaniel Micay	bool
2946974f0c4SDaniel Micay	help
2956974f0c4SDaniel Micay	  An architecture should select this when it can successfully
2966974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
2976974f0c4SDaniel Micay
298d8ae8a37SChristoph Hellwig#
299d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
300d8ae8a37SChristoph Hellwig# command line option
301d8ae8a37SChristoph Hellwig#
302d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
303d8ae8a37SChristoph Hellwig	bool
304d8ae8a37SChristoph Hellwig
305d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
306d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
307d2852a22SDaniel Borkmann	bool
308d2852a22SDaniel Borkmann
309d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
310d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
311d253ca0cSRick Edgecombe	bool
312d253ca0cSRick Edgecombe
313c30700dbSChristoph Hellwig#
314fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
315a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
316fa7e2247SChristoph Hellwig# to remap the page tables in place.
317c30700dbSChristoph Hellwig#
318fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
319c30700dbSChristoph Hellwig	bool
320c30700dbSChristoph Hellwig
321999a5d12SChristoph Hellwig#
322999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
323999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
324999a5d12SChristoph Hellwig#
325999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
326f5e10287SThomas Gleixner	bool
327f5e10287SThomas Gleixner
3287725acaaSThomas Gleixnerconfig ARCH_HAS_CPU_FINALIZE_INIT
3297725acaaSThomas Gleixner	bool
3307725acaaSThomas Gleixner
3318f23f5dbSJason Gunthorpe# The architecture has a per-task state that includes the mm's PASID
3328f23f5dbSJason Gunthorpeconfig ARCH_HAS_CPU_PASID
3338f23f5dbSJason Gunthorpe	bool
3348f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
3358f23f5dbSJason Gunthorpe
3365905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
3375905429aSKees Cook	bool
3385905429aSKees Cook	help
3395905429aSKees Cook	  An architecture should select this to provide hardened usercopy
3405905429aSKees Cook	  knowledge about what region of the thread_struct should be
3415905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
3425905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
3435905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
3445905429aSKees Cook	  field in task_struct will be left whitelisted.
3455905429aSKees Cook
3465aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
3475aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
3485aaeb5c0SIngo Molnar	bool
3495aaeb5c0SIngo Molnar
35051c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
35151c2ee6dSNick Desaulniers	bool
35251c2ee6dSNick Desaulniers	help
35351c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
35451c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
35551c2ee6dSNick Desaulniers	  functions and is required for correctness.
35651c2ee6dSNick Desaulniers
357942fa985SYury Norovconfig ARCH_32BIT_OFF_T
358942fa985SYury Norov	bool
359942fa985SYury Norov	depends on !64BIT
360942fa985SYury Norov	help
361942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
362942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
363942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
364942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
365942fa985SYury Norov	  architectures explicitly.
366942fa985SYury Norov
36796c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
36896c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
36996c0a6a7SHeiko Carstens	bool
37096c0a6a7SHeiko Carstens
3712ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
3722ff2b7ecSMasahiro Yamada	bool
3732ff2b7ecSMasahiro Yamada	help
374a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
3752ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
3762ff2b7ecSMasahiro Yamada	  exported from assembly code.
3772ff2b7ecSMasahiro Yamada
378f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
379f850c30cSHeiko Carstens	bool
380e01292b1SHeiko Carstens	help
381a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
382e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
383e01292b1SHeiko Carstens	  declared in asm/ptrace.h
384e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
385f850c30cSHeiko Carstens
386d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
387d7822b1eSMathieu Desnoyers	bool
388d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
389d7822b1eSMathieu Desnoyers	help
390d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
391d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
392d7822b1eSMathieu Desnoyers
3932f7ab126SMiguel Ojedaconfig HAVE_RUST
3942f7ab126SMiguel Ojeda	bool
3952f7ab126SMiguel Ojeda	help
3962f7ab126SMiguel Ojeda	  This symbol should be selected by an architecture if it
3972f7ab126SMiguel Ojeda	  supports Rust.
3982f7ab126SMiguel Ojeda
3993c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
4003c88ee19SMasami Hiramatsu	bool
4013c88ee19SMasami Hiramatsu	help
402a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
4033c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
4043c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
4053c88ee19SMasami Hiramatsu
40662a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
40762a038d3SK.Prasad	bool
40899e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
40962a038d3SK.Prasad
4100102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
4110102752eSFrederic Weisbecker	bool
4120102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
4130102752eSFrederic Weisbecker	help
4140102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
4150102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
4160102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
4170102752eSFrederic Weisbecker	  them but define the access type in a control register.
4180102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
4190102752eSFrederic Weisbecker	  latter fashion.
4200102752eSFrederic Weisbecker
4217c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
4227c68af6eSAvi Kivity	bool
423a1922ed6SIngo Molnar
424c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
425c01d4323SFrederic Weisbecker	bool
42623637d47SFrederic Weisbecker	help
42723637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
42823637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
42923637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
430c01d4323SFrederic Weisbecker
43105a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
43205a4a952SNicholas Piggin	bool
43305a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
43405a4a952SNicholas Piggin	help
43505a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
43605a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
43705a4a952SNicholas Piggin
43805a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
43905a4a952SNicholas Piggin	bool
44005a4a952SNicholas Piggin	help
4411356d0b9SPetr Mladek	  The arch provides its own hardlockup detector implementation instead
4421356d0b9SPetr Mladek	  of the generic ones.
4431356d0b9SPetr Mladek
4441356d0b9SPetr Mladek	  It uses the same command line parameters, and sysctl interface,
4451356d0b9SPetr Mladek	  as the generic hardlockup detectors.
44605a4a952SNicholas Piggin
447*71753c6eSJosh Poimboeufconfig UNWIND_USER
448*71753c6eSJosh Poimboeuf	bool
449*71753c6eSJosh Poimboeuf
450*71753c6eSJosh Poimboeufconfig HAVE_UNWIND_USER_FP
451*71753c6eSJosh Poimboeuf	bool
452*71753c6eSJosh Poimboeuf	select UNWIND_USER
453*71753c6eSJosh Poimboeuf
454c5e63197SJiri Olsaconfig HAVE_PERF_REGS
455c5e63197SJiri Olsa	bool
456c5e63197SJiri Olsa	help
457c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
458c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
459c5e63197SJiri Olsa
460c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
461c5ebcedbSJiri Olsa	bool
462c5ebcedbSJiri Olsa	help
463c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
464c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
465c5ebcedbSJiri Olsa	  architectures.
466c5ebcedbSJiri Olsa
467bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
468bf5438fcSJason Baron	bool
469bf5438fcSJason Baron
47050ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
47150ff18abSArd Biesheuvel	bool
47250ff18abSArd Biesheuvel
4730d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
4740d6e24d4SPeter Zijlstra	bool
4750d6e24d4SPeter Zijlstra
476ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
47726723911SPeter Zijlstra	bool
4780d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
47926723911SPeter Zijlstra
4803af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
481ed6a7935SPeter Zijlstra	bool
482ed6a7935SPeter Zijlstra
48327796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
48427796d03SPeter Zijlstra	bool
4851e9fdf21SPeter Zijlstra	select MMU_GATHER_MERGE_VMAS
4861e9fdf21SPeter Zijlstra
4871e9fdf21SPeter Zijlstraconfig MMU_GATHER_NO_FLUSH_CACHE
4881e9fdf21SPeter Zijlstra	bool
4891e9fdf21SPeter Zijlstra
4901e9fdf21SPeter Zijlstraconfig MMU_GATHER_MERGE_VMAS
4911e9fdf21SPeter Zijlstra	bool
49227796d03SPeter Zijlstra
493580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
494952a31c9SMartin Schwidefsky	bool
4950d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
496952a31c9SMartin Schwidefsky
497d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
498d53c3dfbSNicholas Piggin	bool
499d53c3dfbSNicholas Piggin	help
500d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
501d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
502d53c3dfbSNicholas Piggin	  shootdowns should enable this.
503d53c3dfbSNicholas Piggin
50488e3009bSNicholas Piggin# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
50588e3009bSNicholas Piggin# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
50688e3009bSNicholas Piggin# to/from kernel threads when the same mm is running on a lot of CPUs (a large
50788e3009bSNicholas Piggin# multi-threaded application), by reducing contention on the mm refcount.
50888e3009bSNicholas Piggin#
50988e3009bSNicholas Piggin# This can be disabled if the architecture ensures no CPUs are using an mm as a
51088e3009bSNicholas Piggin# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
51188e3009bSNicholas Piggin# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
51288e3009bSNicholas Piggin# final exit(2) TLB flush, for example.
51388e3009bSNicholas Piggin#
51488e3009bSNicholas Piggin# To implement this, an arch *must*:
51588e3009bSNicholas Piggin# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
51688e3009bSNicholas Piggin# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
51788e3009bSNicholas Piggin# converted already).
51888e3009bSNicholas Pigginconfig MMU_LAZY_TLB_REFCOUNT
51988e3009bSNicholas Piggin	def_bool y
5202655421aSNicholas Piggin	depends on !MMU_LAZY_TLB_SHOOTDOWN
5212655421aSNicholas Piggin
5222655421aSNicholas Piggin# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
5232655421aSNicholas Piggin# mm as a lazy tlb beyond its last reference count, by shooting down these
5242655421aSNicholas Piggin# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
5252655421aSNicholas Piggin# be using the mm as a lazy tlb, so that they may switch themselves to using
5262655421aSNicholas Piggin# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
5272655421aSNicholas Piggin# may be using mm as a lazy tlb mm.
5282655421aSNicholas Piggin#
5292655421aSNicholas Piggin# To implement this, an arch *must*:
5302655421aSNicholas Piggin# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
5312655421aSNicholas Piggin#   at least all possible CPUs in which the mm is lazy.
5322655421aSNicholas Piggin# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
5332655421aSNicholas Pigginconfig MMU_LAZY_TLB_SHOOTDOWN
5342655421aSNicholas Piggin	bool
53588e3009bSNicholas Piggin
536df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
537df013ffbSHuang Ying	bool
538df013ffbSHuang Ying
539a9c3475dSVignesh Balasubramanianconfig ARCH_HAVE_EXTRA_ELF_NOTES
540a9c3475dSVignesh Balasubramanian	bool
541a9c3475dSVignesh Balasubramanian	help
542a9c3475dSVignesh Balasubramanian	  An architecture should select this in order to enable adding an
543a9c3475dSVignesh Balasubramanian	  arch-specific ELF note section to core files. It must provide two
544a9c3475dSVignesh Balasubramanian	  functions: elf_coredump_extra_notes_size() and
545a9c3475dSVignesh Balasubramanian	  elf_coredump_extra_notes_write() which are invoked by the ELF core
546a9c3475dSVignesh Balasubramanian	  dumper.
547a9c3475dSVignesh Balasubramanian
5482e83b879SPaul E. McKenneyconfig ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
5492e83b879SPaul E. McKenney	bool
5502e83b879SPaul E. McKenney
55143570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
55243570fd2SHeiko Carstens	bool
55343570fd2SHeiko Carstens	help
55443570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
55543570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
55643570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
55743570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
55843570fd2SHeiko Carstens
5594156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
5604156153cSHeiko Carstens	bool
5614156153cSHeiko Carstens
5622565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
5632565409fSHeiko Carstens	bool
5642565409fSHeiko Carstens
56577e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
56677e58496SPaul E. McKenney	bool
56777e58496SPaul E. McKenney
568c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
569c1d7e01dSWill Deacon	bool
570c1d7e01dSWill Deacon
571c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
572c1d7e01dSWill Deacon	bool
573c1d7e01dSWill Deacon
57448b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
575c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
57648b25c43SChris Metcalf	bool
57748b25c43SChris Metcalf
578282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
579e2cfabdfSWill Drewry	bool
580e2cfabdfSWill Drewry	help
581282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
582282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
583282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
584282a181bSYiFei Zhu	  - __NR_seccomp_read_32
585282a181bSYiFei Zhu	  - __NR_seccomp_write_32
586282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
587282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
588282a181bSYiFei Zhu
589282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
590282a181bSYiFei Zhu	bool
591282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
592282a181bSYiFei Zhu	help
593fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
594282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
595bb6ea430SWill Drewry	  - syscall_get_arch()
596bb6ea430SWill Drewry	  - syscall_get_arguments()
597bb6ea430SWill Drewry	  - syscall_rollback()
598bb6ea430SWill Drewry	  - syscall_set_return_value()
599fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
600fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
601fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
602fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
60348dc92b9SKees Cook	  - seccomp syscall wired up
6040d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
6050d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
6060d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
607e2cfabdfSWill Drewry
608282a181bSYiFei Zhuconfig SECCOMP
609282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
610282a181bSYiFei Zhu	def_bool y
611282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
612282a181bSYiFei Zhu	help
613282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
614282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
615282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
616282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
617282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
618282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
619282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
620282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
621282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
622282a181bSYiFei Zhu
623282a181bSYiFei Zhu	  If unsure, say Y.
624282a181bSYiFei Zhu
625e2cfabdfSWill Drewryconfig SECCOMP_FILTER
626e2cfabdfSWill Drewry	def_bool y
627e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
628e2cfabdfSWill Drewry	help
629e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
630e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
631e2cfabdfSWill Drewry	  task-defined system call filtering polices.
632e2cfabdfSWill Drewry
6335fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
634e2cfabdfSWill Drewry
6350d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
6360d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
6370d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
6380d8315ddSYiFei Zhu	depends on PROC_FS
6390d8315ddSYiFei Zhu	help
6400d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
6410d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
6420d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
6430d8315ddSYiFei Zhu
6440d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
6450d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
6460d8315ddSYiFei Zhu
6470d8315ddSYiFei Zhu	  If unsure, say N.
6480d8315ddSYiFei Zhu
64957fbad15SKees Cookconfig HAVE_ARCH_KSTACK_ERASE
650afaef01cSAlexander Popov	bool
651afaef01cSAlexander Popov	help
652afaef01cSAlexander Popov	  An architecture should select this if it has the code which
65357fbad15SKees Cook	  fills the used part of the kernel stack with the KSTACK_ERASE_POISON
654afaef01cSAlexander Popov	  value before returning from system calls.
655afaef01cSAlexander Popov
656d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
65719952a92SKees Cook	bool
65819952a92SKees Cook	help
65919952a92SKees Cook	  An arch should select this symbol if:
66019952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
66119952a92SKees Cook
662050e9baaSLinus Torvaldsconfig STACKPROTECTOR
6632a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
664d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
6652a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
6662a61f474SMasahiro Yamada	default y
6678779657dSKees Cook	help
6688779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
66919952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
67019952a92SKees Cook	  the stack just before the return address, and validates
67119952a92SKees Cook	  the value just before actually returning.  Stack based buffer
67219952a92SKees Cook	  overflows (that need to overwrite this return address) now also
67319952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
67419952a92SKees Cook	  neutralized via a kernel panic.
67519952a92SKees Cook
6768779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
6778779657dSKees Cook	  have an 8-byte or larger character array on the stack.
6788779657dSKees Cook
67919952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
6808779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
6818779657dSKees Cook
6828779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
6838779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
6848779657dSKees Cook	  by about 0.3%.
6858779657dSKees Cook
686050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
6872a61f474SMasahiro Yamada	bool "Strong Stack Protector"
688050e9baaSLinus Torvalds	depends on STACKPROTECTOR
6892a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
6902a61f474SMasahiro Yamada	default y
6918779657dSKees Cook	help
6928779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
6938779657dSKees Cook	  of the following conditions:
6948779657dSKees Cook
6958779657dSKees Cook	  - local variable's address used as part of the right hand side of an
6968779657dSKees Cook	    assignment or function argument
6978779657dSKees Cook	  - local variable is an array (or union containing an array),
6988779657dSKees Cook	    regardless of array type or length
6998779657dSKees Cook	  - uses register local variables
7008779657dSKees Cook
7018779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
7028779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
7038779657dSKees Cook
7048779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
7058779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
7068779657dSKees Cook	  size by about 2%.
7078779657dSKees Cook
708d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
709d08b9f0cSSami Tolvanen	bool
710d08b9f0cSSami Tolvanen	help
711afcf5441SDan Li	  An architecture should select this if it supports the compiler's
712afcf5441SDan Li	  Shadow Call Stack and implements runtime support for shadow stack
713aa7a65aeSWill Deacon	  switching.
714d08b9f0cSSami Tolvanen
715d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
716afcf5441SDan Li	bool "Shadow Call Stack"
717afcf5441SDan Li	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
71838792972SArd Biesheuvel	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
7196f9dc684SSamuel Holland	depends on MMU
720d08b9f0cSSami Tolvanen	help
721afcf5441SDan Li	  This option enables the compiler's Shadow Call Stack, which
722afcf5441SDan Li	  uses a shadow stack to protect function return addresses from
723afcf5441SDan Li	  being overwritten by an attacker. More information can be found
724afcf5441SDan Li	  in the compiler's documentation:
725d08b9f0cSSami Tolvanen
726afcf5441SDan Li	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
727afcf5441SDan Li	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
728d08b9f0cSSami Tolvanen
729d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
730d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
731d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
732d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
733d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
734d08b9f0cSSami Tolvanen
7359beccca0SArd Biesheuvelconfig DYNAMIC_SCS
7369beccca0SArd Biesheuvel	bool
7379beccca0SArd Biesheuvel	help
7389beccca0SArd Biesheuvel	  Set by the arch code if it relies on code patching to insert the
7399beccca0SArd Biesheuvel	  shadow call stack push and pop instructions rather than on the
7409beccca0SArd Biesheuvel	  compiler.
7419beccca0SArd Biesheuvel
742dc5723b0SSami Tolvanenconfig LTO
743dc5723b0SSami Tolvanen	bool
744dc5723b0SSami Tolvanen	help
745dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
746dc5723b0SSami Tolvanen
747dc5723b0SSami Tolvanenconfig LTO_CLANG
748dc5723b0SSami Tolvanen	bool
749dc5723b0SSami Tolvanen	select LTO
750dc5723b0SSami Tolvanen	help
751dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
752dc5723b0SSami Tolvanen
753dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
754dc5723b0SSami Tolvanen	bool
755dc5723b0SSami Tolvanen	help
756dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
757dc5723b0SSami Tolvanen	  - compiling with Clang,
758dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
759dc5723b0SSami Tolvanen	  - and linking with LLD.
760dc5723b0SSami Tolvanen
761dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
762dc5723b0SSami Tolvanen	bool
763dc5723b0SSami Tolvanen	help
764dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
765dc5723b0SSami Tolvanen	  ThinLTO mode.
766dc5723b0SSami Tolvanen
767dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
768dc5723b0SSami Tolvanen	def_bool y
7691e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
770dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
771dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
772dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
773dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
774349fde59SJakob Koschel	# https://github.com/ClangBuiltLinux/linux/issues/1721
775349fde59SJakob Koschel	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
776349fde59SJakob Koschel	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
777dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
778dc5723b0SSami Tolvanen	help
779dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
780dc5723b0SSami Tolvanen	  LTO.
781dc5723b0SSami Tolvanen
782dc5723b0SSami Tolvanenchoice
783dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
784dc5723b0SSami Tolvanen	default LTO_NONE
785dc5723b0SSami Tolvanen	help
786dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
787dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
788dc5723b0SSami Tolvanen
789dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
790dc5723b0SSami Tolvanen	  so it's disabled by default.
791dc5723b0SSami Tolvanen
792dc5723b0SSami Tolvanenconfig LTO_NONE
793dc5723b0SSami Tolvanen	bool "None"
794dc5723b0SSami Tolvanen	help
795dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
796dc5723b0SSami Tolvanen
797dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
798dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
799dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
800dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
801dc5723b0SSami Tolvanen	select LTO_CLANG
802dc5723b0SSami Tolvanen	help
803dc5723b0SSami Tolvanen	  This option enables Clang's full Link Time Optimization (LTO), which
804dc5723b0SSami Tolvanen	  allows the compiler to optimize the kernel globally. If you enable
805dc5723b0SSami Tolvanen	  this option, the compiler generates LLVM bitcode instead of ELF
806dc5723b0SSami Tolvanen	  object files, and the actual compilation from bitcode happens at
807dc5723b0SSami Tolvanen	  the LTO link step, which may take several minutes depending on the
808dc5723b0SSami Tolvanen	  kernel configuration. More information can be found from LLVM's
809dc5723b0SSami Tolvanen	  documentation:
810dc5723b0SSami Tolvanen
811dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
812dc5723b0SSami Tolvanen
813dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
814dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
815dc5723b0SSami Tolvanen
816dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
817dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
818dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
819dc5723b0SSami Tolvanen	select LTO_CLANG
820dc5723b0SSami Tolvanen	help
821dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
822dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
823dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
824dc5723b0SSami Tolvanen	  from Clang's documentation:
825dc5723b0SSami Tolvanen
826dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
827dc5723b0SSami Tolvanen
828dc5723b0SSami Tolvanen	  If unsure, say Y.
829dc5723b0SSami Tolvanenendchoice
830dc5723b0SSami Tolvanen
831315ad878SRong Xuconfig ARCH_SUPPORTS_AUTOFDO_CLANG
832315ad878SRong Xu	bool
833315ad878SRong Xu
834315ad878SRong Xuconfig AUTOFDO_CLANG
835315ad878SRong Xu	bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
836315ad878SRong Xu	depends on ARCH_SUPPORTS_AUTOFDO_CLANG
837315ad878SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 170000
838315ad878SRong Xu	help
839315ad878SRong Xu	  This option enables Clang’s AutoFDO build. When
840315ad878SRong Xu	  an AutoFDO profile is specified in variable
841315ad878SRong Xu	  CLANG_AUTOFDO_PROFILE during the build process,
842315ad878SRong Xu	  Clang uses the profile to optimize the kernel.
843315ad878SRong Xu
844315ad878SRong Xu	  If no profile is specified, AutoFDO options are
845315ad878SRong Xu	  still passed to Clang to facilitate the collection
846315ad878SRong Xu	  of perf data for creating an AutoFDO profile in
847315ad878SRong Xu	  subsequent builds.
848315ad878SRong Xu
849315ad878SRong Xu	  If unsure, say N.
850315ad878SRong Xu
851d5dc9583SRong Xuconfig ARCH_SUPPORTS_PROPELLER_CLANG
852d5dc9583SRong Xu	bool
853d5dc9583SRong Xu
854d5dc9583SRong Xuconfig PROPELLER_CLANG
855d5dc9583SRong Xu	bool "Enable Clang's Propeller build"
856d5dc9583SRong Xu	depends on ARCH_SUPPORTS_PROPELLER_CLANG
857d5dc9583SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 190000
858d5dc9583SRong Xu	help
859d5dc9583SRong Xu	  This option enables Clang’s Propeller build. When the Propeller
860d5dc9583SRong Xu	  profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX
861d5dc9583SRong Xu	  during the build process, Clang uses the profiles to optimize
862d5dc9583SRong Xu	  the kernel.
863d5dc9583SRong Xu
864d5dc9583SRong Xu	  If no profile is specified, Propeller options are still passed
865d5dc9583SRong Xu	  to Clang to facilitate the collection of perf data for creating
866d5dc9583SRong Xu	  the Propeller profiles in subsequent builds.
867d5dc9583SRong Xu
868d5dc9583SRong Xu	  If unsure, say N.
869d5dc9583SRong Xu
870cf68fffbSSami Tolvanenconfig ARCH_SUPPORTS_CFI_CLANG
871cf68fffbSSami Tolvanen	bool
872cf68fffbSSami Tolvanen	help
873cf68fffbSSami Tolvanen	  An architecture should select this option if it can support Clang's
874cf68fffbSSami Tolvanen	  Control-Flow Integrity (CFI) checking.
875cf68fffbSSami Tolvanen
87689245600SSami Tolvanenconfig ARCH_USES_CFI_TRAPS
87789245600SSami Tolvanen	bool
87889245600SSami Tolvanen
879cf68fffbSSami Tolvanenconfig CFI_CLANG
880cf68fffbSSami Tolvanen	bool "Use Clang's Control Flow Integrity (CFI)"
88189245600SSami Tolvanen	depends on ARCH_SUPPORTS_CFI_CLANG
88289245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
883cf68fffbSSami Tolvanen	help
884c4ca2276SLiu Song	  This option enables Clang's forward-edge Control Flow Integrity
885cf68fffbSSami Tolvanen	  (CFI) checking, where the compiler injects a runtime check to each
886cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
887cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
888cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
889cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
890cf68fffbSSami Tolvanen	  found from Clang's documentation:
891cf68fffbSSami Tolvanen
892cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
893cf68fffbSSami Tolvanen
894ce4a2620SAlice Ryhlconfig CFI_ICALL_NORMALIZE_INTEGERS
895ce4a2620SAlice Ryhl	bool "Normalize CFI tags for integers"
896ce4a2620SAlice Ryhl	depends on CFI_CLANG
8978b8ca9c2SAlice Ryhl	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
898ce4a2620SAlice Ryhl	help
899ce4a2620SAlice Ryhl	  This option normalizes the CFI tags for integer types so that all
900ce4a2620SAlice Ryhl	  integer types of the same size and signedness receive the same CFI
901ce4a2620SAlice Ryhl	  tag.
902ce4a2620SAlice Ryhl
903ce4a2620SAlice Ryhl	  The option is separate from CONFIG_RUST because it affects the ABI.
904ce4a2620SAlice Ryhl	  When working with build systems that care about the ABI, it is
905ce4a2620SAlice Ryhl	  convenient to be able to turn on this flag first, before Rust is
906ce4a2620SAlice Ryhl	  turned on.
907ce4a2620SAlice Ryhl
908ce4a2620SAlice Ryhl	  This option is necessary for using CFI with Rust. If unsure, say N.
909ce4a2620SAlice Ryhl
9108b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
9118b8ca9c2SAlice Ryhl	def_bool y
9124c66f830SAlice Ryhl	depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
9138b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
9142313ab74SAlice Ryhl	depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9154c66f830SAlice Ryhl
9168b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
9178b8ca9c2SAlice Ryhl	def_bool y
9188b8ca9c2SAlice Ryhl	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
9198b8ca9c2SAlice Ryhl	depends on RUSTC_VERSION >= 107900
9208b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
9212313ab74SAlice Ryhl	depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
9228b8ca9c2SAlice Ryhl		(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9234c66f830SAlice Ryhl
924cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
925cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
926cf68fffbSSami Tolvanen	depends on CFI_CLANG
927cf68fffbSSami Tolvanen	help
928cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
929cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
930cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
931cf68fffbSSami Tolvanen
932cf68fffbSSami Tolvanen	  If unsure, say N.
933cf68fffbSSami Tolvanen
9340f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
9350f60a8efSKees Cook	bool
9360f60a8efSKees Cook	help
9370f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
9380f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
9390f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
9400f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
9410f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
9420f60a8efSKees Cook
94324a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
9442b1d5024SFrederic Weisbecker	bool
9452b1d5024SFrederic Weisbecker	help
94691d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
94791d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
948490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
949490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
950490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
9516f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
952490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
953490f561bSFrederic Weisbecker
95424a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
95583c2da2eSFrederic Weisbecker	bool
95683c2da2eSFrederic Weisbecker	help
95783c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
95883c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
95983c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
960d65d411cSValentin Schneider	  while context tracking is CT_STATE_USER. This feature reflects a sane
96183c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
96283c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
96383c2da2eSFrederic Weisbecker
96483c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
96583c2da2eSFrederic Weisbecker	    not interruptible).
966493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
96783c2da2eSFrederic Weisbecker	    got called.
96883c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
96983c2da2eSFrederic Weisbecker	    called.
97083c2da2eSFrederic Weisbecker
971490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
972490f561bSFrederic Weisbecker	bool
973490f561bSFrederic Weisbecker	help
974490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
975490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
9762b1d5024SFrederic Weisbecker
977b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
978b952741cSFrederic Weisbecker	bool
979b952741cSFrederic Weisbecker
9802b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
9812b91ec9fSFrederic Weisbecker	bool
9822b91ec9fSFrederic Weisbecker	help
9832b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
9842b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
9852b91ec9fSFrederic Weisbecker
98640565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
98740565b5aSStanislaw Gruszka	bool
98840565b5aSStanislaw Gruszka
989554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
990554b0004SKevin Hilman	bool
991554b0004SKevin Hilman	default y if 64BIT
992554b0004SKevin Hilman	help
993554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
994554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
995554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
996554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
997554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
998554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
999554b0004SKevin Hilman
1000fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
1001fdf9c356SFrederic Weisbecker	bool
1002fdf9c356SFrederic Weisbecker	help
1003fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
1004fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
1005fdf9c356SFrederic Weisbecker
1006c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
1007c49dd340SKalesh Singh	bool
1008c49dd340SKalesh Singh	help
1009c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
1010c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
1011c49dd340SKalesh Singh	  happens at the PGD level.
1012c49dd340SKalesh Singh
10132c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
10142c91bd4aSJoel Fernandes (Google)	bool
10152c91bd4aSJoel Fernandes (Google)	help
10162c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
10172c91bd4aSJoel Fernandes (Google)
101815626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
101915626062SGerald Schaefer	bool
102015626062SGerald Schaefer
1021a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
1022a00cc7d9SMatthew Wilcox	bool
1023a00cc7d9SMatthew Wilcox
10240ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
10250ddab1d2SToshi Kani	bool
10260ddab1d2SToshi Kani
1027121e6f32SNicholas Piggin#
1028121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
1029559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
1030559089e0SSong Liu#  must be used to enable allocations to use hugepages.
1031121e6f32SNicholas Piggin#
1032121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
1033121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
1034121e6f32SNicholas Piggin	bool
1035121e6f32SNicholas Piggin
10363876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
10373876d4a3SAlexandre Ghiti	bool
10383876d4a3SAlexandre Ghiti
10392f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
10402f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
10412f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
10422f0584f3SRick Edgecombe	bool
10432f0584f3SRick Edgecombe
10442f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
10452f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
10462f0584f3SRick Edgecombe
10470f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
10480f8975ecSPavel Emelyanov	bool
10490f8975ecSPavel Emelyanov
1050786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
1051786d35d4SDavid Howells	bool
1052786d35d4SDavid Howells	help
1053786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
1054786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
1055786d35d4SDavid Howells	  should not enable this.
1056786d35d4SDavid Howells
1057786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
1058786d35d4SDavid Howells	bool
1059786d35d4SDavid Howells	help
1060786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
1061786d35d4SDavid Howells	  relocations will give an error.
1062786d35d4SDavid Howells
1063786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
1064786d35d4SDavid Howells	bool
1065786d35d4SDavid Howells	help
1066786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
1067786d35d4SDavid Howells	  relocations will give an error.
1068786d35d4SDavid Howells
106901dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
107001dc0386SChristophe Leroy	bool
107101dc0386SChristophe Leroy	help
107201dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
107301dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
107401dc0386SChristophe Leroy
1075223b5e57SMike Rapoport (IBM)config ARCH_WANTS_EXECMEM_LATE
1076223b5e57SMike Rapoport (IBM)	bool
1077223b5e57SMike Rapoport (IBM)	help
1078223b5e57SMike Rapoport (IBM)	  For architectures that do not allocate executable memory early on
1079223b5e57SMike Rapoport (IBM)	  boot, but rather require its initialization late when there is
1080223b5e57SMike Rapoport (IBM)	  enough entropy for module space randomization, for instance
1081223b5e57SMike Rapoport (IBM)	  arm64.
1082223b5e57SMike Rapoport (IBM)
10832e45474aSMike Rapoport (Microsoft)config ARCH_HAS_EXECMEM_ROX
10842e45474aSMike Rapoport (Microsoft)	bool
10852e45474aSMike Rapoport (Microsoft)	depends on MMU && !HIGHMEM
10862e45474aSMike Rapoport (Microsoft)	help
10872e45474aSMike Rapoport (Microsoft)	  For architectures that support allocations of executable memory
10882e45474aSMike Rapoport (Microsoft)	  with read-only execute permissions. Architecture must implement
10892e45474aSMike Rapoport (Microsoft)	  execmem_fill_trapping_insns() callback to enable this.
10902e45474aSMike Rapoport (Microsoft)
1091cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
1092cc1f0274SFrederic Weisbecker	bool
1093cc1f0274SFrederic Weisbecker	help
1094cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
1095cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
1096cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
1097cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
1098cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
1099cc1f0274SFrederic Weisbecker	  processing.
1100cc1f0274SFrederic Weisbecker
1101cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
1102cd1a41ceSThomas Gleixner	bool
1103cd1a41ceSThomas Gleixner	help
1104cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
1105c226bc3cSColin Ian King	  separate stack.
1106cd1a41ceSThomas Gleixner
11078cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
11088cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
11098cbb2b50SSebastian Andrzej Siewior
111012700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
111112700c17SArnd Bergmann	bool
111212700c17SArnd Bergmann	help
111312700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
111412700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
111512700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
111612700c17SArnd Bergmann
1117235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
1118235a8f02SKirill A. Shutemov	int
1119235a8f02SKirill A. Shutemov	default 2
1120235a8f02SKirill A. Shutemov
11212b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
11222b68f6caSKees Cook	bool
11232b68f6caSKees Cook	help
11242b68f6caSKees Cook	  An architecture supports choosing randomized locations for
11252b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
11262b68f6caSKees Cook	  - arch_mmap_rnd()
1127204db6edSKees Cook	  - arch_randomize_brk()
11282b68f6caSKees Cook
1129d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1130d07e2259SDaniel Cashman	bool
1131d07e2259SDaniel Cashman	help
1132d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1133d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1134d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1135d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1136d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1137d07e2259SDaniel Cashman
11385f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
11395f56a5dfSJiri Slaby	bool
11405f56a5dfSJiri Slaby	help
11415f56a5dfSJiri Slaby	  An architecture implements exit_thread.
11425f56a5dfSJiri Slaby
1143d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1144d07e2259SDaniel Cashman	int
1145d07e2259SDaniel Cashman
1146d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1147d07e2259SDaniel Cashman	int
1148d07e2259SDaniel Cashman
1149d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1150d07e2259SDaniel Cashman	int
1151d07e2259SDaniel Cashman
1152d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1153d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1154d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1155d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1156d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1157d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1158d07e2259SDaniel Cashman	help
1159d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1160d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1161d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1162d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1163d07e2259SDaniel Cashman
1164d07e2259SDaniel Cashman	  This value can be changed after boot using the
1165d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1166d07e2259SDaniel Cashman
1167d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1168d07e2259SDaniel Cashman	bool
1169d07e2259SDaniel Cashman	help
1170d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1171d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1172d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1173d07e2259SDaniel Cashman	  enabled and provides values for both:
1174d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1175d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1176d07e2259SDaniel Cashman
1177d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1178d07e2259SDaniel Cashman	int
1179d07e2259SDaniel Cashman
1180d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1181d07e2259SDaniel Cashman	int
1182d07e2259SDaniel Cashman
1183d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1184d07e2259SDaniel Cashman	int
1185d07e2259SDaniel Cashman
1186d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1187d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1188d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1189d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1190d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1191d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1192d07e2259SDaniel Cashman	help
1193d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1194d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1195d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1196d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1197d07e2259SDaniel Cashman	  supported values.
1198d07e2259SDaniel Cashman
1199d07e2259SDaniel Cashman	  This value can be changed after boot using the
1200d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1201d07e2259SDaniel Cashman
12021b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
12031b028f78SDmitry Safonov	bool
12041b028f78SDmitry Safonov	help
12051b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
12061b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
12071b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
12081b028f78SDmitry Safonov
1209ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1210ba89f9c8SArnd Bergmann	bool
1211ba89f9c8SArnd Bergmann
1212ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1213ba89f9c8SArnd Bergmann	bool
1214ba89f9c8SArnd Bergmann
1215ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1216ba89f9c8SArnd Bergmann	bool
1217ba89f9c8SArnd Bergmann
1218ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1219ba89f9c8SArnd Bergmann	bool
1220ba89f9c8SArnd Bergmann
1221ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1222ba89f9c8SArnd Bergmann	bool
1223ba89f9c8SArnd Bergmann
1224ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1225ba89f9c8SArnd Bergmann	bool
1226ba89f9c8SArnd Bergmann
1227ba89f9c8SArnd Bergmannchoice
1228ba89f9c8SArnd Bergmann	prompt "MMU page size"
1229ba89f9c8SArnd Bergmann
1230ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1231ba89f9c8SArnd Bergmann	bool "4KiB pages"
1232ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1233ba89f9c8SArnd Bergmann	help
1234ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1235ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1236ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1237ba89f9c8SArnd Bergmann	  memory systems.
1238ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1239ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1240ba89f9c8SArnd Bergmann
1241ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1242ba89f9c8SArnd Bergmann	bool "8KiB pages"
1243ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1244ba89f9c8SArnd Bergmann	help
1245ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1246ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1247ba89f9c8SArnd Bergmann
1248ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1249ba89f9c8SArnd Bergmann	bool "16KiB pages"
1250ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1251ba89f9c8SArnd Bergmann	help
1252ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1253ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1254ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1255ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1256ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1257ba89f9c8SArnd Bergmann	  page cache.
1258ba89f9c8SArnd Bergmann
1259ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1260ba89f9c8SArnd Bergmann	bool "32KiB pages"
1261ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1262ba89f9c8SArnd Bergmann	help
1263ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1264ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1265ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1266ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1267ba89f9c8SArnd Bergmann	  support this.
1268ba89f9c8SArnd Bergmann
1269ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1270ba89f9c8SArnd Bergmann	bool "64KiB pages"
1271ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1272ba89f9c8SArnd Bergmann	help
1273ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1274ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1275ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1276ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1277ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1278ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1279ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1280ba89f9c8SArnd Bergmann
1281ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1282ba89f9c8SArnd Bergmann	bool "256KiB pages"
1283ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1284ba89f9c8SArnd Bergmann	help
1285ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1286ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1287ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1288ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1289ba89f9c8SArnd Bergmann
1290ba89f9c8SArnd Bergmannendchoice
1291ba89f9c8SArnd Bergmann
12921f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
12931f0e290cSGuenter Roeck	def_bool y
12941f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1295e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1296e4bbd20dSNathan Chancellor
1297e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1298e4bbd20dSNathan Chancellor	def_bool y
12991f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
13001f0e290cSGuenter Roeck
1301ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1302ba89f9c8SArnd Bergmann	int
1303ba89f9c8SArnd Bergmann	default	12 if PAGE_SIZE_4KB
1304ba89f9c8SArnd Bergmann	default	13 if PAGE_SIZE_8KB
1305ba89f9c8SArnd Bergmann	default	14 if PAGE_SIZE_16KB
1306ba89f9c8SArnd Bergmann	default	15 if PAGE_SIZE_32KB
1307ba89f9c8SArnd Bergmann	default	16 if PAGE_SIZE_64KB
1308ba89f9c8SArnd Bergmann	default	18 if PAGE_SIZE_256KB
1309ba89f9c8SArnd Bergmann
131067f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
131167f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
131267f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
131367f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
131467f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
131567f3977fSAlexandre Ghiti# - STACK_RND_MASK
131667f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
131767f3977fSAlexandre Ghiti	bool
131867f3977fSAlexandre Ghiti	depends on MMU
1319e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
132067f3977fSAlexandre Ghiti
132103f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
132203f16cd0SJosh Poimboeuf	bool
132303f16cd0SJosh Poimboeuf
13244ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
13254ab7674fSJosh Poimboeuf	bool
13264ab7674fSJosh Poimboeuf
132722102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
132822102f45SJosh Poimboeuf	bool
132922102f45SJosh Poimboeuf
1330489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1331489e355bSJosh Poimboeuf	bool
1332489e355bSJosh Poimboeuf
13335f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
13345f3da8c0SJosh Poimboeuf	bool
13355f3da8c0SJosh Poimboeuf	select OBJTOOL
13365f3da8c0SJosh Poimboeuf
1337b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1338b9ab5ebbSJosh Poimboeuf	bool
1339b9ab5ebbSJosh Poimboeuf	help
134003f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
134103f16cd0SJosh Poimboeuf	  validation.
1342b9ab5ebbSJosh Poimboeuf
1343af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1344af085d90SJosh Poimboeuf	bool
1345af085d90SJosh Poimboeuf	help
1346140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1347140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1348140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1349af085d90SJosh Poimboeuf
1350468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1351468a9428SGeorge Spelvin	bool
1352468a9428SGeorge Spelvin	default n
1353468a9428SGeorge Spelvin	help
1354468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1355468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1356468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1357468a9428SGeorge Spelvin
1358666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1359666047feSFinn Thain	bool
1360666047feSFinn Thain
13613a495511SWilliam Breathitt Grayconfig ISA_BUS_API
13623a495511SWilliam Breathitt Gray	def_bool ISA
13633a495511SWilliam Breathitt Gray
1364d2125043SAl Viro#
1365d2125043SAl Viro# ABI hall of shame
1366d2125043SAl Viro#
1367d2125043SAl Viroconfig CLONE_BACKWARDS
1368d2125043SAl Viro	bool
1369d2125043SAl Viro	help
1370d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1371d2125043SAl Viro	  not the 5th one.
1372d2125043SAl Viro
1373d2125043SAl Viroconfig CLONE_BACKWARDS2
1374d2125043SAl Viro	bool
1375d2125043SAl Viro	help
1376d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1377d2125043SAl Viro
1378dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1379dfa9771aSMichal Simek	bool
1380dfa9771aSMichal Simek	help
1381dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1382dfa9771aSMichal Simek	  not the 5th one.
1383dfa9771aSMichal Simek
1384eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1385eaca6eaeSAl Viro	bool
1386eaca6eaeSAl Viro	help
1387eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1388eaca6eaeSAl Viro
13890a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
13900a0e8cdfSAl Viro	bool
13910a0e8cdfSAl Viro	help
13920a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
13930a0e8cdfSAl Viro
13940a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
13950a0e8cdfSAl Viro	bool
13960a0e8cdfSAl Viro	help
13970a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
13980a0e8cdfSAl Viro
1399495dfbf7SAl Viroconfig OLD_SIGACTION
1400495dfbf7SAl Viro	bool
1401495dfbf7SAl Viro	help
1402495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1403495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1404495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1405495dfbf7SAl Viro	  compatibility...
1406495dfbf7SAl Viro
1407495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1408495dfbf7SAl Viro	bool
1409495dfbf7SAl Viro
141017435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1411942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1412942437c9SArnd Bergmann	default !64BIT || COMPAT
141317435e5fSDeepa Dinamani	help
141417435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
141517435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
141617435e5fSDeepa Dinamani	  as part of compat syscall handling.
141717435e5fSDeepa Dinamani
141887a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
141987a4c375SChristoph Hellwig	bool
142087a4c375SChristoph Hellwig
1421a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1422a50a3f4bSThomas Gleixner	bool
1423a50a3f4bSThomas Gleixner
1424fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1425fff7fb0bSZhaoxiu Zeng	def_bool n
1426fff7fb0bSZhaoxiu Zeng
1427ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1428ba14a194SAndy Lutomirski	def_bool n
1429ba14a194SAndy Lutomirski	help
1430ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1431ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1432ba14a194SAndy Lutomirski
1433ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1434ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1435ba14a194SAndy Lutomirski
1436ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1437ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1438ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1439ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1440ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1441ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1442ba14a194SAndy Lutomirski
1443ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1444ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1445ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1446ba14a194SAndy Lutomirski
1447ba14a194SAndy Lutomirskiconfig VMAP_STACK
1448ba14a194SAndy Lutomirski	default y
1449ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1450eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
145138dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1452a7f7f624SMasahiro Yamada	help
1453ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1454ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1455ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1456ba14a194SAndy Lutomirski	  corruption.
1457ba14a194SAndy Lutomirski
145838dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
145938dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
146038dd767dSAndrey Konovalov	  must be enabled.
1461ba14a194SAndy Lutomirski
146239218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
146339218ff4SKees Cook	def_bool n
146439218ff4SKees Cook	help
146539218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
146639218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
146739218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
146839218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
146939218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
147039218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
147139218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
147239218ff4SKees Cook	  of the static branch state.
147339218ff4SKees Cook
14748cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
14758cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
14768cb37a59SMarco Elver	default y
147739218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
1478efa90c11SMarco Elver	depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
147939218ff4SKees Cook	help
148039218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
148139218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
148239218ff4SKees Cook	  attacks that depend on stack address determinism or
14838cb37a59SMarco Elver	  cross-syscall address exposures.
14848cb37a59SMarco Elver
14858cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
14868cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
14878cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
14888cb37a59SMarco Elver
14898cb37a59SMarco Elver	  If unsure, say Y.
14908cb37a59SMarco Elver
14918cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
14928cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
14938cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
14948cb37a59SMarco Elver	help
14958cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
14968cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
14978cb37a59SMarco Elver	  boot state.
149839218ff4SKees Cook
1499ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1500ad21fc4fSLaura Abbott	def_bool n
1501ad21fc4fSLaura Abbott
1502ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1503ad21fc4fSLaura Abbott	def_bool n
1504ad21fc4fSLaura Abbott
1505ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1506ad21fc4fSLaura Abbott	def_bool n
1507ad21fc4fSLaura Abbott
15080f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1509ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1510ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1511ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1512ad21fc4fSLaura Abbott	help
1513ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1514ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1515ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1516ad21fc4fSLaura Abbott	  or modifying text)
1517ad21fc4fSLaura Abbott
1518ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1519ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1520ad21fc4fSLaura Abbott
1521ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1522ad21fc4fSLaura Abbott	def_bool n
1523ad21fc4fSLaura Abbott
15240f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1525ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1526ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1527ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1528ad21fc4fSLaura Abbott	help
1529ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1530ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1531ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1532ad21fc4fSLaura Abbott
1533ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1534ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1535ea8c64acSChristoph Hellwig	bool
1536ea8c64acSChristoph Hellwig
1537bff70402SJames Morseconfig ARCH_HAS_CPU_RESCTRL
1538bff70402SJames Morse	bool
1539bff70402SJames Morse	help
1540bff70402SJames Morse	  An architecture selects this option to indicate that the necessary
1541bff70402SJames Morse	  hooks are provided to support the common memory system usage
1542bff70402SJames Morse	  monitoring and control interfaces provided by the 'resctrl'
1543bff70402SJames Morse	  filesystem (see RESCTRL_FS).
1544bff70402SJames Morse
154504f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
154604f264d3SPaul Burton	bool
154704f264d3SPaul Burton	help
154804f264d3SPaul Burton	  An architecture can select this if it provides an
154904f264d3SPaul Burton	  asm/compiler.h header that should be included after
155004f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
155104f264d3SPaul Burton	  headers generally provide.
155204f264d3SPaul Burton
1553e419ddeaSGreg Ungererconfig HAVE_ARCH_LIBGCC_H
1554e419ddeaSGreg Ungerer	bool
1555e419ddeaSGreg Ungerer	help
1556e419ddeaSGreg Ungerer	  An architecture can select this if it provides an
1557e419ddeaSGreg Ungerer	  asm/libgcc.h header that should be included after
1558e419ddeaSGreg Ungerer	  linux/libgcc.h in order to override macro definitions that
1559e419ddeaSGreg Ungerer	  header generally provides.
1560e419ddeaSGreg Ungerer
1561271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1562271ca788SArd Biesheuvel	bool
1563271ca788SArd Biesheuvel	help
1564271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1565271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1566271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1567271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1568271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1569271ca788SArd Biesheuvel	  kernels.
1570271ca788SArd Biesheuvel
1571ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1572ce9084baSArd Biesheuvel	bool
1573ce9084baSArd Biesheuvel
1574fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1575fb346fd9SWaiman Long	bool "Locking event counts collection"
1576fb346fd9SWaiman Long	depends on DEBUG_FS
1577a7f7f624SMasahiro Yamada	help
1578fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1579fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1580fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1581fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1582fb346fd9SWaiman Long
15835cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
15845cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
15855cf896fbSPeter Collingbourne	bool
15865cf896fbSPeter Collingbourne
15875cf896fbSPeter Collingbourneconfig RELR
15885cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
15895cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
15905cf896fbSPeter Collingbourne	default y
15915cf896fbSPeter Collingbourne	help
15925cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
15935cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
15945cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
15955cf896fbSPeter Collingbourne	  are compatible).
15965cf896fbSPeter Collingbourne
15970c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
15980c9c1d56SThiago Jung Bauermann	bool
15990c9c1d56SThiago Jung Bauermann
160046b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
160146b49b12STom Lendacky	bool
160246b49b12STom Lendacky
16030e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
16040e242208SHassan Naveed	bool
16050e242208SHassan Naveed	help
16060e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
16070e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
16080e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
16090e242208SHassan Naveed	  related optimizations for a given architecture.
16100e242208SHassan Naveed
1611365841e1SThomas Weißschuhconfig ARCH_HAS_VDSO_ARCH_DATA
1612365841e1SThomas Weißschuh	depends on GENERIC_VDSO_DATA_STORE
1613365841e1SThomas Weißschuh	bool
1614365841e1SThomas Weißschuh
1615a812eee0SNam Caoconfig ARCH_HAS_VDSO_TIME_DATA
1616d60d7de3SSven Schnelle	bool
1617d60d7de3SSven Schnelle
1618115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1619115284d8SJosh Poimboeuf	bool
1620115284d8SJosh Poimboeuf
16219183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
16229183c3f9SJosh Poimboeuf	bool
16239183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
162403f16cd0SJosh Poimboeuf	select OBJTOOL
16259183c3f9SJosh Poimboeuf
16266ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
16276ef869e0SMichal Hocko	bool
162899cf983cSMark Rutland
162999cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
163099cf983cSMark Rutland	bool
16316ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
163299cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
16336ef869e0SMichal Hocko	help
163499cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
163599cf983cSMark Rutland	  model being selected at boot time using static calls.
163699cf983cSMark Rutland
163799cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
163899cf983cSMark Rutland	  preemption function will be patched directly.
163999cf983cSMark Rutland
164099cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
164199cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
164299cf983cSMark Rutland	  trampoline will be patched.
164399cf983cSMark Rutland
164499cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
164599cf983cSMark Rutland	  overhead.
164699cf983cSMark Rutland
164799cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
164899cf983cSMark Rutland	bool
1649a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
165099cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
165199cf983cSMark Rutland	help
165299cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
165399cf983cSMark Rutland	  model being selected at boot time using static keys.
165499cf983cSMark Rutland
165599cf983cSMark Rutland	  Each preemption function will be given an early return based on a
165699cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
165799cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
165899cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
165999cf983cSMark Rutland	  integrate better with CFI schemes.
166099cf983cSMark Rutland
166199cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
166299cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
16636ef869e0SMichal Hocko
166459612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
166559612b24SNathan Chancellor	bool
166659612b24SNathan Chancellor	help
166759612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
166859612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
166959612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
167059612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
167159612b24SNathan Chancellor	  versions.
167259612b24SNathan Chancellor
16734f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
16744f5b0c17SMike Rapoport	bool
16754f5b0c17SMike Rapoport
16765d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
16775d6ad668SMike Rapoport	bool
16785d6ad668SMike Rapoport
1679df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1680df4e817bSPasha Tatashin	bool
1681df4e817bSPasha Tatashin
16822ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
16832ca408d9SBrian Gerst	bool
16842ca408d9SBrian Gerst	help
16852ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
16862ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
16872ca408d9SBrian Gerst
16887facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
16897facdc42SAl Viro	bool
16907facdc42SAl Viro
169158e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
169258e106e7SBalbir Singh	bool
169358e106e7SBalbir Singh
1694d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1695d593d64fSPrasad Sodagudi	bool
1696d593d64fSPrasad Sodagudi
16971bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
16981bdda24cSThomas Gleixner	bool
16991bdda24cSThomas Gleixner
170050468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
170150468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
170250468e43SJarkko Sakkinen	bool
170350468e43SJarkko Sakkinen
170471ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
170571ce1ab5SKinsey Ho	bool
170671ce1ab5SKinsey Ho	help
170771ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
170871ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
170971ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
171071ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
171171ce1ab5SKinsey Ho
1712eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1713eed9a328SYu Zhao	bool
1714eed9a328SYu Zhao	help
1715eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1716eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1717eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1718eed9a328SYu Zhao	  may use this capability to reduce their search space.
1719eed9a328SYu Zhao
17206cbd1d6dSSamuel Hollandconfig ARCH_HAS_KERNEL_FPU_SUPPORT
17216cbd1d6dSSamuel Holland	bool
17226cbd1d6dSSamuel Holland	help
17236cbd1d6dSSamuel Holland	  Architectures that select this option can run floating-point code in
17246cbd1d6dSSamuel Holland	  the kernel, as described in Documentation/core-api/floating-point.rst.
17256cbd1d6dSSamuel Holland
17269b400d17SArd Biesheuvelconfig ARCH_VMLINUX_NEEDS_RELOCS
17279b400d17SArd Biesheuvel	bool
17289b400d17SArd Biesheuvel	help
17299b400d17SArd Biesheuvel	  Whether the architecture needs vmlinux to be built with static
17309b400d17SArd Biesheuvel	  relocations preserved. This is used by some architectures to
17319b400d17SArd Biesheuvel	  construct bespoke relocation tables for KASLR.
17329b400d17SArd Biesheuvel
17332521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
173445332b1bSMasahiro Yamada
173545332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1736fa1b5d09SLinus Torvalds
1737d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1738d49a0626SPeter Zijlstra	bool
1739d49a0626SPeter Zijlstra
1740d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1741d49a0626SPeter Zijlstra	bool
1742d49a0626SPeter Zijlstra
1743d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1744d49a0626SPeter Zijlstra	bool
1745d49a0626SPeter Zijlstra
1746d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1747d49a0626SPeter Zijlstra	bool
1748d49a0626SPeter Zijlstra
1749d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1750d49a0626SPeter Zijlstra	bool
1751d49a0626SPeter Zijlstra
1752d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1753d49a0626SPeter Zijlstra	int
1754d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1755d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1756d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1757d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1758d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1759d49a0626SPeter Zijlstra	default 0
1760d49a0626SPeter Zijlstra
17615270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
17625270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
17635270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
17645270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
17655270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
17665270316cSPetr Pavlu
17675270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
17685270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
17695270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
17705270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
17715270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
17725270316cSPetr Pavlu
1773a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1774a88d970cSPaul E. McKenney	bool
1775a88d970cSPaul E. McKenney
17761198c9c6SNaveen N Raoconfig ARCH_WANTS_PRE_LINK_VMLINUX
17771198c9c6SNaveen N Rao	bool
17781198c9c6SNaveen N Rao	help
17791198c9c6SNaveen N Rao	  An architecture can select this if it provides arch/<arch>/tools/Makefile
17801198c9c6SNaveen N Rao	  with .arch.vmlinux.o target to be linked into vmlinux.
17811198c9c6SNaveen N Rao
1782735e5920SDavid Kaplanconfig ARCH_HAS_CPU_ATTACK_VECTORS
1783735e5920SDavid Kaplan	bool
1784735e5920SDavid Kaplan
178522471e13SRandy Dunlapendmenu
1786