xref: /linux/arch/Kconfig (revision 509d3f45847627f4c5cdce004c3ec79262b5239c)
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
447bd291abSPeter Zijlstraconfig ARCH_SUPPORTS_SCHED_SMT
457bd291abSPeter Zijlstra	bool
467bd291abSPeter Zijlstra
477bd291abSPeter Zijlstraconfig ARCH_SUPPORTS_SCHED_CLUSTER
487bd291abSPeter Zijlstra	bool
497bd291abSPeter Zijlstra
507bd291abSPeter Zijlstraconfig ARCH_SUPPORTS_SCHED_MC
517bd291abSPeter Zijlstra	bool
527bd291abSPeter Zijlstra
537bd291abSPeter Zijlstraconfig SCHED_SMT
547bd291abSPeter Zijlstra	bool "SMT (Hyperthreading) scheduler support"
557bd291abSPeter Zijlstra	depends on ARCH_SUPPORTS_SCHED_SMT
567bd291abSPeter Zijlstra	default y
577bd291abSPeter Zijlstra	help
587bd291abSPeter Zijlstra	  Improves the CPU scheduler's decision making when dealing with
597bd291abSPeter Zijlstra	  MultiThreading at a cost of slightly increased overhead in some
607bd291abSPeter Zijlstra	  places. If unsure say N here.
617bd291abSPeter Zijlstra
627bd291abSPeter Zijlstraconfig SCHED_CLUSTER
637bd291abSPeter Zijlstra	bool "Cluster scheduler support"
647bd291abSPeter Zijlstra	depends on ARCH_SUPPORTS_SCHED_CLUSTER
657bd291abSPeter Zijlstra	default y
667bd291abSPeter Zijlstra	help
677bd291abSPeter Zijlstra	  Cluster scheduler support improves the CPU scheduler's decision
687bd291abSPeter Zijlstra	  making when dealing with machines that have clusters of CPUs.
697bd291abSPeter Zijlstra	  Cluster usually means a couple of CPUs which are placed closely
707bd291abSPeter Zijlstra	  by sharing mid-level caches, last-level cache tags or internal
717bd291abSPeter Zijlstra	  busses.
727bd291abSPeter Zijlstra
737bd291abSPeter Zijlstraconfig SCHED_MC
747bd291abSPeter Zijlstra	bool "Multi-Core Cache (MC) scheduler support"
757bd291abSPeter Zijlstra	depends on ARCH_SUPPORTS_SCHED_MC
767bd291abSPeter Zijlstra	default y
777bd291abSPeter Zijlstra	help
787bd291abSPeter Zijlstra	  Multi-core scheduler support improves the CPU scheduler's decision
797bd291abSPeter Zijlstra	  making when dealing with multi-core CPU chips at a cost of slightly
807bd291abSPeter Zijlstra	  increased overhead in some places. If unsure say N here.
817bd291abSPeter Zijlstra
826f062123SThomas Gleixner# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
836f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC
846f062123SThomas Gleixner	bool
856f062123SThomas Gleixner
866f062123SThomas Gleixner# Basic CPU dead synchronization selected by architecture
876f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_DEAD
886f062123SThomas Gleixner	bool
896f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
906f062123SThomas Gleixner
916f062123SThomas Gleixner# Full CPU synchronization with alive state selected by architecture
926f062123SThomas Gleixnerconfig HOTPLUG_CORE_SYNC_FULL
936f062123SThomas Gleixner	bool
946f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
956f062123SThomas Gleixner	select HOTPLUG_CORE_SYNC
966f062123SThomas Gleixner
97a631be92SThomas Gleixnerconfig HOTPLUG_SPLIT_STARTUP
98a631be92SThomas Gleixner	bool
99a631be92SThomas Gleixner	select HOTPLUG_CORE_SYNC_FULL
100a631be92SThomas Gleixner
10118415f33SThomas Gleixnerconfig HOTPLUG_PARALLEL
10218415f33SThomas Gleixner	bool
10318415f33SThomas Gleixner	select HOTPLUG_SPLIT_STARTUP
10418415f33SThomas Gleixner
105a70e9f64SJinjie Ruanconfig GENERIC_IRQ_ENTRY
106a70e9f64SJinjie Ruan	bool
107a70e9f64SJinjie Ruan
108a70e9f64SJinjie Ruanconfig GENERIC_SYSCALL
109a70e9f64SJinjie Ruan	bool
110a70e9f64SJinjie Ruan	depends on GENERIC_IRQ_ENTRY
111a70e9f64SJinjie Ruan
112142781e1SThomas Gleixnerconfig GENERIC_ENTRY
113142781e1SThomas Gleixner	bool
114a70e9f64SJinjie Ruan	select GENERIC_IRQ_ENTRY
115a70e9f64SJinjie Ruan	select GENERIC_SYSCALL
116142781e1SThomas Gleixner
117125e5645SMathieu Desnoyersconfig KPROBES
118125e5645SMathieu Desnoyers	bool "Kprobes"
119125e5645SMathieu Desnoyers	depends on HAVE_KPROBES
12005ed160eSMasami Hiramatsu	select KALLSYMS
1217582b7beSMike Rapoport (IBM)	select EXECMEM
122900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
123125e5645SMathieu Desnoyers	help
124125e5645SMathieu Desnoyers	  Kprobes allows you to trap at almost any kernel address and
125125e5645SMathieu Desnoyers	  execute a callback function.  register_kprobe() establishes
126125e5645SMathieu Desnoyers	  a probepoint and specifies the callback.  Kprobes is useful
127125e5645SMathieu Desnoyers	  for kernel debugging, non-intrusive instrumentation and testing.
128125e5645SMathieu Desnoyers	  If in doubt, say "N".
129125e5645SMathieu Desnoyers
13045f81b1cSSteven Rostedtconfig JUMP_LABEL
131c5905afbSIngo Molnar	bool "Optimize very unlikely/likely branches"
13245f81b1cSSteven Rostedt	depends on HAVE_ARCH_JUMP_LABEL
1334ab7674fSJosh Poimboeuf	select OBJTOOL if HAVE_JUMP_LABEL_HACK
13445f81b1cSSteven Rostedt	help
135c5905afbSIngo Molnar	  This option enables a transparent branch optimization that
136c5905afbSIngo Molnar	  makes certain almost-always-true or almost-always-false branch
137c5905afbSIngo Molnar	  conditions even cheaper to execute within the kernel.
13845f81b1cSSteven Rostedt
139c5905afbSIngo Molnar	  Certain performance-sensitive kernel code, such as trace points,
140c5905afbSIngo Molnar	  scheduler functionality, networking code and KVM have such
141c5905afbSIngo Molnar	  branches and include support for this optimization technique.
142c5905afbSIngo Molnar
143c5905afbSIngo Molnar	  If it is detected that the compiler has support for "asm goto",
144c5905afbSIngo Molnar	  the kernel will compile such branches with just a nop
145c5905afbSIngo Molnar	  instruction. When the condition flag is toggled to true, the
146c5905afbSIngo Molnar	  nop will be converted to a jump instruction to execute the
147c5905afbSIngo Molnar	  conditional block of instructions.
148c5905afbSIngo Molnar
149c5905afbSIngo Molnar	  This technique lowers overhead and stress on the branch prediction
150c5905afbSIngo Molnar	  of the processor and generally makes the kernel faster. The update
151c5905afbSIngo Molnar	  of the condition is slower, but those are always very rare.
152c5905afbSIngo Molnar
153c5905afbSIngo Molnar	  ( On 32-bit x86, the necessary options added to the compiler
154c5905afbSIngo Molnar	    flags may increase the size of the kernel slightly. )
15545f81b1cSSteven Rostedt
1561987c947SPeter Zijlstraconfig STATIC_KEYS_SELFTEST
1571987c947SPeter Zijlstra	bool "Static key selftest"
1581987c947SPeter Zijlstra	depends on JUMP_LABEL
1591987c947SPeter Zijlstra	help
1601987c947SPeter Zijlstra	  Boot time self-test of the branch patching code.
1611987c947SPeter Zijlstra
162f03c4129SPeter Zijlstraconfig STATIC_CALL_SELFTEST
163f03c4129SPeter Zijlstra	bool "Static call selftest"
164f03c4129SPeter Zijlstra	depends on HAVE_STATIC_CALL
165f03c4129SPeter Zijlstra	help
166f03c4129SPeter Zijlstra	  Boot time self-test of the call patching code.
167f03c4129SPeter Zijlstra
168afd66255SMasami Hiramatsuconfig OPTPROBES
1695cc718b9SMasami Hiramatsu	def_bool y
1705cc718b9SMasami Hiramatsu	depends on KPROBES && HAVE_OPTPROBES
171900da4d2SPaul E. McKenney	select NEED_TASKS_RCU
172afd66255SMasami Hiramatsu
173e7dbfe34SMasami Hiramatsuconfig KPROBES_ON_FTRACE
174e7dbfe34SMasami Hiramatsu	def_bool y
175e7dbfe34SMasami Hiramatsu	depends on KPROBES && HAVE_KPROBES_ON_FTRACE
176e7dbfe34SMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
177e7dbfe34SMasami Hiramatsu	help
178e7dbfe34SMasami Hiramatsu	  If function tracer is enabled and the arch supports full
179e7dbfe34SMasami Hiramatsu	  passing of pt_regs to function tracing, then kprobes can
180e7dbfe34SMasami Hiramatsu	  optimize on top of function tracing.
181e7dbfe34SMasami Hiramatsu
1822b144498SSrikar Dronamrajuconfig UPROBES
18309294e31SDavid A. Long	def_bool n
184e8f4aa60SAllen Pais	depends on ARCH_SUPPORTS_UPROBES
18587195a1eSAndrii Nakryiko	select TASKS_TRACE_RCU
1862b144498SSrikar Dronamraju	help
1877b2d81d4SIngo Molnar	  Uprobes is the user-space counterpart to kprobes: they
1887b2d81d4SIngo Molnar	  enable instrumentation applications (such as 'perf probe')
1897b2d81d4SIngo Molnar	  to establish unintrusive probes in user-space binaries and
1907b2d81d4SIngo Molnar	  libraries, by executing handler functions when the probes
1917b2d81d4SIngo Molnar	  are hit by user-space applications.
1927b2d81d4SIngo Molnar
1937b2d81d4SIngo Molnar	  ( These probes come in the form of single-byte breakpoints,
1947b2d81d4SIngo Molnar	    managed by the kernel and kept transparent to the probed
1957b2d81d4SIngo Molnar	    application. )
1962b144498SSrikar Dronamraju
197adab66b7SSteven Rostedt (VMware)config HAVE_64BIT_ALIGNED_ACCESS
198adab66b7SSteven Rostedt (VMware)	def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
199adab66b7SSteven Rostedt (VMware)	help
200adab66b7SSteven Rostedt (VMware)	  Some architectures require 64 bit accesses to be 64 bit
201adab66b7SSteven Rostedt (VMware)	  aligned, which also requires structs containing 64 bit values
202adab66b7SSteven Rostedt (VMware)	  to be 64 bit aligned too. This includes some 32 bit
203adab66b7SSteven Rostedt (VMware)	  architectures which can do 64 bit accesses, as well as 64 bit
204adab66b7SSteven Rostedt (VMware)	  architectures without unaligned access.
205adab66b7SSteven Rostedt (VMware)
206adab66b7SSteven Rostedt (VMware)	  This symbol should be selected by an architecture if 64 bit
207adab66b7SSteven Rostedt (VMware)	  accesses are required to be 64 bit aligned in this way even
208adab66b7SSteven Rostedt (VMware)	  though it is not a 64 bit architecture.
209adab66b7SSteven Rostedt (VMware)
210ba1a297dSLukas Bulwahn	  See Documentation/core-api/unaligned-memory-access.rst for
211ba1a297dSLukas Bulwahn	  more information on the topic of unaligned memory accesses.
212adab66b7SSteven Rostedt (VMware)
21358340a07SJohannes Bergconfig HAVE_EFFICIENT_UNALIGNED_ACCESS
2149ba16087SJan Beulich	bool
21558340a07SJohannes Berg	help
21658340a07SJohannes Berg	  Some architectures are unable to perform unaligned accesses
21758340a07SJohannes Berg	  without the use of get_unaligned/put_unaligned. Others are
21858340a07SJohannes Berg	  unable to perform such accesses efficiently (e.g. trap on
21958340a07SJohannes Berg	  unaligned access and require fixing it up in the exception
22058340a07SJohannes Berg	  handler.)
22158340a07SJohannes Berg
22258340a07SJohannes Berg	  This symbol should be selected by an architecture if it can
22358340a07SJohannes Berg	  perform unaligned accesses efficiently to allow different
22458340a07SJohannes Berg	  code paths to be selected for these cases. Some network
22558340a07SJohannes Berg	  drivers, for example, could opt to not fix up alignment
22658340a07SJohannes Berg	  problems with received packets if doing so would not help
22758340a07SJohannes Berg	  much.
22858340a07SJohannes Berg
229c9b54d6fSMauro Carvalho Chehab	  See Documentation/core-api/unaligned-memory-access.rst for more
23058340a07SJohannes Berg	  information on the topic of unaligned memory accesses.
23158340a07SJohannes Berg
232cf66bb93SDavid Woodhouseconfig ARCH_USE_BUILTIN_BSWAP
233cf66bb93SDavid Woodhouse	bool
234cf66bb93SDavid Woodhouse	help
235*cd4eacccSLukas Bulwahn	  GCC and Clang have builtin functions for handling byte-swapping.
236*cd4eacccSLukas Bulwahn	  Using these allows the compiler to see what's happening and
237*cd4eacccSLukas Bulwahn	  offers more opportunity for optimisation. In particular, the
238*cd4eacccSLukas Bulwahn	  compiler will be able to combine the byteswap with a nearby load
239*cd4eacccSLukas Bulwahn	  or store and use load-and-swap or store-and-swap instructions if
240*cd4eacccSLukas Bulwahn	  the architecture has them. It should almost *never* result in code
241*cd4eacccSLukas Bulwahn	  which is worse than the hand-coded assembler in <asm/swab.h>.
242*cd4eacccSLukas Bulwahn	  But just in case it does, the use of the builtins is optional.
243cf66bb93SDavid Woodhouse
244cf66bb93SDavid Woodhouse	  Any architecture with load-and-swap or store-and-swap
245cf66bb93SDavid Woodhouse	  instructions should set this. And it shouldn't hurt to set it
246cf66bb93SDavid Woodhouse	  on architectures that don't have such instructions.
247cf66bb93SDavid Woodhouse
2489edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
2499edddaa2SAnanth N Mavinakayanahalli	def_bool y
25073f9b911SMasami Hiramatsu	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
25173f9b911SMasami Hiramatsu
25273f9b911SMasami Hiramatsuconfig KRETPROBE_ON_RETHOOK
25373f9b911SMasami Hiramatsu	def_bool y
25473f9b911SMasami Hiramatsu	depends on HAVE_RETHOOK
25573f9b911SMasami Hiramatsu	depends on KRETPROBES
25673f9b911SMasami Hiramatsu	select RETHOOK
2579edddaa2SAnanth N Mavinakayanahalli
2587c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
2597c68af6eSAvi Kivity	bool
2607c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
2617c68af6eSAvi Kivity	help
2627c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
2637c68af6eSAvi Kivity	  switch to user mode.
2647c68af6eSAvi Kivity
26528b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
2669ba16087SJan Beulich	bool
26728b2ee20SRik van Riel
268125e5645SMathieu Desnoyersconfig HAVE_KPROBES
2699ba16087SJan Beulich	bool
2709edddaa2SAnanth N Mavinakayanahalli
2719edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2729ba16087SJan Beulich	bool
27374bc7ceeSArthur Kepner
274afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
275afd66255SMasami Hiramatsu	bool
276d314d74cSCong Wang
277e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
278e7dbfe34SMasami Hiramatsu	bool
279e7dbfe34SMasami Hiramatsu
2801f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2811f6d3a8fSMasami Hiramatsu	bool
2821f6d3a8fSMasami Hiramatsu	help
2831f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
2841f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
2851f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2861f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2871f6d3a8fSMasami Hiramatsu
288540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2899802d865SJosef Bacik	bool
2909802d865SJosef Bacik
29142a0bb3fSPetr Mladekconfig HAVE_NMI
29242a0bb3fSPetr Mladek	bool
29342a0bb3fSPetr Mladek
294a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
295a257caccSChristophe Leroy	bool
296a257caccSChristophe Leroy
2974aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
2984aae683fSMasahiro Yamada	bool
2994aae683fSMasahiro Yamada
3004510bffbSMark Rutlandconfig TRACE_IRQFLAGS_NMI_SUPPORT
3014510bffbSMark Rutland	bool
3024510bffbSMark Rutland
3031f5a4ad9SRoland McGrath#
3041f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
3051f5a4ad9SRoland McGrath#
3061f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
3071f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
3081f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
3091f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
3101f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
3111f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
312153474baSEric W. Biederman#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
31303248addSEric W. Biederman#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
3141f5a4ad9SRoland McGrath#
3151f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
3169ba16087SJan Beulich	bool
3171f5a4ad9SRoland McGrath
318c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
319c64be2bbSMarek Szyprowski	bool
320c64be2bbSMarek Szyprowski
32129d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
32229d5e047SThomas Gleixner	bool
32329d5e047SThomas Gleixner
324485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
325485cf5daSKevin Hilman	bool
326485cf5daSKevin Hilman
3276974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
3286974f0c4SDaniel Micay	bool
3296974f0c4SDaniel Micay	help
3306974f0c4SDaniel Micay	  An architecture should select this when it can successfully
3316974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
3326974f0c4SDaniel Micay
333d8ae8a37SChristoph Hellwig#
334d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
335d8ae8a37SChristoph Hellwig# command line option
336d8ae8a37SChristoph Hellwig#
337d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
338d8ae8a37SChristoph Hellwig	bool
339d8ae8a37SChristoph Hellwig
340d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
341d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
342d2852a22SDaniel Borkmann	bool
343d2852a22SDaniel Borkmann
344d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
345d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
346d253ca0cSRick Edgecombe	bool
347d253ca0cSRick Edgecombe
348c30700dbSChristoph Hellwig#
349fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
350a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
351fa7e2247SChristoph Hellwig# to remap the page tables in place.
352c30700dbSChristoph Hellwig#
353fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
354c30700dbSChristoph Hellwig	bool
355c30700dbSChristoph Hellwig
356999a5d12SChristoph Hellwig#
357999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
358999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
359999a5d12SChristoph Hellwig#
360999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
361f5e10287SThomas Gleixner	bool
362f5e10287SThomas Gleixner
3637725acaaSThomas Gleixnerconfig ARCH_HAS_CPU_FINALIZE_INIT
3647725acaaSThomas Gleixner	bool
3657725acaaSThomas Gleixner
3668f23f5dbSJason Gunthorpe# The architecture has a per-task state that includes the mm's PASID
3678f23f5dbSJason Gunthorpeconfig ARCH_HAS_CPU_PASID
3688f23f5dbSJason Gunthorpe	bool
3698f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
3708f23f5dbSJason Gunthorpe
3715905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
3725905429aSKees Cook	bool
3735905429aSKees Cook	help
3745905429aSKees Cook	  An architecture should select this to provide hardened usercopy
3755905429aSKees Cook	  knowledge about what region of the thread_struct should be
3765905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
3775905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
3785905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
3795905429aSKees Cook	  field in task_struct will be left whitelisted.
3805905429aSKees Cook
3815aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
3825aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
3835aaeb5c0SIngo Molnar	bool
3845aaeb5c0SIngo Molnar
38551c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
38651c2ee6dSNick Desaulniers	bool
38751c2ee6dSNick Desaulniers	help
38851c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
38951c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
39051c2ee6dSNick Desaulniers	  functions and is required for correctness.
39151c2ee6dSNick Desaulniers
392942fa985SYury Norovconfig ARCH_32BIT_OFF_T
393942fa985SYury Norov	bool
394942fa985SYury Norov	depends on !64BIT
395942fa985SYury Norov	help
396942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
397942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
398942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
399942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
400942fa985SYury Norov	  architectures explicitly.
401942fa985SYury Norov
40296c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
40396c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
40496c0a6a7SHeiko Carstens	bool
40596c0a6a7SHeiko Carstens
4062ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
4072ff2b7ecSMasahiro Yamada	bool
4082ff2b7ecSMasahiro Yamada	help
409a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
4102ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
4112ff2b7ecSMasahiro Yamada	  exported from assembly code.
4122ff2b7ecSMasahiro Yamada
413f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
414f850c30cSHeiko Carstens	bool
415e01292b1SHeiko Carstens	help
416a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
417e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
418e01292b1SHeiko Carstens	  declared in asm/ptrace.h
419e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
420f850c30cSHeiko Carstens
421d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
422d7822b1eSMathieu Desnoyers	bool
423d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
424d7822b1eSMathieu Desnoyers	help
425d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
426d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
427d7822b1eSMathieu Desnoyers
4282f7ab126SMiguel Ojedaconfig HAVE_RUST
4292f7ab126SMiguel Ojeda	bool
4302f7ab126SMiguel Ojeda	help
4312f7ab126SMiguel Ojeda	  This symbol should be selected by an architecture if it
4322f7ab126SMiguel Ojeda	  supports Rust.
4332f7ab126SMiguel Ojeda
4343c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
4353c88ee19SMasami Hiramatsu	bool
4363c88ee19SMasami Hiramatsu	help
437a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
4383c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
4393c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
4403c88ee19SMasami Hiramatsu
44162a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
44262a038d3SK.Prasad	bool
44399e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
44462a038d3SK.Prasad
4450102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
4460102752eSFrederic Weisbecker	bool
4470102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
4480102752eSFrederic Weisbecker	help
4490102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
4500102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
4510102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
4520102752eSFrederic Weisbecker	  them but define the access type in a control register.
4530102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
4540102752eSFrederic Weisbecker	  latter fashion.
4550102752eSFrederic Weisbecker
4567c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
4577c68af6eSAvi Kivity	bool
458a1922ed6SIngo Molnar
459c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
460c01d4323SFrederic Weisbecker	bool
46123637d47SFrederic Weisbecker	help
46223637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
46323637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
46423637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
465c01d4323SFrederic Weisbecker
46605a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
46705a4a952SNicholas Piggin	bool
46805a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
46905a4a952SNicholas Piggin	help
47005a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
47105a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
47205a4a952SNicholas Piggin
47305a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
47405a4a952SNicholas Piggin	bool
47505a4a952SNicholas Piggin	help
4761356d0b9SPetr Mladek	  The arch provides its own hardlockup detector implementation instead
4771356d0b9SPetr Mladek	  of the generic ones.
4781356d0b9SPetr Mladek
4791356d0b9SPetr Mladek	  It uses the same command line parameters, and sysctl interface,
4801356d0b9SPetr Mladek	  as the generic hardlockup detectors.
48105a4a952SNicholas Piggin
48271753c6eSJosh Poimboeufconfig UNWIND_USER
48371753c6eSJosh Poimboeuf	bool
48471753c6eSJosh Poimboeuf
48571753c6eSJosh Poimboeufconfig HAVE_UNWIND_USER_FP
48671753c6eSJosh Poimboeuf	bool
48771753c6eSJosh Poimboeuf	select UNWIND_USER
48871753c6eSJosh Poimboeuf
489c5e63197SJiri Olsaconfig HAVE_PERF_REGS
490c5e63197SJiri Olsa	bool
491c5e63197SJiri Olsa	help
492c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
493c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
494c5e63197SJiri Olsa
495c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
496c5ebcedbSJiri Olsa	bool
497c5ebcedbSJiri Olsa	help
498c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
499c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
500c5ebcedbSJiri Olsa	  architectures.
501c5ebcedbSJiri Olsa
502bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
503bf5438fcSJason Baron	bool
504bf5438fcSJason Baron
50550ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
50650ff18abSArd Biesheuvel	bool
50750ff18abSArd Biesheuvel
5080d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
5090d6e24d4SPeter Zijlstra	bool
5100d6e24d4SPeter Zijlstra
511ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
51226723911SPeter Zijlstra	bool
5130d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
51426723911SPeter Zijlstra
5153af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
516ed6a7935SPeter Zijlstra	bool
517ed6a7935SPeter Zijlstra
51827796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
51927796d03SPeter Zijlstra	bool
5201e9fdf21SPeter Zijlstra	select MMU_GATHER_MERGE_VMAS
5211e9fdf21SPeter Zijlstra
5221e9fdf21SPeter Zijlstraconfig MMU_GATHER_NO_FLUSH_CACHE
5231e9fdf21SPeter Zijlstra	bool
5241e9fdf21SPeter Zijlstra
5251e9fdf21SPeter Zijlstraconfig MMU_GATHER_MERGE_VMAS
5261e9fdf21SPeter Zijlstra	bool
52727796d03SPeter Zijlstra
528580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
529952a31c9SMartin Schwidefsky	bool
5300d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
531952a31c9SMartin Schwidefsky
532d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
533d53c3dfbSNicholas Piggin	bool
534d53c3dfbSNicholas Piggin	help
535d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
536d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
537d53c3dfbSNicholas Piggin	  shootdowns should enable this.
538d53c3dfbSNicholas Piggin
53988e3009bSNicholas Piggin# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
54088e3009bSNicholas Piggin# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
54188e3009bSNicholas Piggin# to/from kernel threads when the same mm is running on a lot of CPUs (a large
54288e3009bSNicholas Piggin# multi-threaded application), by reducing contention on the mm refcount.
54388e3009bSNicholas Piggin#
54488e3009bSNicholas Piggin# This can be disabled if the architecture ensures no CPUs are using an mm as a
54588e3009bSNicholas Piggin# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
54688e3009bSNicholas Piggin# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
54788e3009bSNicholas Piggin# final exit(2) TLB flush, for example.
54888e3009bSNicholas Piggin#
54988e3009bSNicholas Piggin# To implement this, an arch *must*:
55088e3009bSNicholas Piggin# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
55188e3009bSNicholas Piggin# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
55288e3009bSNicholas Piggin# converted already).
55388e3009bSNicholas Pigginconfig MMU_LAZY_TLB_REFCOUNT
55488e3009bSNicholas Piggin	def_bool y
5552655421aSNicholas Piggin	depends on !MMU_LAZY_TLB_SHOOTDOWN
5562655421aSNicholas Piggin
5572655421aSNicholas Piggin# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
5582655421aSNicholas Piggin# mm as a lazy tlb beyond its last reference count, by shooting down these
5592655421aSNicholas Piggin# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
5602655421aSNicholas Piggin# be using the mm as a lazy tlb, so that they may switch themselves to using
5612655421aSNicholas Piggin# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
5622655421aSNicholas Piggin# may be using mm as a lazy tlb mm.
5632655421aSNicholas Piggin#
5642655421aSNicholas Piggin# To implement this, an arch *must*:
5652655421aSNicholas Piggin# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
5662655421aSNicholas Piggin#   at least all possible CPUs in which the mm is lazy.
5672655421aSNicholas Piggin# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
5682655421aSNicholas Pigginconfig MMU_LAZY_TLB_SHOOTDOWN
5692655421aSNicholas Piggin	bool
57088e3009bSNicholas Piggin
571df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
572df013ffbSHuang Ying	bool
573df013ffbSHuang Ying
574a9c3475dSVignesh Balasubramanianconfig ARCH_HAVE_EXTRA_ELF_NOTES
575a9c3475dSVignesh Balasubramanian	bool
576a9c3475dSVignesh Balasubramanian	help
577a9c3475dSVignesh Balasubramanian	  An architecture should select this in order to enable adding an
578a9c3475dSVignesh Balasubramanian	  arch-specific ELF note section to core files. It must provide two
579a9c3475dSVignesh Balasubramanian	  functions: elf_coredump_extra_notes_size() and
580a9c3475dSVignesh Balasubramanian	  elf_coredump_extra_notes_write() which are invoked by the ELF core
581a9c3475dSVignesh Balasubramanian	  dumper.
582a9c3475dSVignesh Balasubramanian
5832e83b879SPaul E. McKenneyconfig ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
5842e83b879SPaul E. McKenney	bool
5852e83b879SPaul E. McKenney
58643570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
58743570fd2SHeiko Carstens	bool
58843570fd2SHeiko Carstens	help
58943570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
59043570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
59143570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
59243570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
59343570fd2SHeiko Carstens
5944156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
5954156153cSHeiko Carstens	bool
5964156153cSHeiko Carstens
5972565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
5982565409fSHeiko Carstens	bool
5992565409fSHeiko Carstens
60077e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
60177e58496SPaul E. McKenney	bool
60277e58496SPaul E. McKenney
603c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
604c1d7e01dSWill Deacon	bool
605c1d7e01dSWill Deacon
606c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
607c1d7e01dSWill Deacon	bool
608c1d7e01dSWill Deacon
60948b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
610c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
61148b25c43SChris Metcalf	bool
61248b25c43SChris Metcalf
613282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
614e2cfabdfSWill Drewry	bool
615e2cfabdfSWill Drewry	help
616282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
617282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
618282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
619282a181bSYiFei Zhu	  - __NR_seccomp_read_32
620282a181bSYiFei Zhu	  - __NR_seccomp_write_32
621282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
622282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
623282a181bSYiFei Zhu
624282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
625282a181bSYiFei Zhu	bool
626282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
627282a181bSYiFei Zhu	help
628fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
629282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
630bb6ea430SWill Drewry	  - syscall_get_arch()
631bb6ea430SWill Drewry	  - syscall_get_arguments()
632bb6ea430SWill Drewry	  - syscall_rollback()
633bb6ea430SWill Drewry	  - syscall_set_return_value()
634fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
635fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
636fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
637fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
63848dc92b9SKees Cook	  - seccomp syscall wired up
6390d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
6400d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
6410d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
642e2cfabdfSWill Drewry
643282a181bSYiFei Zhuconfig SECCOMP
644282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
645282a181bSYiFei Zhu	def_bool y
646282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
647282a181bSYiFei Zhu	help
648282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
649282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
650282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
651282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
652282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
653282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
654282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
655282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
656282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
657282a181bSYiFei Zhu
658282a181bSYiFei Zhu	  If unsure, say Y.
659282a181bSYiFei Zhu
660e2cfabdfSWill Drewryconfig SECCOMP_FILTER
661e2cfabdfSWill Drewry	def_bool y
662e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
663e2cfabdfSWill Drewry	help
664e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
665e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
666e2cfabdfSWill Drewry	  task-defined system call filtering polices.
667e2cfabdfSWill Drewry
6685fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
669e2cfabdfSWill Drewry
6700d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
6710d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
6720d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
6730d8315ddSYiFei Zhu	depends on PROC_FS
6740d8315ddSYiFei Zhu	help
6750d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
6760d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
6770d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
6780d8315ddSYiFei Zhu
6790d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
6800d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
6810d8315ddSYiFei Zhu
6820d8315ddSYiFei Zhu	  If unsure, say N.
6830d8315ddSYiFei Zhu
68457fbad15SKees Cookconfig HAVE_ARCH_KSTACK_ERASE
685afaef01cSAlexander Popov	bool
686afaef01cSAlexander Popov	help
687afaef01cSAlexander Popov	  An architecture should select this if it has the code which
68857fbad15SKees Cook	  fills the used part of the kernel stack with the KSTACK_ERASE_POISON
689afaef01cSAlexander Popov	  value before returning from system calls.
690afaef01cSAlexander Popov
691d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
69219952a92SKees Cook	bool
69319952a92SKees Cook	help
69419952a92SKees Cook	  An arch should select this symbol if:
69519952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
69619952a92SKees Cook
697050e9baaSLinus Torvaldsconfig STACKPROTECTOR
6982a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
699d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
7002a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
7012a61f474SMasahiro Yamada	default y
7028779657dSKees Cook	help
7038779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
70419952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
70519952a92SKees Cook	  the stack just before the return address, and validates
70619952a92SKees Cook	  the value just before actually returning.  Stack based buffer
70719952a92SKees Cook	  overflows (that need to overwrite this return address) now also
70819952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
70919952a92SKees Cook	  neutralized via a kernel panic.
71019952a92SKees Cook
7118779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
7128779657dSKees Cook	  have an 8-byte or larger character array on the stack.
7138779657dSKees Cook
71419952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
7158779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
7168779657dSKees Cook
7178779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
7188779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
7198779657dSKees Cook	  by about 0.3%.
7208779657dSKees Cook
721050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
7222a61f474SMasahiro Yamada	bool "Strong Stack Protector"
723050e9baaSLinus Torvalds	depends on STACKPROTECTOR
7242a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
7252a61f474SMasahiro Yamada	default y
7268779657dSKees Cook	help
7278779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
7288779657dSKees Cook	  of the following conditions:
7298779657dSKees Cook
7308779657dSKees Cook	  - local variable's address used as part of the right hand side of an
7318779657dSKees Cook	    assignment or function argument
7328779657dSKees Cook	  - local variable is an array (or union containing an array),
7338779657dSKees Cook	    regardless of array type or length
7348779657dSKees Cook	  - uses register local variables
7358779657dSKees Cook
7368779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
7378779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
7388779657dSKees Cook
7398779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
7408779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
7418779657dSKees Cook	  size by about 2%.
7428779657dSKees Cook
743d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
744d08b9f0cSSami Tolvanen	bool
745d08b9f0cSSami Tolvanen	help
746afcf5441SDan Li	  An architecture should select this if it supports the compiler's
747afcf5441SDan Li	  Shadow Call Stack and implements runtime support for shadow stack
748aa7a65aeSWill Deacon	  switching.
749d08b9f0cSSami Tolvanen
750d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
751afcf5441SDan Li	bool "Shadow Call Stack"
752afcf5441SDan Li	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
75338792972SArd Biesheuvel	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
7546f9dc684SSamuel Holland	depends on MMU
755d08b9f0cSSami Tolvanen	help
756afcf5441SDan Li	  This option enables the compiler's Shadow Call Stack, which
757afcf5441SDan Li	  uses a shadow stack to protect function return addresses from
758afcf5441SDan Li	  being overwritten by an attacker. More information can be found
759afcf5441SDan Li	  in the compiler's documentation:
760d08b9f0cSSami Tolvanen
761afcf5441SDan Li	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
762afcf5441SDan Li	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
763d08b9f0cSSami Tolvanen
764d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
765d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
766d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
767d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
768d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
769d08b9f0cSSami Tolvanen
7709beccca0SArd Biesheuvelconfig DYNAMIC_SCS
7719beccca0SArd Biesheuvel	bool
7729beccca0SArd Biesheuvel	help
7739beccca0SArd Biesheuvel	  Set by the arch code if it relies on code patching to insert the
7749beccca0SArd Biesheuvel	  shadow call stack push and pop instructions rather than on the
7759beccca0SArd Biesheuvel	  compiler.
7769beccca0SArd Biesheuvel
777dc5723b0SSami Tolvanenconfig LTO
778dc5723b0SSami Tolvanen	bool
779dc5723b0SSami Tolvanen	help
780dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
781dc5723b0SSami Tolvanen
782dc5723b0SSami Tolvanenconfig LTO_CLANG
783dc5723b0SSami Tolvanen	bool
784dc5723b0SSami Tolvanen	select LTO
785dc5723b0SSami Tolvanen	help
786dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
787dc5723b0SSami Tolvanen
788dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
789dc5723b0SSami Tolvanen	bool
790dc5723b0SSami Tolvanen	help
791dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
792dc5723b0SSami Tolvanen	  - compiling with Clang,
793dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
794dc5723b0SSami Tolvanen	  - and linking with LLD.
795dc5723b0SSami Tolvanen
796dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
797dc5723b0SSami Tolvanen	bool
798dc5723b0SSami Tolvanen	help
799dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
800dc5723b0SSami Tolvanen	  ThinLTO mode.
801dc5723b0SSami Tolvanen
802dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
803dc5723b0SSami Tolvanen	def_bool y
8041e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
805dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
806dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
807dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
808dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
809349fde59SJakob Koschel	# https://github.com/ClangBuiltLinux/linux/issues/1721
810349fde59SJakob Koschel	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
811349fde59SJakob Koschel	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
812dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
813dc5723b0SSami Tolvanen	help
814dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
815dc5723b0SSami Tolvanen	  LTO.
816dc5723b0SSami Tolvanen
817dc5723b0SSami Tolvanenchoice
818dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
819dc5723b0SSami Tolvanen	default LTO_NONE
820dc5723b0SSami Tolvanen	help
821dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
822dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
823dc5723b0SSami Tolvanen
824dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
825dc5723b0SSami Tolvanen	  so it's disabled by default.
826dc5723b0SSami Tolvanen
827dc5723b0SSami Tolvanenconfig LTO_NONE
828dc5723b0SSami Tolvanen	bool "None"
829dc5723b0SSami Tolvanen	help
830dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
831dc5723b0SSami Tolvanen
832dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
833dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
834dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
835dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
836dc5723b0SSami Tolvanen	select LTO_CLANG
837dc5723b0SSami Tolvanen	help
838dc5723b0SSami Tolvanen	  This option enables Clang's full Link Time Optimization (LTO), which
839dc5723b0SSami Tolvanen	  allows the compiler to optimize the kernel globally. If you enable
840dc5723b0SSami Tolvanen	  this option, the compiler generates LLVM bitcode instead of ELF
841dc5723b0SSami Tolvanen	  object files, and the actual compilation from bitcode happens at
842dc5723b0SSami Tolvanen	  the LTO link step, which may take several minutes depending on the
843dc5723b0SSami Tolvanen	  kernel configuration. More information can be found from LLVM's
844dc5723b0SSami Tolvanen	  documentation:
845dc5723b0SSami Tolvanen
846dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
847dc5723b0SSami Tolvanen
848dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
849dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
850dc5723b0SSami Tolvanen
851dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
852dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
853dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
854dc5723b0SSami Tolvanen	select LTO_CLANG
855dc5723b0SSami Tolvanen	help
856dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
857dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
858dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
859dc5723b0SSami Tolvanen	  from Clang's documentation:
860dc5723b0SSami Tolvanen
861dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
862dc5723b0SSami Tolvanen
863dc5723b0SSami Tolvanen	  If unsure, say Y.
864dc5723b0SSami Tolvanenendchoice
865dc5723b0SSami Tolvanen
866315ad878SRong Xuconfig ARCH_SUPPORTS_AUTOFDO_CLANG
867315ad878SRong Xu	bool
868315ad878SRong Xu
869315ad878SRong Xuconfig AUTOFDO_CLANG
870315ad878SRong Xu	bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
871315ad878SRong Xu	depends on ARCH_SUPPORTS_AUTOFDO_CLANG
872315ad878SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 170000
873315ad878SRong Xu	help
874315ad878SRong Xu	  This option enables Clang’s AutoFDO build. When
875315ad878SRong Xu	  an AutoFDO profile is specified in variable
876315ad878SRong Xu	  CLANG_AUTOFDO_PROFILE during the build process,
877315ad878SRong Xu	  Clang uses the profile to optimize the kernel.
878315ad878SRong Xu
879315ad878SRong Xu	  If no profile is specified, AutoFDO options are
880315ad878SRong Xu	  still passed to Clang to facilitate the collection
881315ad878SRong Xu	  of perf data for creating an AutoFDO profile in
882315ad878SRong Xu	  subsequent builds.
883315ad878SRong Xu
884315ad878SRong Xu	  If unsure, say N.
885315ad878SRong Xu
886d5dc9583SRong Xuconfig ARCH_SUPPORTS_PROPELLER_CLANG
887d5dc9583SRong Xu	bool
888d5dc9583SRong Xu
889d5dc9583SRong Xuconfig PROPELLER_CLANG
890d5dc9583SRong Xu	bool "Enable Clang's Propeller build"
891d5dc9583SRong Xu	depends on ARCH_SUPPORTS_PROPELLER_CLANG
892d5dc9583SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 190000
893d5dc9583SRong Xu	help
894d5dc9583SRong Xu	  This option enables Clang’s Propeller build. When the Propeller
895d5dc9583SRong Xu	  profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX
896d5dc9583SRong Xu	  during the build process, Clang uses the profiles to optimize
897d5dc9583SRong Xu	  the kernel.
898d5dc9583SRong Xu
899d5dc9583SRong Xu	  If no profile is specified, Propeller options are still passed
900d5dc9583SRong Xu	  to Clang to facilitate the collection of perf data for creating
901d5dc9583SRong Xu	  the Propeller profiles in subsequent builds.
902d5dc9583SRong Xu
903d5dc9583SRong Xu	  If unsure, say N.
904d5dc9583SRong Xu
90523ef9d43SKees Cookconfig ARCH_SUPPORTS_CFI
906cf68fffbSSami Tolvanen	bool
907cf68fffbSSami Tolvanen	help
90823ef9d43SKees Cook	  An architecture should select this option if it can support Kernel
90923ef9d43SKees Cook	  Control-Flow Integrity (CFI) checking (-fsanitize=kcfi).
910cf68fffbSSami Tolvanen
91189245600SSami Tolvanenconfig ARCH_USES_CFI_TRAPS
91289245600SSami Tolvanen	bool
91323ef9d43SKees Cook	help
91423ef9d43SKees Cook	  An architecture should select this option if it requires the
91523ef9d43SKees Cook	  .kcfi_traps section for KCFI trap handling.
91689245600SSami Tolvanen
91739c89ee6SNathan Chancellorconfig ARCH_USES_CFI_GENERIC_LLVM_PASS
91839c89ee6SNathan Chancellor	bool
91939c89ee6SNathan Chancellor	help
92039c89ee6SNathan Chancellor	  An architecture should select this option if it uses the generic
92139c89ee6SNathan Chancellor	  KCFIPass in LLVM to expand kCFI bundles instead of architecture-specific
92239c89ee6SNathan Chancellor	  lowering.
92339c89ee6SNathan Chancellor
92423ef9d43SKees Cookconfig CFI
92523ef9d43SKees Cook	bool "Use Kernel Control Flow Integrity (kCFI)"
92623ef9d43SKees Cook	default CFI_CLANG
92723ef9d43SKees Cook	depends on ARCH_SUPPORTS_CFI
92889245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
929cf68fffbSSami Tolvanen	help
93023ef9d43SKees Cook	  This option enables forward-edge Control Flow Integrity (CFI)
93123ef9d43SKees Cook	  checking, where the compiler injects a runtime check to each
932cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
933cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
934cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
935cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
936cf68fffbSSami Tolvanen	  found from Clang's documentation:
937cf68fffbSSami Tolvanen
938cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
939cf68fffbSSami Tolvanen
94023ef9d43SKees Cookconfig CFI_CLANG
94123ef9d43SKees Cook	bool
94223ef9d43SKees Cook	transitional
94323ef9d43SKees Cook	help
94423ef9d43SKees Cook	  Transitional config for CFI_CLANG to CFI migration.
94523ef9d43SKees Cook
946ce4a2620SAlice Ryhlconfig CFI_ICALL_NORMALIZE_INTEGERS
947ce4a2620SAlice Ryhl	bool "Normalize CFI tags for integers"
94823ef9d43SKees Cook	depends on CFI
94923ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
950ce4a2620SAlice Ryhl	help
951ce4a2620SAlice Ryhl	  This option normalizes the CFI tags for integer types so that all
952ce4a2620SAlice Ryhl	  integer types of the same size and signedness receive the same CFI
953ce4a2620SAlice Ryhl	  tag.
954ce4a2620SAlice Ryhl
955ce4a2620SAlice Ryhl	  The option is separate from CONFIG_RUST because it affects the ABI.
956ce4a2620SAlice Ryhl	  When working with build systems that care about the ABI, it is
957ce4a2620SAlice Ryhl	  convenient to be able to turn on this flag first, before Rust is
958ce4a2620SAlice Ryhl	  turned on.
959ce4a2620SAlice Ryhl
960ce4a2620SAlice Ryhl	  This option is necessary for using CFI with Rust. If unsure, say N.
961ce4a2620SAlice Ryhl
96223ef9d43SKees Cookconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9638b8ca9c2SAlice Ryhl	def_bool y
9644c66f830SAlice Ryhl	depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
9658b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
9662313ab74SAlice Ryhl	depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9674c66f830SAlice Ryhl
9688b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
9698b8ca9c2SAlice Ryhl	def_bool y
97023ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9718b8ca9c2SAlice Ryhl	depends on RUSTC_VERSION >= 107900
972812258ffSConor Dooley	depends on ARM64 || X86_64
9738b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
9742313ab74SAlice Ryhl	depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
9758b8ca9c2SAlice Ryhl		(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9764c66f830SAlice Ryhl
977cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
978cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
97923ef9d43SKees Cook	depends on CFI
980cf68fffbSSami Tolvanen	help
981cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
982cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
983cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
984cf68fffbSSami Tolvanen
985cf68fffbSSami Tolvanen	  If unsure, say N.
986cf68fffbSSami Tolvanen
9870f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
9880f60a8efSKees Cook	bool
9890f60a8efSKees Cook	help
9900f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
9910f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
9920f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
9930f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
9940f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
9950f60a8efSKees Cook
99624a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
9972b1d5024SFrederic Weisbecker	bool
9982b1d5024SFrederic Weisbecker	help
99991d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
100091d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
1001490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
1002490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
1003490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
10046f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
1005490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
1006490f561bSFrederic Weisbecker
100724a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
100883c2da2eSFrederic Weisbecker	bool
100983c2da2eSFrederic Weisbecker	help
101083c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
101183c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
101283c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
1013d65d411cSValentin Schneider	  while context tracking is CT_STATE_USER. This feature reflects a sane
101483c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
101583c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
101683c2da2eSFrederic Weisbecker
101783c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
101883c2da2eSFrederic Weisbecker	    not interruptible).
1019493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
102083c2da2eSFrederic Weisbecker	    got called.
102183c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
102283c2da2eSFrederic Weisbecker	    called.
102383c2da2eSFrederic Weisbecker
1024490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
1025490f561bSFrederic Weisbecker	bool
1026490f561bSFrederic Weisbecker	help
1027490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
1028490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
10292b1d5024SFrederic Weisbecker
1030b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
1031b952741cSFrederic Weisbecker	bool
1032b952741cSFrederic Weisbecker
10332b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
10342b91ec9fSFrederic Weisbecker	bool
10352b91ec9fSFrederic Weisbecker	help
10362b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
10372b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
10382b91ec9fSFrederic Weisbecker
103940565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
104040565b5aSStanislaw Gruszka	bool
104140565b5aSStanislaw Gruszka
1042554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
1043554b0004SKevin Hilman	bool
1044554b0004SKevin Hilman	default y if 64BIT
1045554b0004SKevin Hilman	help
1046554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
1047554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
1048554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
1049554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
1050554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
1051554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
1052554b0004SKevin Hilman
1053fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
1054fdf9c356SFrederic Weisbecker	bool
1055fdf9c356SFrederic Weisbecker	help
1056fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
1057fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
1058fdf9c356SFrederic Weisbecker
1059c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
1060c49dd340SKalesh Singh	bool
1061c49dd340SKalesh Singh	help
1062c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
1063c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
1064c49dd340SKalesh Singh	  happens at the PGD level.
1065c49dd340SKalesh Singh
10662c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
10672c91bd4aSJoel Fernandes (Google)	bool
10682c91bd4aSJoel Fernandes (Google)	help
10692c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
10702c91bd4aSJoel Fernandes (Google)
107115626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
107215626062SGerald Schaefer	bool
107315626062SGerald Schaefer
1074a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
1075a00cc7d9SMatthew Wilcox	bool
1076a00cc7d9SMatthew Wilcox
10770ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
10780ddab1d2SToshi Kani	bool
10790ddab1d2SToshi Kani
1080121e6f32SNicholas Piggin#
1081121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
1082559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
1083559089e0SSong Liu#  must be used to enable allocations to use hugepages.
1084121e6f32SNicholas Piggin#
1085121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
1086121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
1087121e6f32SNicholas Piggin	bool
1088121e6f32SNicholas Piggin
10893876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
10903876d4a3SAlexandre Ghiti	bool
10913876d4a3SAlexandre Ghiti
10922f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
10932f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
10942f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
10952f0584f3SRick Edgecombe	bool
10962f0584f3SRick Edgecombe
10972f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
10982f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
10992f0584f3SRick Edgecombe
11000f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
11010f8975ecSPavel Emelyanov	bool
11020f8975ecSPavel Emelyanov
1103786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
1104786d35d4SDavid Howells	bool
1105786d35d4SDavid Howells	help
1106786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
1107786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
1108786d35d4SDavid Howells	  should not enable this.
1109786d35d4SDavid Howells
1110786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
1111786d35d4SDavid Howells	bool
1112786d35d4SDavid Howells	help
1113786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
1114786d35d4SDavid Howells	  relocations will give an error.
1115786d35d4SDavid Howells
1116786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
1117786d35d4SDavid Howells	bool
1118786d35d4SDavid Howells	help
1119786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
1120786d35d4SDavid Howells	  relocations will give an error.
1121786d35d4SDavid Howells
112201dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
112301dc0386SChristophe Leroy	bool
112401dc0386SChristophe Leroy	help
112501dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
112601dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
112701dc0386SChristophe Leroy
1128223b5e57SMike Rapoport (IBM)config ARCH_WANTS_EXECMEM_LATE
1129223b5e57SMike Rapoport (IBM)	bool
1130223b5e57SMike Rapoport (IBM)	help
1131223b5e57SMike Rapoport (IBM)	  For architectures that do not allocate executable memory early on
1132223b5e57SMike Rapoport (IBM)	  boot, but rather require its initialization late when there is
1133223b5e57SMike Rapoport (IBM)	  enough entropy for module space randomization, for instance
1134223b5e57SMike Rapoport (IBM)	  arm64.
1135223b5e57SMike Rapoport (IBM)
11362e45474aSMike Rapoport (Microsoft)config ARCH_HAS_EXECMEM_ROX
11372e45474aSMike Rapoport (Microsoft)	bool
11382e45474aSMike Rapoport (Microsoft)	depends on MMU && !HIGHMEM
11392e45474aSMike Rapoport (Microsoft)	help
11402e45474aSMike Rapoport (Microsoft)	  For architectures that support allocations of executable memory
11412e45474aSMike Rapoport (Microsoft)	  with read-only execute permissions. Architecture must implement
11422e45474aSMike Rapoport (Microsoft)	  execmem_fill_trapping_insns() callback to enable this.
11432e45474aSMike Rapoport (Microsoft)
1144cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
1145cc1f0274SFrederic Weisbecker	bool
1146cc1f0274SFrederic Weisbecker	help
1147cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
1148cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
1149cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
1150cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
1151cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
1152cc1f0274SFrederic Weisbecker	  processing.
1153cc1f0274SFrederic Weisbecker
1154cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
1155cd1a41ceSThomas Gleixner	bool
1156cd1a41ceSThomas Gleixner	help
1157cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
1158c226bc3cSColin Ian King	  separate stack.
1159cd1a41ceSThomas Gleixner
11608cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
11618cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
11628cbb2b50SSebastian Andrzej Siewior
116312700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
116412700c17SArnd Bergmann	bool
116512700c17SArnd Bergmann	help
116612700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
116712700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
116812700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
116912700c17SArnd Bergmann
1170235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
1171235a8f02SKirill A. Shutemov	int
1172235a8f02SKirill A. Shutemov	default 2
1173235a8f02SKirill A. Shutemov
11742b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
11752b68f6caSKees Cook	bool
11762b68f6caSKees Cook	help
11772b68f6caSKees Cook	  An architecture supports choosing randomized locations for
11782b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
11792b68f6caSKees Cook	  - arch_mmap_rnd()
1180204db6edSKees Cook	  - arch_randomize_brk()
11812b68f6caSKees Cook
1182d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1183d07e2259SDaniel Cashman	bool
1184d07e2259SDaniel Cashman	help
1185d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1186d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1187d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1188d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1189d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1190d07e2259SDaniel Cashman
11915f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
11925f56a5dfSJiri Slaby	bool
11935f56a5dfSJiri Slaby	help
11945f56a5dfSJiri Slaby	  An architecture implements exit_thread.
11955f56a5dfSJiri Slaby
1196d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1197d07e2259SDaniel Cashman	int
1198d07e2259SDaniel Cashman
1199d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1200d07e2259SDaniel Cashman	int
1201d07e2259SDaniel Cashman
1202d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1203d07e2259SDaniel Cashman	int
1204d07e2259SDaniel Cashman
1205d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1206d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1207d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1208d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1209d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1210d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1211d07e2259SDaniel Cashman	help
1212d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1213d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1214d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1215d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1216d07e2259SDaniel Cashman
1217d07e2259SDaniel Cashman	  This value can be changed after boot using the
1218d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1219d07e2259SDaniel Cashman
1220d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1221d07e2259SDaniel Cashman	bool
1222d07e2259SDaniel Cashman	help
1223d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1224d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1225d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1226d07e2259SDaniel Cashman	  enabled and provides values for both:
1227d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1228d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1229d07e2259SDaniel Cashman
1230d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1231d07e2259SDaniel Cashman	int
1232d07e2259SDaniel Cashman
1233d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1234d07e2259SDaniel Cashman	int
1235d07e2259SDaniel Cashman
1236d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1237d07e2259SDaniel Cashman	int
1238d07e2259SDaniel Cashman
1239d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1240d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1241d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1242d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1243d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1244d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1245d07e2259SDaniel Cashman	help
1246d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1247d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1248d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1249d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1250d07e2259SDaniel Cashman	  supported values.
1251d07e2259SDaniel Cashman
1252d07e2259SDaniel Cashman	  This value can be changed after boot using the
1253d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1254d07e2259SDaniel Cashman
12551b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
12561b028f78SDmitry Safonov	bool
12571b028f78SDmitry Safonov	help
12581b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
12591b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
12601b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
12611b028f78SDmitry Safonov
1262ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1263ba89f9c8SArnd Bergmann	bool
1264ba89f9c8SArnd Bergmann
1265ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1266ba89f9c8SArnd Bergmann	bool
1267ba89f9c8SArnd Bergmann
1268ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1269ba89f9c8SArnd Bergmann	bool
1270ba89f9c8SArnd Bergmann
1271ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1272ba89f9c8SArnd Bergmann	bool
1273ba89f9c8SArnd Bergmann
1274ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1275ba89f9c8SArnd Bergmann	bool
1276ba89f9c8SArnd Bergmann
1277ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1278ba89f9c8SArnd Bergmann	bool
1279ba89f9c8SArnd Bergmann
1280ba89f9c8SArnd Bergmannchoice
1281ba89f9c8SArnd Bergmann	prompt "MMU page size"
1282ba89f9c8SArnd Bergmann
1283ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1284ba89f9c8SArnd Bergmann	bool "4KiB pages"
1285ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1286ba89f9c8SArnd Bergmann	help
1287ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1288ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1289ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1290ba89f9c8SArnd Bergmann	  memory systems.
1291ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1292ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1293ba89f9c8SArnd Bergmann
1294ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1295ba89f9c8SArnd Bergmann	bool "8KiB pages"
1296ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1297ba89f9c8SArnd Bergmann	help
1298ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1299ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1300ba89f9c8SArnd Bergmann
1301ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1302ba89f9c8SArnd Bergmann	bool "16KiB pages"
1303ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1304ba89f9c8SArnd Bergmann	help
1305ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1306ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1307ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1308ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1309ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1310ba89f9c8SArnd Bergmann	  page cache.
1311ba89f9c8SArnd Bergmann
1312ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1313ba89f9c8SArnd Bergmann	bool "32KiB pages"
1314ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1315ba89f9c8SArnd Bergmann	help
1316ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1317ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1318ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1319ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1320ba89f9c8SArnd Bergmann	  support this.
1321ba89f9c8SArnd Bergmann
1322ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1323ba89f9c8SArnd Bergmann	bool "64KiB pages"
1324ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1325ba89f9c8SArnd Bergmann	help
1326ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1327ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1328ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1329ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1330ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1331ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1332ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1333ba89f9c8SArnd Bergmann
1334ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1335ba89f9c8SArnd Bergmann	bool "256KiB pages"
1336ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1337ba89f9c8SArnd Bergmann	help
1338ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1339ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1340ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1341ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1342ba89f9c8SArnd Bergmann
1343ba89f9c8SArnd Bergmannendchoice
1344ba89f9c8SArnd Bergmann
13451f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
13461f0e290cSGuenter Roeck	def_bool y
13471f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1348e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1349e4bbd20dSNathan Chancellor
1350e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1351e4bbd20dSNathan Chancellor	def_bool y
13521f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
13531f0e290cSGuenter Roeck
1354ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1355ba89f9c8SArnd Bergmann	int
1356ba89f9c8SArnd Bergmann	default	12 if PAGE_SIZE_4KB
1357ba89f9c8SArnd Bergmann	default	13 if PAGE_SIZE_8KB
1358ba89f9c8SArnd Bergmann	default	14 if PAGE_SIZE_16KB
1359ba89f9c8SArnd Bergmann	default	15 if PAGE_SIZE_32KB
1360ba89f9c8SArnd Bergmann	default	16 if PAGE_SIZE_64KB
1361ba89f9c8SArnd Bergmann	default	18 if PAGE_SIZE_256KB
1362ba89f9c8SArnd Bergmann
136367f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
136467f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
136567f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
136667f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
136767f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
136867f3977fSAlexandre Ghiti# - STACK_RND_MASK
136967f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
137067f3977fSAlexandre Ghiti	bool
137167f3977fSAlexandre Ghiti	depends on MMU
1372e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
137367f3977fSAlexandre Ghiti
137403f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
137503f16cd0SJosh Poimboeuf	bool
137603f16cd0SJosh Poimboeuf
13774ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
13784ab7674fSJosh Poimboeuf	bool
13794ab7674fSJosh Poimboeuf
138022102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
138122102f45SJosh Poimboeuf	bool
138222102f45SJosh Poimboeuf
1383489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1384489e355bSJosh Poimboeuf	bool
1385489e355bSJosh Poimboeuf
13865f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
13875f3da8c0SJosh Poimboeuf	bool
13885f3da8c0SJosh Poimboeuf	select OBJTOOL
13895f3da8c0SJosh Poimboeuf
1390b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1391b9ab5ebbSJosh Poimboeuf	bool
1392b9ab5ebbSJosh Poimboeuf	help
139303f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
139403f16cd0SJosh Poimboeuf	  validation.
1395b9ab5ebbSJosh Poimboeuf
1396af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1397af085d90SJosh Poimboeuf	bool
1398af085d90SJosh Poimboeuf	help
1399140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1400140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1401140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1402af085d90SJosh Poimboeuf
1403468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1404468a9428SGeorge Spelvin	bool
1405468a9428SGeorge Spelvin	default n
1406468a9428SGeorge Spelvin	help
1407468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1408468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1409468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1410468a9428SGeorge Spelvin
1411666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1412666047feSFinn Thain	bool
1413666047feSFinn Thain
14143a495511SWilliam Breathitt Grayconfig ISA_BUS_API
14153a495511SWilliam Breathitt Gray	def_bool ISA
14163a495511SWilliam Breathitt Gray
1417d2125043SAl Viro#
1418d2125043SAl Viro# ABI hall of shame
1419d2125043SAl Viro#
1420d2125043SAl Viroconfig CLONE_BACKWARDS
1421d2125043SAl Viro	bool
1422d2125043SAl Viro	help
1423d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1424d2125043SAl Viro	  not the 5th one.
1425d2125043SAl Viro
1426d2125043SAl Viroconfig CLONE_BACKWARDS2
1427d2125043SAl Viro	bool
1428d2125043SAl Viro	help
1429d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1430d2125043SAl Viro
1431dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1432dfa9771aSMichal Simek	bool
1433dfa9771aSMichal Simek	help
1434dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1435dfa9771aSMichal Simek	  not the 5th one.
1436dfa9771aSMichal Simek
1437eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1438eaca6eaeSAl Viro	bool
1439eaca6eaeSAl Viro	help
1440eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1441eaca6eaeSAl Viro
14420a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
14430a0e8cdfSAl Viro	bool
14440a0e8cdfSAl Viro	help
14450a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
14460a0e8cdfSAl Viro
14470a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
14480a0e8cdfSAl Viro	bool
14490a0e8cdfSAl Viro	help
14500a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
14510a0e8cdfSAl Viro
1452495dfbf7SAl Viroconfig OLD_SIGACTION
1453495dfbf7SAl Viro	bool
1454495dfbf7SAl Viro	help
1455495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1456495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1457495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1458495dfbf7SAl Viro	  compatibility...
1459495dfbf7SAl Viro
1460495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1461495dfbf7SAl Viro	bool
1462495dfbf7SAl Viro
146317435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1464942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1465942437c9SArnd Bergmann	default !64BIT || COMPAT
146617435e5fSDeepa Dinamani	help
146717435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
146817435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
146917435e5fSDeepa Dinamani	  as part of compat syscall handling.
147017435e5fSDeepa Dinamani
147187a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
147287a4c375SChristoph Hellwig	bool
147387a4c375SChristoph Hellwig
1474a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1475a50a3f4bSThomas Gleixner	bool
1476a50a3f4bSThomas Gleixner
1477fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1478fff7fb0bSZhaoxiu Zeng	def_bool n
1479fff7fb0bSZhaoxiu Zeng
1480ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1481ba14a194SAndy Lutomirski	def_bool n
1482ba14a194SAndy Lutomirski	help
1483ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1484ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1485ba14a194SAndy Lutomirski
1486ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1487ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1488ba14a194SAndy Lutomirski
1489ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1490ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1491ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1492ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1493ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1494ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1495ba14a194SAndy Lutomirski
1496ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1497ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1498ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1499ba14a194SAndy Lutomirski
1500ba14a194SAndy Lutomirskiconfig VMAP_STACK
1501ba14a194SAndy Lutomirski	default y
1502ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1503eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
150438dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1505a7f7f624SMasahiro Yamada	help
1506ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1507ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1508ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1509ba14a194SAndy Lutomirski	  corruption.
1510ba14a194SAndy Lutomirski
151138dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
151238dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
151338dd767dSAndrey Konovalov	  must be enabled.
1514ba14a194SAndy Lutomirski
151539218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
151639218ff4SKees Cook	def_bool n
151739218ff4SKees Cook	help
151839218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
151939218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
152039218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
152139218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
152239218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
152339218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
152439218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
152539218ff4SKees Cook	  of the static branch state.
152639218ff4SKees Cook
15278cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
15288cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
15298cb37a59SMarco Elver	default y
153039218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
153139218ff4SKees Cook	help
153239218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
153339218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
153439218ff4SKees Cook	  attacks that depend on stack address determinism or
15358cb37a59SMarco Elver	  cross-syscall address exposures.
15368cb37a59SMarco Elver
15378cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
15388cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
15398cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
15408cb37a59SMarco Elver
15418cb37a59SMarco Elver	  If unsure, say Y.
15428cb37a59SMarco Elver
15438cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
15448cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
15458cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
15468cb37a59SMarco Elver	help
15478cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
15488cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
15498cb37a59SMarco Elver	  boot state.
155039218ff4SKees Cook
1551ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1552ad21fc4fSLaura Abbott	def_bool n
1553ad21fc4fSLaura Abbott
1554ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1555ad21fc4fSLaura Abbott	def_bool n
1556ad21fc4fSLaura Abbott
1557ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1558ad21fc4fSLaura Abbott	def_bool n
1559ad21fc4fSLaura Abbott
15600f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1561ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1562ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1563ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1564ad21fc4fSLaura Abbott	help
1565ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1566ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1567ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1568ad21fc4fSLaura Abbott	  or modifying text)
1569ad21fc4fSLaura Abbott
1570ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1571ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1572ad21fc4fSLaura Abbott
1573ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1574ad21fc4fSLaura Abbott	def_bool n
1575ad21fc4fSLaura Abbott
15760f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1577ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1578ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1579ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1580ad21fc4fSLaura Abbott	help
1581ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1582ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1583ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1584ad21fc4fSLaura Abbott
1585ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1586ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1587ea8c64acSChristoph Hellwig	bool
1588ea8c64acSChristoph Hellwig
1589bff70402SJames Morseconfig ARCH_HAS_CPU_RESCTRL
1590bff70402SJames Morse	bool
1591bff70402SJames Morse	help
1592bff70402SJames Morse	  An architecture selects this option to indicate that the necessary
1593bff70402SJames Morse	  hooks are provided to support the common memory system usage
1594bff70402SJames Morse	  monitoring and control interfaces provided by the 'resctrl'
1595bff70402SJames Morse	  filesystem (see RESCTRL_FS).
1596bff70402SJames Morse
159704f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
159804f264d3SPaul Burton	bool
159904f264d3SPaul Burton	help
160004f264d3SPaul Burton	  An architecture can select this if it provides an
160104f264d3SPaul Burton	  asm/compiler.h header that should be included after
160204f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
160304f264d3SPaul Burton	  headers generally provide.
160404f264d3SPaul Burton
1605e419ddeaSGreg Ungererconfig HAVE_ARCH_LIBGCC_H
1606e419ddeaSGreg Ungerer	bool
1607e419ddeaSGreg Ungerer	help
1608e419ddeaSGreg Ungerer	  An architecture can select this if it provides an
1609e419ddeaSGreg Ungerer	  asm/libgcc.h header that should be included after
1610e419ddeaSGreg Ungerer	  linux/libgcc.h in order to override macro definitions that
1611e419ddeaSGreg Ungerer	  header generally provides.
1612e419ddeaSGreg Ungerer
1613271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1614271ca788SArd Biesheuvel	bool
1615271ca788SArd Biesheuvel	help
1616271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1617271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1618271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1619271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1620271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1621271ca788SArd Biesheuvel	  kernels.
1622271ca788SArd Biesheuvel
1623ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1624ce9084baSArd Biesheuvel	bool
1625ce9084baSArd Biesheuvel
1626fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1627fb346fd9SWaiman Long	bool "Locking event counts collection"
1628fb346fd9SWaiman Long	depends on DEBUG_FS
1629a7f7f624SMasahiro Yamada	help
1630fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1631fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1632fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1633fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1634fb346fd9SWaiman Long
16355cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
16365cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
16375cf896fbSPeter Collingbourne	bool
16385cf896fbSPeter Collingbourne
16395cf896fbSPeter Collingbourneconfig RELR
16405cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
16415cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
16425cf896fbSPeter Collingbourne	default y
16435cf896fbSPeter Collingbourne	help
16445cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
16455cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
16465cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
16475cf896fbSPeter Collingbourne	  are compatible).
16485cf896fbSPeter Collingbourne
16490c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
16500c9c1d56SThiago Jung Bauermann	bool
16510c9c1d56SThiago Jung Bauermann
165246b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
165346b49b12STom Lendacky	bool
165446b49b12STom Lendacky
16550e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
16560e242208SHassan Naveed	bool
16570e242208SHassan Naveed	help
16580e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
16590e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
16600e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
16610e242208SHassan Naveed	  related optimizations for a given architecture.
16620e242208SHassan Naveed
1663365841e1SThomas Weißschuhconfig ARCH_HAS_VDSO_ARCH_DATA
16647b338f6dSThomas Weißschuh	depends on HAVE_GENERIC_VDSO
1665365841e1SThomas Weißschuh	bool
1666365841e1SThomas Weißschuh
1667a812eee0SNam Caoconfig ARCH_HAS_VDSO_TIME_DATA
1668d60d7de3SSven Schnelle	bool
1669d60d7de3SSven Schnelle
1670115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1671115284d8SJosh Poimboeuf	bool
1672115284d8SJosh Poimboeuf
16739183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
16749183c3f9SJosh Poimboeuf	bool
16759183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
167603f16cd0SJosh Poimboeuf	select OBJTOOL
16779183c3f9SJosh Poimboeuf
16786ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
16796ef869e0SMichal Hocko	bool
168099cf983cSMark Rutland
168199cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
168299cf983cSMark Rutland	bool
16836ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
168499cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
16856ef869e0SMichal Hocko	help
168699cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
168799cf983cSMark Rutland	  model being selected at boot time using static calls.
168899cf983cSMark Rutland
168999cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
169099cf983cSMark Rutland	  preemption function will be patched directly.
169199cf983cSMark Rutland
169299cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
169399cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
169499cf983cSMark Rutland	  trampoline will be patched.
169599cf983cSMark Rutland
169699cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
169799cf983cSMark Rutland	  overhead.
169899cf983cSMark Rutland
169999cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
170099cf983cSMark Rutland	bool
1701a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
170299cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
170399cf983cSMark Rutland	help
170499cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
170599cf983cSMark Rutland	  model being selected at boot time using static keys.
170699cf983cSMark Rutland
170799cf983cSMark Rutland	  Each preemption function will be given an early return based on a
170899cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
170999cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
171099cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
171199cf983cSMark Rutland	  integrate better with CFI schemes.
171299cf983cSMark Rutland
171399cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
171499cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
17156ef869e0SMichal Hocko
171659612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
171759612b24SNathan Chancellor	bool
171859612b24SNathan Chancellor	help
171959612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
172059612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
172159612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
172259612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
172359612b24SNathan Chancellor	  versions.
172459612b24SNathan Chancellor
17254f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
17264f5b0c17SMike Rapoport	bool
17274f5b0c17SMike Rapoport
17285d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
17295d6ad668SMike Rapoport	bool
17305d6ad668SMike Rapoport
1731df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1732df4e817bSPasha Tatashin	bool
1733df4e817bSPasha Tatashin
17342ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
17352ca408d9SBrian Gerst	bool
17362ca408d9SBrian Gerst	help
17372ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
17382ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
17392ca408d9SBrian Gerst
17407facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
17417facdc42SAl Viro	bool
17427facdc42SAl Viro
174358e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
174458e106e7SBalbir Singh	bool
174558e106e7SBalbir Singh
1746d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1747d593d64fSPrasad Sodagudi	bool
1748d593d64fSPrasad Sodagudi
17491bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
17501bdda24cSThomas Gleixner	bool
17511bdda24cSThomas Gleixner
175250468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
175350468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
175450468e43SJarkko Sakkinen	bool
175550468e43SJarkko Sakkinen
175671ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
175771ce1ab5SKinsey Ho	bool
175871ce1ab5SKinsey Ho	help
175971ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
176071ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
176171ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
176271ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
176371ce1ab5SKinsey Ho
1764eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1765eed9a328SYu Zhao	bool
1766eed9a328SYu Zhao	help
1767eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1768eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1769eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1770eed9a328SYu Zhao	  may use this capability to reduce their search space.
1771eed9a328SYu Zhao
17726cbd1d6dSSamuel Hollandconfig ARCH_HAS_KERNEL_FPU_SUPPORT
17736cbd1d6dSSamuel Holland	bool
17746cbd1d6dSSamuel Holland	help
17756cbd1d6dSSamuel Holland	  Architectures that select this option can run floating-point code in
17766cbd1d6dSSamuel Holland	  the kernel, as described in Documentation/core-api/floating-point.rst.
17776cbd1d6dSSamuel Holland
17789b400d17SArd Biesheuvelconfig ARCH_VMLINUX_NEEDS_RELOCS
17799b400d17SArd Biesheuvel	bool
17809b400d17SArd Biesheuvel	help
17819b400d17SArd Biesheuvel	  Whether the architecture needs vmlinux to be built with static
17829b400d17SArd Biesheuvel	  relocations preserved. This is used by some architectures to
17839b400d17SArd Biesheuvel	  construct bespoke relocation tables for KASLR.
17849b400d17SArd Biesheuvel
178529589343SThomas Gleixner# Select if architecture uses the common generic TIF bits
178629589343SThomas Gleixnerconfig HAVE_GENERIC_TIF_BITS
178729589343SThomas Gleixner       bool
178829589343SThomas Gleixner
17892521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
179045332b1bSMasahiro Yamada
179145332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1792fa1b5d09SLinus Torvalds
1793d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1794d49a0626SPeter Zijlstra	bool
1795d49a0626SPeter Zijlstra
1796d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1797d49a0626SPeter Zijlstra	bool
1798d49a0626SPeter Zijlstra
1799d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1800d49a0626SPeter Zijlstra	bool
1801d49a0626SPeter Zijlstra
1802d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1803d49a0626SPeter Zijlstra	bool
1804d49a0626SPeter Zijlstra
1805d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1806d49a0626SPeter Zijlstra	bool
1807d49a0626SPeter Zijlstra
1808d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1809d49a0626SPeter Zijlstra	int
1810d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1811d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1812d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1813d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1814d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1815d49a0626SPeter Zijlstra	default 0
1816d49a0626SPeter Zijlstra
18175270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
18185270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
18195270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
18205270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
18215270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
18225270316cSPetr Pavlu
18235270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
18245270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
18255270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
18265270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
18275270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
18285270316cSPetr Pavlu
1829a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1830a88d970cSPaul E. McKenney	bool
1831a88d970cSPaul E. McKenney
18321198c9c6SNaveen N Raoconfig ARCH_WANTS_PRE_LINK_VMLINUX
18331198c9c6SNaveen N Rao	bool
18341198c9c6SNaveen N Rao	help
18351198c9c6SNaveen N Rao	  An architecture can select this if it provides arch/<arch>/tools/Makefile
18361198c9c6SNaveen N Rao	  with .arch.vmlinux.o target to be linked into vmlinux.
18371198c9c6SNaveen N Rao
1838735e5920SDavid Kaplanconfig ARCH_HAS_CPU_ATTACK_VECTORS
1839735e5920SDavid Kaplan	bool
1840735e5920SDavid Kaplan
184122471e13SRandy Dunlapendmenu
1842