xref: /linux/arch/Kconfig (revision 39c89ee6e9c4464eb366f4e594379454a6c4db39)
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
235cf66bb93SDavid Woodhouse	  Modern versions of GCC (since 4.4) have builtin functions
236cf66bb93SDavid Woodhouse	  for handling byte-swapping. Using these, instead of the old
237cf66bb93SDavid Woodhouse	  inline assembler that the architecture code provides in the
238cf66bb93SDavid Woodhouse	  __arch_bswapXX() macros, allows the compiler to see what's
239cf66bb93SDavid Woodhouse	  happening and offers more opportunity for optimisation. In
240cf66bb93SDavid Woodhouse	  particular, the compiler will be able to combine the byteswap
241cf66bb93SDavid Woodhouse	  with a nearby load or store and use load-and-swap or
242cf66bb93SDavid Woodhouse	  store-and-swap instructions if the architecture has them. It
243cf66bb93SDavid Woodhouse	  should almost *never* result in code which is worse than the
244cf66bb93SDavid Woodhouse	  hand-coded assembler in <asm/swab.h>.  But just in case it
245cf66bb93SDavid Woodhouse	  does, the use of the builtins is optional.
246cf66bb93SDavid Woodhouse
247cf66bb93SDavid Woodhouse	  Any architecture with load-and-swap or store-and-swap
248cf66bb93SDavid Woodhouse	  instructions should set this. And it shouldn't hurt to set it
249cf66bb93SDavid Woodhouse	  on architectures that don't have such instructions.
250cf66bb93SDavid Woodhouse
2519edddaa2SAnanth N Mavinakayanahalliconfig KRETPROBES
2529edddaa2SAnanth N Mavinakayanahalli	def_bool y
25373f9b911SMasami Hiramatsu	depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
25473f9b911SMasami Hiramatsu
25573f9b911SMasami Hiramatsuconfig KRETPROBE_ON_RETHOOK
25673f9b911SMasami Hiramatsu	def_bool y
25773f9b911SMasami Hiramatsu	depends on HAVE_RETHOOK
25873f9b911SMasami Hiramatsu	depends on KRETPROBES
25973f9b911SMasami Hiramatsu	select RETHOOK
2609edddaa2SAnanth N Mavinakayanahalli
2617c68af6eSAvi Kivityconfig USER_RETURN_NOTIFIER
2627c68af6eSAvi Kivity	bool
2637c68af6eSAvi Kivity	depends on HAVE_USER_RETURN_NOTIFIER
2647c68af6eSAvi Kivity	help
2657c68af6eSAvi Kivity	  Provide a kernel-internal notification when a cpu is about to
2667c68af6eSAvi Kivity	  switch to user mode.
2677c68af6eSAvi Kivity
26828b2ee20SRik van Rielconfig HAVE_IOREMAP_PROT
2699ba16087SJan Beulich	bool
27028b2ee20SRik van Riel
271125e5645SMathieu Desnoyersconfig HAVE_KPROBES
2729ba16087SJan Beulich	bool
2739edddaa2SAnanth N Mavinakayanahalli
2749edddaa2SAnanth N Mavinakayanahalliconfig HAVE_KRETPROBES
2759ba16087SJan Beulich	bool
27674bc7ceeSArthur Kepner
277afd66255SMasami Hiramatsuconfig HAVE_OPTPROBES
278afd66255SMasami Hiramatsu	bool
279d314d74cSCong Wang
280e7dbfe34SMasami Hiramatsuconfig HAVE_KPROBES_ON_FTRACE
281e7dbfe34SMasami Hiramatsu	bool
282e7dbfe34SMasami Hiramatsu
2831f6d3a8fSMasami Hiramatsuconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2841f6d3a8fSMasami Hiramatsu	bool
2851f6d3a8fSMasami Hiramatsu	help
2861f6d3a8fSMasami Hiramatsu	  Since kretprobes modifies return address on the stack, the
2871f6d3a8fSMasami Hiramatsu	  stacktrace may see the kretprobe trampoline address instead
2881f6d3a8fSMasami Hiramatsu	  of correct one. If the architecture stacktrace code and
2891f6d3a8fSMasami Hiramatsu	  unwinder can adjust such entries, select this configuration.
2901f6d3a8fSMasami Hiramatsu
291540adea3SMasami Hiramatsuconfig HAVE_FUNCTION_ERROR_INJECTION
2929802d865SJosef Bacik	bool
2939802d865SJosef Bacik
29442a0bb3fSPetr Mladekconfig HAVE_NMI
29542a0bb3fSPetr Mladek	bool
29642a0bb3fSPetr Mladek
297a257caccSChristophe Leroyconfig HAVE_FUNCTION_DESCRIPTORS
298a257caccSChristophe Leroy	bool
299a257caccSChristophe Leroy
3004aae683fSMasahiro Yamadaconfig TRACE_IRQFLAGS_SUPPORT
3014aae683fSMasahiro Yamada	bool
3024aae683fSMasahiro Yamada
3034510bffbSMark Rutlandconfig TRACE_IRQFLAGS_NMI_SUPPORT
3044510bffbSMark Rutland	bool
3054510bffbSMark Rutland
3061f5a4ad9SRoland McGrath#
3071f5a4ad9SRoland McGrath# An arch should select this if it provides all these things:
3081f5a4ad9SRoland McGrath#
3091f5a4ad9SRoland McGrath#	task_pt_regs()		in asm/processor.h or asm/ptrace.h
3101f5a4ad9SRoland McGrath#	arch_has_single_step()	if there is hardware single-step support
3111f5a4ad9SRoland McGrath#	arch_has_block_step()	if there is hardware block-step support
3121f5a4ad9SRoland McGrath#	asm/syscall.h		supplying asm-generic/syscall.h interface
3131f5a4ad9SRoland McGrath#	linux/regset.h		user_regset interfaces
3141f5a4ad9SRoland McGrath#	CORE_DUMP_USE_REGSET	#define'd in linux/elf.h
315153474baSEric W. Biederman#	TIF_SYSCALL_TRACE	calls ptrace_report_syscall_{entry,exit}
31603248addSEric W. Biederman#	TIF_NOTIFY_RESUME	calls resume_user_mode_work()
3171f5a4ad9SRoland McGrath#
3181f5a4ad9SRoland McGrathconfig HAVE_ARCH_TRACEHOOK
3199ba16087SJan Beulich	bool
3201f5a4ad9SRoland McGrath
321c64be2bbSMarek Szyprowskiconfig HAVE_DMA_CONTIGUOUS
322c64be2bbSMarek Szyprowski	bool
323c64be2bbSMarek Szyprowski
32429d5e047SThomas Gleixnerconfig GENERIC_SMP_IDLE_THREAD
32529d5e047SThomas Gleixner	bool
32629d5e047SThomas Gleixner
327485cf5daSKevin Hilmanconfig GENERIC_IDLE_POLL_SETUP
328485cf5daSKevin Hilman	bool
329485cf5daSKevin Hilman
3306974f0c4SDaniel Micayconfig ARCH_HAS_FORTIFY_SOURCE
3316974f0c4SDaniel Micay	bool
3326974f0c4SDaniel Micay	help
3336974f0c4SDaniel Micay	  An architecture should select this when it can successfully
3346974f0c4SDaniel Micay	  build and run with CONFIG_FORTIFY_SOURCE.
3356974f0c4SDaniel Micay
336d8ae8a37SChristoph Hellwig#
337d8ae8a37SChristoph Hellwig# Select if the arch provides a historic keepinit alias for the retain_initrd
338d8ae8a37SChristoph Hellwig# command line option
339d8ae8a37SChristoph Hellwig#
340d8ae8a37SChristoph Hellwigconfig ARCH_HAS_KEEPINITRD
341d8ae8a37SChristoph Hellwig	bool
342d8ae8a37SChristoph Hellwig
343d2852a22SDaniel Borkmann# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
344d2852a22SDaniel Borkmannconfig ARCH_HAS_SET_MEMORY
345d2852a22SDaniel Borkmann	bool
346d2852a22SDaniel Borkmann
347d253ca0cSRick Edgecombe# Select if arch has all set_direct_map_invalid/default() functions
348d253ca0cSRick Edgecombeconfig ARCH_HAS_SET_DIRECT_MAP
349d253ca0cSRick Edgecombe	bool
350d253ca0cSRick Edgecombe
351c30700dbSChristoph Hellwig#
352fa7e2247SChristoph Hellwig# Select if the architecture provides the arch_dma_set_uncached symbol to
353a86ecfa6SColin Ian King# either provide an uncached segment alias for a DMA allocation, or
354fa7e2247SChristoph Hellwig# to remap the page tables in place.
355c30700dbSChristoph Hellwig#
356fa7e2247SChristoph Hellwigconfig ARCH_HAS_DMA_SET_UNCACHED
357c30700dbSChristoph Hellwig	bool
358c30700dbSChristoph Hellwig
359999a5d12SChristoph Hellwig#
360999a5d12SChristoph Hellwig# Select if the architectures provides the arch_dma_clear_uncached symbol
361999a5d12SChristoph Hellwig# to undo an in-place page table remap for uncached access.
362999a5d12SChristoph Hellwig#
363999a5d12SChristoph Hellwigconfig ARCH_HAS_DMA_CLEAR_UNCACHED
364f5e10287SThomas Gleixner	bool
365f5e10287SThomas Gleixner
3667725acaaSThomas Gleixnerconfig ARCH_HAS_CPU_FINALIZE_INIT
3677725acaaSThomas Gleixner	bool
3687725acaaSThomas Gleixner
3698f23f5dbSJason Gunthorpe# The architecture has a per-task state that includes the mm's PASID
3708f23f5dbSJason Gunthorpeconfig ARCH_HAS_CPU_PASID
3718f23f5dbSJason Gunthorpe	bool
3728f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
3738f23f5dbSJason Gunthorpe
3745905429aSKees Cookconfig HAVE_ARCH_THREAD_STRUCT_WHITELIST
3755905429aSKees Cook	bool
3765905429aSKees Cook	help
3775905429aSKees Cook	  An architecture should select this to provide hardened usercopy
3785905429aSKees Cook	  knowledge about what region of the thread_struct should be
3795905429aSKees Cook	  whitelisted for copying to userspace. Normally this is only the
3805905429aSKees Cook	  FPU registers. Specifically, arch_thread_struct_whitelist()
3815905429aSKees Cook	  should be implemented. Without this, the entire thread_struct
3825905429aSKees Cook	  field in task_struct will be left whitelisted.
3835905429aSKees Cook
3845aaeb5c0SIngo Molnar# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
3855aaeb5c0SIngo Molnarconfig ARCH_WANTS_DYNAMIC_TASK_STRUCT
3865aaeb5c0SIngo Molnar	bool
3875aaeb5c0SIngo Molnar
38851c2ee6dSNick Desaulniersconfig ARCH_WANTS_NO_INSTR
38951c2ee6dSNick Desaulniers	bool
39051c2ee6dSNick Desaulniers	help
39151c2ee6dSNick Desaulniers	  An architecture should select this if the noinstr macro is being used on
39251c2ee6dSNick Desaulniers	  functions to denote that the toolchain should avoid instrumenting such
39351c2ee6dSNick Desaulniers	  functions and is required for correctness.
39451c2ee6dSNick Desaulniers
395942fa985SYury Norovconfig ARCH_32BIT_OFF_T
396942fa985SYury Norov	bool
397942fa985SYury Norov	depends on !64BIT
398942fa985SYury Norov	help
399942fa985SYury Norov	  All new 32-bit architectures should have 64-bit off_t type on
400942fa985SYury Norov	  userspace side which corresponds to the loff_t kernel type. This
401942fa985SYury Norov	  is the requirement for modern ABIs. Some existing architectures
402942fa985SYury Norov	  still support 32-bit off_t. This option is enabled for all such
403942fa985SYury Norov	  architectures explicitly.
404942fa985SYury Norov
40596c0a6a7SHeiko Carstens# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
40696c0a6a7SHeiko Carstensconfig ARCH_32BIT_USTAT_F_TINODE
40796c0a6a7SHeiko Carstens	bool
40896c0a6a7SHeiko Carstens
4092ff2b7ecSMasahiro Yamadaconfig HAVE_ASM_MODVERSIONS
4102ff2b7ecSMasahiro Yamada	bool
4112ff2b7ecSMasahiro Yamada	help
412a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it provides
4132ff2b7ecSMasahiro Yamada	  <asm/asm-prototypes.h> to support the module versioning for symbols
4142ff2b7ecSMasahiro Yamada	  exported from assembly code.
4152ff2b7ecSMasahiro Yamada
416f850c30cSHeiko Carstensconfig HAVE_REGS_AND_STACK_ACCESS_API
417f850c30cSHeiko Carstens	bool
418e01292b1SHeiko Carstens	help
419a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
420e01292b1SHeiko Carstens	  the API needed to access registers and stack entries from pt_regs,
421e01292b1SHeiko Carstens	  declared in asm/ptrace.h
422e01292b1SHeiko Carstens	  For example the kprobes-based event tracer needs this API.
423f850c30cSHeiko Carstens
424d7822b1eSMathieu Desnoyersconfig HAVE_RSEQ
425d7822b1eSMathieu Desnoyers	bool
426d7822b1eSMathieu Desnoyers	depends on HAVE_REGS_AND_STACK_ACCESS_API
427d7822b1eSMathieu Desnoyers	help
428d7822b1eSMathieu Desnoyers	  This symbol should be selected by an architecture if it
429d7822b1eSMathieu Desnoyers	  supports an implementation of restartable sequences.
430d7822b1eSMathieu Desnoyers
4312f7ab126SMiguel Ojedaconfig HAVE_RUST
4322f7ab126SMiguel Ojeda	bool
4332f7ab126SMiguel Ojeda	help
4342f7ab126SMiguel Ojeda	  This symbol should be selected by an architecture if it
4352f7ab126SMiguel Ojeda	  supports Rust.
4362f7ab126SMiguel Ojeda
4373c88ee19SMasami Hiramatsuconfig HAVE_FUNCTION_ARG_ACCESS_API
4383c88ee19SMasami Hiramatsu	bool
4393c88ee19SMasami Hiramatsu	help
440a86ecfa6SColin Ian King	  This symbol should be selected by an architecture if it supports
4413c88ee19SMasami Hiramatsu	  the API needed to access function arguments from pt_regs,
4423c88ee19SMasami Hiramatsu	  declared in asm/ptrace.h
4433c88ee19SMasami Hiramatsu
44462a038d3SK.Prasadconfig HAVE_HW_BREAKPOINT
44562a038d3SK.Prasad	bool
44699e8c5a3SFrederic Weisbecker	depends on PERF_EVENTS
44762a038d3SK.Prasad
4480102752eSFrederic Weisbeckerconfig HAVE_MIXED_BREAKPOINTS_REGS
4490102752eSFrederic Weisbecker	bool
4500102752eSFrederic Weisbecker	depends on HAVE_HW_BREAKPOINT
4510102752eSFrederic Weisbecker	help
4520102752eSFrederic Weisbecker	  Depending on the arch implementation of hardware breakpoints,
4530102752eSFrederic Weisbecker	  some of them have separate registers for data and instruction
4540102752eSFrederic Weisbecker	  breakpoints addresses, others have mixed registers to store
4550102752eSFrederic Weisbecker	  them but define the access type in a control register.
4560102752eSFrederic Weisbecker	  Select this option if your arch implements breakpoints under the
4570102752eSFrederic Weisbecker	  latter fashion.
4580102752eSFrederic Weisbecker
4597c68af6eSAvi Kivityconfig HAVE_USER_RETURN_NOTIFIER
4607c68af6eSAvi Kivity	bool
461a1922ed6SIngo Molnar
462c01d4323SFrederic Weisbeckerconfig HAVE_PERF_EVENTS_NMI
463c01d4323SFrederic Weisbecker	bool
46423637d47SFrederic Weisbecker	help
46523637d47SFrederic Weisbecker	  System hardware can generate an NMI using the perf event
46623637d47SFrederic Weisbecker	  subsystem.  Also has support for calculating CPU cycle events
46723637d47SFrederic Weisbecker	  to determine how many clock cycles in a given period.
468c01d4323SFrederic Weisbecker
46905a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_PERF
47005a4a952SNicholas Piggin	bool
47105a4a952SNicholas Piggin	depends on HAVE_PERF_EVENTS_NMI
47205a4a952SNicholas Piggin	help
47305a4a952SNicholas Piggin	  The arch chooses to use the generic perf-NMI-based hardlockup
47405a4a952SNicholas Piggin	  detector. Must define HAVE_PERF_EVENTS_NMI.
47505a4a952SNicholas Piggin
47605a4a952SNicholas Pigginconfig HAVE_HARDLOCKUP_DETECTOR_ARCH
47705a4a952SNicholas Piggin	bool
47805a4a952SNicholas Piggin	help
4791356d0b9SPetr Mladek	  The arch provides its own hardlockup detector implementation instead
4801356d0b9SPetr Mladek	  of the generic ones.
4811356d0b9SPetr Mladek
4821356d0b9SPetr Mladek	  It uses the same command line parameters, and sysctl interface,
4831356d0b9SPetr Mladek	  as the generic hardlockup detectors.
48405a4a952SNicholas Piggin
48571753c6eSJosh Poimboeufconfig UNWIND_USER
48671753c6eSJosh Poimboeuf	bool
48771753c6eSJosh Poimboeuf
48871753c6eSJosh Poimboeufconfig HAVE_UNWIND_USER_FP
48971753c6eSJosh Poimboeuf	bool
49071753c6eSJosh Poimboeuf	select UNWIND_USER
49171753c6eSJosh Poimboeuf
492c5e63197SJiri Olsaconfig HAVE_PERF_REGS
493c5e63197SJiri Olsa	bool
494c5e63197SJiri Olsa	help
495c5e63197SJiri Olsa	  Support selective register dumps for perf events. This includes
496c5e63197SJiri Olsa	  bit-mapping of each registers and a unique architecture id.
497c5e63197SJiri Olsa
498c5ebcedbSJiri Olsaconfig HAVE_PERF_USER_STACK_DUMP
499c5ebcedbSJiri Olsa	bool
500c5ebcedbSJiri Olsa	help
501c5ebcedbSJiri Olsa	  Support user stack dumps for perf event samples. This needs
502c5ebcedbSJiri Olsa	  access to the user stack pointer which is not unified across
503c5ebcedbSJiri Olsa	  architectures.
504c5ebcedbSJiri Olsa
505bf5438fcSJason Baronconfig HAVE_ARCH_JUMP_LABEL
506bf5438fcSJason Baron	bool
507bf5438fcSJason Baron
50850ff18abSArd Biesheuvelconfig HAVE_ARCH_JUMP_LABEL_RELATIVE
50950ff18abSArd Biesheuvel	bool
51050ff18abSArd Biesheuvel
5110d6e24d4SPeter Zijlstraconfig MMU_GATHER_TABLE_FREE
5120d6e24d4SPeter Zijlstra	bool
5130d6e24d4SPeter Zijlstra
514ff2e6d72SPeter Zijlstraconfig MMU_GATHER_RCU_TABLE_FREE
51526723911SPeter Zijlstra	bool
5160d6e24d4SPeter Zijlstra	select MMU_GATHER_TABLE_FREE
51726723911SPeter Zijlstra
5183af4bd03SPeter Zijlstraconfig MMU_GATHER_PAGE_SIZE
519ed6a7935SPeter Zijlstra	bool
520ed6a7935SPeter Zijlstra
52127796d03SPeter Zijlstraconfig MMU_GATHER_NO_RANGE
52227796d03SPeter Zijlstra	bool
5231e9fdf21SPeter Zijlstra	select MMU_GATHER_MERGE_VMAS
5241e9fdf21SPeter Zijlstra
5251e9fdf21SPeter Zijlstraconfig MMU_GATHER_NO_FLUSH_CACHE
5261e9fdf21SPeter Zijlstra	bool
5271e9fdf21SPeter Zijlstra
5281e9fdf21SPeter Zijlstraconfig MMU_GATHER_MERGE_VMAS
5291e9fdf21SPeter Zijlstra	bool
53027796d03SPeter Zijlstra
531580a586cSPeter Zijlstraconfig MMU_GATHER_NO_GATHER
532952a31c9SMartin Schwidefsky	bool
5330d6e24d4SPeter Zijlstra	depends on MMU_GATHER_TABLE_FREE
534952a31c9SMartin Schwidefsky
535d53c3dfbSNicholas Pigginconfig ARCH_WANT_IRQS_OFF_ACTIVATE_MM
536d53c3dfbSNicholas Piggin	bool
537d53c3dfbSNicholas Piggin	help
538d53c3dfbSNicholas Piggin	  Temporary select until all architectures can be converted to have
539d53c3dfbSNicholas Piggin	  irqs disabled over activate_mm. Architectures that do IPI based TLB
540d53c3dfbSNicholas Piggin	  shootdowns should enable this.
541d53c3dfbSNicholas Piggin
54288e3009bSNicholas Piggin# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
54388e3009bSNicholas Piggin# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
54488e3009bSNicholas Piggin# to/from kernel threads when the same mm is running on a lot of CPUs (a large
54588e3009bSNicholas Piggin# multi-threaded application), by reducing contention on the mm refcount.
54688e3009bSNicholas Piggin#
54788e3009bSNicholas Piggin# This can be disabled if the architecture ensures no CPUs are using an mm as a
54888e3009bSNicholas Piggin# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
54988e3009bSNicholas Piggin# or its kernel page tables). This could be arranged by arch_exit_mmap(), or
55088e3009bSNicholas Piggin# final exit(2) TLB flush, for example.
55188e3009bSNicholas Piggin#
55288e3009bSNicholas Piggin# To implement this, an arch *must*:
55388e3009bSNicholas Piggin# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
55488e3009bSNicholas Piggin# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
55588e3009bSNicholas Piggin# converted already).
55688e3009bSNicholas Pigginconfig MMU_LAZY_TLB_REFCOUNT
55788e3009bSNicholas Piggin	def_bool y
5582655421aSNicholas Piggin	depends on !MMU_LAZY_TLB_SHOOTDOWN
5592655421aSNicholas Piggin
5602655421aSNicholas Piggin# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
5612655421aSNicholas Piggin# mm as a lazy tlb beyond its last reference count, by shooting down these
5622655421aSNicholas Piggin# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
5632655421aSNicholas Piggin# be using the mm as a lazy tlb, so that they may switch themselves to using
5642655421aSNicholas Piggin# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
5652655421aSNicholas Piggin# may be using mm as a lazy tlb mm.
5662655421aSNicholas Piggin#
5672655421aSNicholas Piggin# To implement this, an arch *must*:
5682655421aSNicholas Piggin# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
5692655421aSNicholas Piggin#   at least all possible CPUs in which the mm is lazy.
5702655421aSNicholas Piggin# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
5712655421aSNicholas Pigginconfig MMU_LAZY_TLB_SHOOTDOWN
5722655421aSNicholas Piggin	bool
57388e3009bSNicholas Piggin
574df013ffbSHuang Yingconfig ARCH_HAVE_NMI_SAFE_CMPXCHG
575df013ffbSHuang Ying	bool
576df013ffbSHuang Ying
577a9c3475dSVignesh Balasubramanianconfig ARCH_HAVE_EXTRA_ELF_NOTES
578a9c3475dSVignesh Balasubramanian	bool
579a9c3475dSVignesh Balasubramanian	help
580a9c3475dSVignesh Balasubramanian	  An architecture should select this in order to enable adding an
581a9c3475dSVignesh Balasubramanian	  arch-specific ELF note section to core files. It must provide two
582a9c3475dSVignesh Balasubramanian	  functions: elf_coredump_extra_notes_size() and
583a9c3475dSVignesh Balasubramanian	  elf_coredump_extra_notes_write() which are invoked by the ELF core
584a9c3475dSVignesh Balasubramanian	  dumper.
585a9c3475dSVignesh Balasubramanian
5862e83b879SPaul E. McKenneyconfig ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
5872e83b879SPaul E. McKenney	bool
5882e83b879SPaul E. McKenney
58943570fd2SHeiko Carstensconfig HAVE_ALIGNED_STRUCT_PAGE
59043570fd2SHeiko Carstens	bool
59143570fd2SHeiko Carstens	help
59243570fd2SHeiko Carstens	  This makes sure that struct pages are double word aligned and that
59343570fd2SHeiko Carstens	  e.g. the SLUB allocator can perform double word atomic operations
59443570fd2SHeiko Carstens	  on a struct page for better performance. However selecting this
59543570fd2SHeiko Carstens	  might increase the size of a struct page by a word.
59643570fd2SHeiko Carstens
5974156153cSHeiko Carstensconfig HAVE_CMPXCHG_LOCAL
5984156153cSHeiko Carstens	bool
5994156153cSHeiko Carstens
6002565409fSHeiko Carstensconfig HAVE_CMPXCHG_DOUBLE
6012565409fSHeiko Carstens	bool
6022565409fSHeiko Carstens
60377e58496SPaul E. McKenneyconfig ARCH_WEAK_RELEASE_ACQUIRE
60477e58496SPaul E. McKenney	bool
60577e58496SPaul E. McKenney
606c1d7e01dSWill Deaconconfig ARCH_WANT_IPC_PARSE_VERSION
607c1d7e01dSWill Deacon	bool
608c1d7e01dSWill Deacon
609c1d7e01dSWill Deaconconfig ARCH_WANT_COMPAT_IPC_PARSE_VERSION
610c1d7e01dSWill Deacon	bool
611c1d7e01dSWill Deacon
61248b25c43SChris Metcalfconfig ARCH_WANT_OLD_COMPAT_IPC
613c1d7e01dSWill Deacon	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
61448b25c43SChris Metcalf	bool
61548b25c43SChris Metcalf
616282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP
617e2cfabdfSWill Drewry	bool
618e2cfabdfSWill Drewry	help
619282a181bSYiFei Zhu	  An arch should select this symbol to support seccomp mode 1 (the fixed
620282a181bSYiFei Zhu	  syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
621282a181bSYiFei Zhu	  and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
622282a181bSYiFei Zhu	  - __NR_seccomp_read_32
623282a181bSYiFei Zhu	  - __NR_seccomp_write_32
624282a181bSYiFei Zhu	  - __NR_seccomp_exit_32
625282a181bSYiFei Zhu	  - __NR_seccomp_sigreturn_32
626282a181bSYiFei Zhu
627282a181bSYiFei Zhuconfig HAVE_ARCH_SECCOMP_FILTER
628282a181bSYiFei Zhu	bool
629282a181bSYiFei Zhu	select HAVE_ARCH_SECCOMP
630282a181bSYiFei Zhu	help
631fb0fadf9SWill Drewry	  An arch should select this symbol if it provides all of these things:
632282a181bSYiFei Zhu	  - all the requirements for HAVE_ARCH_SECCOMP
633bb6ea430SWill Drewry	  - syscall_get_arch()
634bb6ea430SWill Drewry	  - syscall_get_arguments()
635bb6ea430SWill Drewry	  - syscall_rollback()
636bb6ea430SWill Drewry	  - syscall_set_return_value()
637fb0fadf9SWill Drewry	  - SIGSYS siginfo_t support
638fb0fadf9SWill Drewry	  - secure_computing is called from a ptrace_event()-safe context
639fb0fadf9SWill Drewry	  - secure_computing return value is checked and a return value of -1
640fb0fadf9SWill Drewry	    results in the system call being skipped immediately.
64148dc92b9SKees Cook	  - seccomp syscall wired up
6420d8315ddSYiFei Zhu	  - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
6430d8315ddSYiFei Zhu	    SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
6440d8315ddSYiFei Zhu	    COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
645e2cfabdfSWill Drewry
646282a181bSYiFei Zhuconfig SECCOMP
647282a181bSYiFei Zhu	prompt "Enable seccomp to safely execute untrusted bytecode"
648282a181bSYiFei Zhu	def_bool y
649282a181bSYiFei Zhu	depends on HAVE_ARCH_SECCOMP
650282a181bSYiFei Zhu	help
651282a181bSYiFei Zhu	  This kernel feature is useful for number crunching applications
652282a181bSYiFei Zhu	  that may need to handle untrusted bytecode during their
653282a181bSYiFei Zhu	  execution. By using pipes or other transports made available
654282a181bSYiFei Zhu	  to the process as file descriptors supporting the read/write
655282a181bSYiFei Zhu	  syscalls, it's possible to isolate those applications in their
656282a181bSYiFei Zhu	  own address space using seccomp. Once seccomp is enabled via
657282a181bSYiFei Zhu	  prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
658282a181bSYiFei Zhu	  disabled and the task is only allowed to execute a few safe
659282a181bSYiFei Zhu	  syscalls defined by each seccomp mode.
660282a181bSYiFei Zhu
661282a181bSYiFei Zhu	  If unsure, say Y.
662282a181bSYiFei Zhu
663e2cfabdfSWill Drewryconfig SECCOMP_FILTER
664e2cfabdfSWill Drewry	def_bool y
665e2cfabdfSWill Drewry	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
666e2cfabdfSWill Drewry	help
667e2cfabdfSWill Drewry	  Enable tasks to build secure computing environments defined
668e2cfabdfSWill Drewry	  in terms of Berkeley Packet Filter programs which implement
669e2cfabdfSWill Drewry	  task-defined system call filtering polices.
670e2cfabdfSWill Drewry
6715fb94e9cSMauro Carvalho Chehab	  See Documentation/userspace-api/seccomp_filter.rst for details.
672e2cfabdfSWill Drewry
6730d8315ddSYiFei Zhuconfig SECCOMP_CACHE_DEBUG
6740d8315ddSYiFei Zhu	bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
6750d8315ddSYiFei Zhu	depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
6760d8315ddSYiFei Zhu	depends on PROC_FS
6770d8315ddSYiFei Zhu	help
6780d8315ddSYiFei Zhu	  This enables the /proc/pid/seccomp_cache interface to monitor
6790d8315ddSYiFei Zhu	  seccomp cache data. The file format is subject to change. Reading
6800d8315ddSYiFei Zhu	  the file requires CAP_SYS_ADMIN.
6810d8315ddSYiFei Zhu
6820d8315ddSYiFei Zhu	  This option is for debugging only. Enabling presents the risk that
6830d8315ddSYiFei Zhu	  an adversary may be able to infer the seccomp filter logic.
6840d8315ddSYiFei Zhu
6850d8315ddSYiFei Zhu	  If unsure, say N.
6860d8315ddSYiFei Zhu
68757fbad15SKees Cookconfig HAVE_ARCH_KSTACK_ERASE
688afaef01cSAlexander Popov	bool
689afaef01cSAlexander Popov	help
690afaef01cSAlexander Popov	  An architecture should select this if it has the code which
69157fbad15SKees Cook	  fills the used part of the kernel stack with the KSTACK_ERASE_POISON
692afaef01cSAlexander Popov	  value before returning from system calls.
693afaef01cSAlexander Popov
694d148eac0SMasahiro Yamadaconfig HAVE_STACKPROTECTOR
69519952a92SKees Cook	bool
69619952a92SKees Cook	help
69719952a92SKees Cook	  An arch should select this symbol if:
69819952a92SKees Cook	  - it has implemented a stack canary (e.g. __stack_chk_guard)
69919952a92SKees Cook
700050e9baaSLinus Torvaldsconfig STACKPROTECTOR
7012a61f474SMasahiro Yamada	bool "Stack Protector buffer overflow detection"
702d148eac0SMasahiro Yamada	depends on HAVE_STACKPROTECTOR
7032a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector)
7042a61f474SMasahiro Yamada	default y
7058779657dSKees Cook	help
7068779657dSKees Cook	  This option turns on the "stack-protector" GCC feature. This
70719952a92SKees Cook	  feature puts, at the beginning of functions, a canary value on
70819952a92SKees Cook	  the stack just before the return address, and validates
70919952a92SKees Cook	  the value just before actually returning.  Stack based buffer
71019952a92SKees Cook	  overflows (that need to overwrite this return address) now also
71119952a92SKees Cook	  overwrite the canary, which gets detected and the attack is then
71219952a92SKees Cook	  neutralized via a kernel panic.
71319952a92SKees Cook
7148779657dSKees Cook	  Functions will have the stack-protector canary logic added if they
7158779657dSKees Cook	  have an 8-byte or larger character array on the stack.
7168779657dSKees Cook
71719952a92SKees Cook	  This feature requires gcc version 4.2 or above, or a distribution
7188779657dSKees Cook	  gcc with the feature backported ("-fstack-protector").
7198779657dSKees Cook
7208779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
7218779657dSKees Cook	  about 3% of all kernel functions, which increases kernel code size
7228779657dSKees Cook	  by about 0.3%.
7238779657dSKees Cook
724050e9baaSLinus Torvaldsconfig STACKPROTECTOR_STRONG
7252a61f474SMasahiro Yamada	bool "Strong Stack Protector"
726050e9baaSLinus Torvalds	depends on STACKPROTECTOR
7272a61f474SMasahiro Yamada	depends on $(cc-option,-fstack-protector-strong)
7282a61f474SMasahiro Yamada	default y
7298779657dSKees Cook	help
7308779657dSKees Cook	  Functions will have the stack-protector canary logic added in any
7318779657dSKees Cook	  of the following conditions:
7328779657dSKees Cook
7338779657dSKees Cook	  - local variable's address used as part of the right hand side of an
7348779657dSKees Cook	    assignment or function argument
7358779657dSKees Cook	  - local variable is an array (or union containing an array),
7368779657dSKees Cook	    regardless of array type or length
7378779657dSKees Cook	  - uses register local variables
7388779657dSKees Cook
7398779657dSKees Cook	  This feature requires gcc version 4.9 or above, or a distribution
7408779657dSKees Cook	  gcc with the feature backported ("-fstack-protector-strong").
7418779657dSKees Cook
7428779657dSKees Cook	  On an x86 "defconfig" build, this feature adds canary checks to
7438779657dSKees Cook	  about 20% of all kernel functions, which increases the kernel code
7448779657dSKees Cook	  size by about 2%.
7458779657dSKees Cook
746d08b9f0cSSami Tolvanenconfig ARCH_SUPPORTS_SHADOW_CALL_STACK
747d08b9f0cSSami Tolvanen	bool
748d08b9f0cSSami Tolvanen	help
749afcf5441SDan Li	  An architecture should select this if it supports the compiler's
750afcf5441SDan Li	  Shadow Call Stack and implements runtime support for shadow stack
751aa7a65aeSWill Deacon	  switching.
752d08b9f0cSSami Tolvanen
753d08b9f0cSSami Tolvanenconfig SHADOW_CALL_STACK
754afcf5441SDan Li	bool "Shadow Call Stack"
755afcf5441SDan Li	depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
75638792972SArd Biesheuvel	depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
7576f9dc684SSamuel Holland	depends on MMU
758d08b9f0cSSami Tolvanen	help
759afcf5441SDan Li	  This option enables the compiler's Shadow Call Stack, which
760afcf5441SDan Li	  uses a shadow stack to protect function return addresses from
761afcf5441SDan Li	  being overwritten by an attacker. More information can be found
762afcf5441SDan Li	  in the compiler's documentation:
763d08b9f0cSSami Tolvanen
764afcf5441SDan Li	  - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
765afcf5441SDan Li	  - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
766d08b9f0cSSami Tolvanen
767d08b9f0cSSami Tolvanen	  Note that security guarantees in the kernel differ from the
768d08b9f0cSSami Tolvanen	  ones documented for user space. The kernel must store addresses
769d08b9f0cSSami Tolvanen	  of shadow stacks in memory, which means an attacker capable of
770d08b9f0cSSami Tolvanen	  reading and writing arbitrary memory may be able to locate them
771d08b9f0cSSami Tolvanen	  and hijack control flow by modifying the stacks.
772d08b9f0cSSami Tolvanen
7739beccca0SArd Biesheuvelconfig DYNAMIC_SCS
7749beccca0SArd Biesheuvel	bool
7759beccca0SArd Biesheuvel	help
7769beccca0SArd Biesheuvel	  Set by the arch code if it relies on code patching to insert the
7779beccca0SArd Biesheuvel	  shadow call stack push and pop instructions rather than on the
7789beccca0SArd Biesheuvel	  compiler.
7799beccca0SArd Biesheuvel
780dc5723b0SSami Tolvanenconfig LTO
781dc5723b0SSami Tolvanen	bool
782dc5723b0SSami Tolvanen	help
783dc5723b0SSami Tolvanen	  Selected if the kernel will be built using the compiler's LTO feature.
784dc5723b0SSami Tolvanen
785dc5723b0SSami Tolvanenconfig LTO_CLANG
786dc5723b0SSami Tolvanen	bool
787dc5723b0SSami Tolvanen	select LTO
788dc5723b0SSami Tolvanen	help
789dc5723b0SSami Tolvanen	  Selected if the kernel will be built using Clang's LTO feature.
790dc5723b0SSami Tolvanen
791dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG
792dc5723b0SSami Tolvanen	bool
793dc5723b0SSami Tolvanen	help
794dc5723b0SSami Tolvanen	  An architecture should select this option if it supports:
795dc5723b0SSami Tolvanen	  - compiling with Clang,
796dc5723b0SSami Tolvanen	  - compiling inline assembly with Clang's integrated assembler,
797dc5723b0SSami Tolvanen	  - and linking with LLD.
798dc5723b0SSami Tolvanen
799dc5723b0SSami Tolvanenconfig ARCH_SUPPORTS_LTO_CLANG_THIN
800dc5723b0SSami Tolvanen	bool
801dc5723b0SSami Tolvanen	help
802dc5723b0SSami Tolvanen	  An architecture should select this option if it can support Clang's
803dc5723b0SSami Tolvanen	  ThinLTO mode.
804dc5723b0SSami Tolvanen
805dc5723b0SSami Tolvanenconfig HAS_LTO_CLANG
806dc5723b0SSami Tolvanen	def_bool y
8071e68a8afSNathan Chancellor	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
808dc5723b0SSami Tolvanen	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
809dc5723b0SSami Tolvanen	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
810dc5723b0SSami Tolvanen	depends on ARCH_SUPPORTS_LTO_CLANG
811dc5723b0SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
812349fde59SJakob Koschel	# https://github.com/ClangBuiltLinux/linux/issues/1721
813349fde59SJakob Koschel	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
814349fde59SJakob Koschel	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
815dc5723b0SSami Tolvanen	depends on !GCOV_KERNEL
816dc5723b0SSami Tolvanen	help
817dc5723b0SSami Tolvanen	  The compiler and Kconfig options support building with Clang's
818dc5723b0SSami Tolvanen	  LTO.
819dc5723b0SSami Tolvanen
820dc5723b0SSami Tolvanenchoice
821dc5723b0SSami Tolvanen	prompt "Link Time Optimization (LTO)"
822dc5723b0SSami Tolvanen	default LTO_NONE
823dc5723b0SSami Tolvanen	help
824dc5723b0SSami Tolvanen	  This option enables Link Time Optimization (LTO), which allows the
825dc5723b0SSami Tolvanen	  compiler to optimize binaries globally.
826dc5723b0SSami Tolvanen
827dc5723b0SSami Tolvanen	  If unsure, select LTO_NONE. Note that LTO is very resource-intensive
828dc5723b0SSami Tolvanen	  so it's disabled by default.
829dc5723b0SSami Tolvanen
830dc5723b0SSami Tolvanenconfig LTO_NONE
831dc5723b0SSami Tolvanen	bool "None"
832dc5723b0SSami Tolvanen	help
833dc5723b0SSami Tolvanen	  Build the kernel normally, without Link Time Optimization (LTO).
834dc5723b0SSami Tolvanen
835dc5723b0SSami Tolvanenconfig LTO_CLANG_FULL
836dc5723b0SSami Tolvanen	bool "Clang Full LTO (EXPERIMENTAL)"
837dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG
838dc5723b0SSami Tolvanen	depends on !COMPILE_TEST
839dc5723b0SSami Tolvanen	select LTO_CLANG
840dc5723b0SSami Tolvanen	help
841dc5723b0SSami Tolvanen	  This option enables Clang's full Link Time Optimization (LTO), which
842dc5723b0SSami Tolvanen	  allows the compiler to optimize the kernel globally. If you enable
843dc5723b0SSami Tolvanen	  this option, the compiler generates LLVM bitcode instead of ELF
844dc5723b0SSami Tolvanen	  object files, and the actual compilation from bitcode happens at
845dc5723b0SSami Tolvanen	  the LTO link step, which may take several minutes depending on the
846dc5723b0SSami Tolvanen	  kernel configuration. More information can be found from LLVM's
847dc5723b0SSami Tolvanen	  documentation:
848dc5723b0SSami Tolvanen
849dc5723b0SSami Tolvanen	    https://llvm.org/docs/LinkTimeOptimization.html
850dc5723b0SSami Tolvanen
851dc5723b0SSami Tolvanen	  During link time, this option can use a large amount of RAM, and
852dc5723b0SSami Tolvanen	  may take much longer than the ThinLTO option.
853dc5723b0SSami Tolvanen
854dc5723b0SSami Tolvanenconfig LTO_CLANG_THIN
855dc5723b0SSami Tolvanen	bool "Clang ThinLTO (EXPERIMENTAL)"
856dc5723b0SSami Tolvanen	depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
857dc5723b0SSami Tolvanen	select LTO_CLANG
858dc5723b0SSami Tolvanen	help
859dc5723b0SSami Tolvanen	  This option enables Clang's ThinLTO, which allows for parallel
860dc5723b0SSami Tolvanen	  optimization and faster incremental compiles compared to the
861dc5723b0SSami Tolvanen	  CONFIG_LTO_CLANG_FULL option. More information can be found
862dc5723b0SSami Tolvanen	  from Clang's documentation:
863dc5723b0SSami Tolvanen
864dc5723b0SSami Tolvanen	    https://clang.llvm.org/docs/ThinLTO.html
865dc5723b0SSami Tolvanen
866dc5723b0SSami Tolvanen	  If unsure, say Y.
867dc5723b0SSami Tolvanenendchoice
868dc5723b0SSami Tolvanen
869315ad878SRong Xuconfig ARCH_SUPPORTS_AUTOFDO_CLANG
870315ad878SRong Xu	bool
871315ad878SRong Xu
872315ad878SRong Xuconfig AUTOFDO_CLANG
873315ad878SRong Xu	bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
874315ad878SRong Xu	depends on ARCH_SUPPORTS_AUTOFDO_CLANG
875315ad878SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 170000
876315ad878SRong Xu	help
877315ad878SRong Xu	  This option enables Clang’s AutoFDO build. When
878315ad878SRong Xu	  an AutoFDO profile is specified in variable
879315ad878SRong Xu	  CLANG_AUTOFDO_PROFILE during the build process,
880315ad878SRong Xu	  Clang uses the profile to optimize the kernel.
881315ad878SRong Xu
882315ad878SRong Xu	  If no profile is specified, AutoFDO options are
883315ad878SRong Xu	  still passed to Clang to facilitate the collection
884315ad878SRong Xu	  of perf data for creating an AutoFDO profile in
885315ad878SRong Xu	  subsequent builds.
886315ad878SRong Xu
887315ad878SRong Xu	  If unsure, say N.
888315ad878SRong Xu
889d5dc9583SRong Xuconfig ARCH_SUPPORTS_PROPELLER_CLANG
890d5dc9583SRong Xu	bool
891d5dc9583SRong Xu
892d5dc9583SRong Xuconfig PROPELLER_CLANG
893d5dc9583SRong Xu	bool "Enable Clang's Propeller build"
894d5dc9583SRong Xu	depends on ARCH_SUPPORTS_PROPELLER_CLANG
895d5dc9583SRong Xu	depends on CC_IS_CLANG && CLANG_VERSION >= 190000
896d5dc9583SRong Xu	help
897d5dc9583SRong Xu	  This option enables Clang’s Propeller build. When the Propeller
898d5dc9583SRong Xu	  profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX
899d5dc9583SRong Xu	  during the build process, Clang uses the profiles to optimize
900d5dc9583SRong Xu	  the kernel.
901d5dc9583SRong Xu
902d5dc9583SRong Xu	  If no profile is specified, Propeller options are still passed
903d5dc9583SRong Xu	  to Clang to facilitate the collection of perf data for creating
904d5dc9583SRong Xu	  the Propeller profiles in subsequent builds.
905d5dc9583SRong Xu
906d5dc9583SRong Xu	  If unsure, say N.
907d5dc9583SRong Xu
90823ef9d43SKees Cookconfig ARCH_SUPPORTS_CFI
909cf68fffbSSami Tolvanen	bool
910cf68fffbSSami Tolvanen	help
91123ef9d43SKees Cook	  An architecture should select this option if it can support Kernel
91223ef9d43SKees Cook	  Control-Flow Integrity (CFI) checking (-fsanitize=kcfi).
913cf68fffbSSami Tolvanen
91489245600SSami Tolvanenconfig ARCH_USES_CFI_TRAPS
91589245600SSami Tolvanen	bool
91623ef9d43SKees Cook	help
91723ef9d43SKees Cook	  An architecture should select this option if it requires the
91823ef9d43SKees Cook	  .kcfi_traps section for KCFI trap handling.
91989245600SSami Tolvanen
920*39c89ee6SNathan Chancellorconfig ARCH_USES_CFI_GENERIC_LLVM_PASS
921*39c89ee6SNathan Chancellor	bool
922*39c89ee6SNathan Chancellor	help
923*39c89ee6SNathan Chancellor	  An architecture should select this option if it uses the generic
924*39c89ee6SNathan Chancellor	  KCFIPass in LLVM to expand kCFI bundles instead of architecture-specific
925*39c89ee6SNathan Chancellor	  lowering.
926*39c89ee6SNathan Chancellor
92723ef9d43SKees Cookconfig CFI
92823ef9d43SKees Cook	bool "Use Kernel Control Flow Integrity (kCFI)"
92923ef9d43SKees Cook	default CFI_CLANG
93023ef9d43SKees Cook	depends on ARCH_SUPPORTS_CFI
93189245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
932cf68fffbSSami Tolvanen	help
93323ef9d43SKees Cook	  This option enables forward-edge Control Flow Integrity (CFI)
93423ef9d43SKees Cook	  checking, where the compiler injects a runtime check to each
935cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
936cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
937cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
938cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
939cf68fffbSSami Tolvanen	  found from Clang's documentation:
940cf68fffbSSami Tolvanen
941cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
942cf68fffbSSami Tolvanen
94323ef9d43SKees Cookconfig CFI_CLANG
94423ef9d43SKees Cook	bool
94523ef9d43SKees Cook	transitional
94623ef9d43SKees Cook	help
94723ef9d43SKees Cook	  Transitional config for CFI_CLANG to CFI migration.
94823ef9d43SKees Cook
949ce4a2620SAlice Ryhlconfig CFI_ICALL_NORMALIZE_INTEGERS
950ce4a2620SAlice Ryhl	bool "Normalize CFI tags for integers"
95123ef9d43SKees Cook	depends on CFI
95223ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
953ce4a2620SAlice Ryhl	help
954ce4a2620SAlice Ryhl	  This option normalizes the CFI tags for integer types so that all
955ce4a2620SAlice Ryhl	  integer types of the same size and signedness receive the same CFI
956ce4a2620SAlice Ryhl	  tag.
957ce4a2620SAlice Ryhl
958ce4a2620SAlice Ryhl	  The option is separate from CONFIG_RUST because it affects the ABI.
959ce4a2620SAlice Ryhl	  When working with build systems that care about the ABI, it is
960ce4a2620SAlice Ryhl	  convenient to be able to turn on this flag first, before Rust is
961ce4a2620SAlice Ryhl	  turned on.
962ce4a2620SAlice Ryhl
963ce4a2620SAlice Ryhl	  This option is necessary for using CFI with Rust. If unsure, say N.
964ce4a2620SAlice Ryhl
96523ef9d43SKees Cookconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9668b8ca9c2SAlice Ryhl	def_bool y
9674c66f830SAlice Ryhl	depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
9688b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
9692313ab74SAlice Ryhl	depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9704c66f830SAlice Ryhl
9718b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
9728b8ca9c2SAlice Ryhl	def_bool y
97323ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9748b8ca9c2SAlice Ryhl	depends on RUSTC_VERSION >= 107900
975812258ffSConor Dooley	depends on ARM64 || X86_64
9768b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
9772313ab74SAlice Ryhl	depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
9788b8ca9c2SAlice Ryhl		(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9794c66f830SAlice Ryhl
980cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
981cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
98223ef9d43SKees Cook	depends on CFI
983cf68fffbSSami Tolvanen	help
984cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
985cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
986cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
987cf68fffbSSami Tolvanen
988cf68fffbSSami Tolvanen	  If unsure, say N.
989cf68fffbSSami Tolvanen
9900f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
9910f60a8efSKees Cook	bool
9920f60a8efSKees Cook	help
9930f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
9940f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
9950f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
9960f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
9970f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
9980f60a8efSKees Cook
99924a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
10002b1d5024SFrederic Weisbecker	bool
10012b1d5024SFrederic Weisbecker	help
100291d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
100391d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
1004490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
1005490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
1006490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
10076f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
1008490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
1009490f561bSFrederic Weisbecker
101024a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
101183c2da2eSFrederic Weisbecker	bool
101283c2da2eSFrederic Weisbecker	help
101383c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
101483c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
101583c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
1016d65d411cSValentin Schneider	  while context tracking is CT_STATE_USER. This feature reflects a sane
101783c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
101883c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
101983c2da2eSFrederic Weisbecker
102083c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
102183c2da2eSFrederic Weisbecker	    not interruptible).
1022493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
102383c2da2eSFrederic Weisbecker	    got called.
102483c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
102583c2da2eSFrederic Weisbecker	    called.
102683c2da2eSFrederic Weisbecker
1027490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
1028490f561bSFrederic Weisbecker	bool
1029490f561bSFrederic Weisbecker	help
1030490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
1031490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
10322b1d5024SFrederic Weisbecker
1033b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
1034b952741cSFrederic Weisbecker	bool
1035b952741cSFrederic Weisbecker
10362b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
10372b91ec9fSFrederic Weisbecker	bool
10382b91ec9fSFrederic Weisbecker	help
10392b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
10402b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
10412b91ec9fSFrederic Weisbecker
104240565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
104340565b5aSStanislaw Gruszka	bool
104440565b5aSStanislaw Gruszka
1045554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
1046554b0004SKevin Hilman	bool
1047554b0004SKevin Hilman	default y if 64BIT
1048554b0004SKevin Hilman	help
1049554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
1050554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
1051554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
1052554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
1053554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
1054554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
1055554b0004SKevin Hilman
1056fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
1057fdf9c356SFrederic Weisbecker	bool
1058fdf9c356SFrederic Weisbecker	help
1059fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
1060fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
1061fdf9c356SFrederic Weisbecker
1062c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
1063c49dd340SKalesh Singh	bool
1064c49dd340SKalesh Singh	help
1065c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
1066c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
1067c49dd340SKalesh Singh	  happens at the PGD level.
1068c49dd340SKalesh Singh
10692c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
10702c91bd4aSJoel Fernandes (Google)	bool
10712c91bd4aSJoel Fernandes (Google)	help
10722c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
10732c91bd4aSJoel Fernandes (Google)
107415626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
107515626062SGerald Schaefer	bool
107615626062SGerald Schaefer
1077a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
1078a00cc7d9SMatthew Wilcox	bool
1079a00cc7d9SMatthew Wilcox
10800ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
10810ddab1d2SToshi Kani	bool
10820ddab1d2SToshi Kani
1083121e6f32SNicholas Piggin#
1084121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
1085559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
1086559089e0SSong Liu#  must be used to enable allocations to use hugepages.
1087121e6f32SNicholas Piggin#
1088121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
1089121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
1090121e6f32SNicholas Piggin	bool
1091121e6f32SNicholas Piggin
10923876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
10933876d4a3SAlexandre Ghiti	bool
10943876d4a3SAlexandre Ghiti
10952f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
10962f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
10972f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
10982f0584f3SRick Edgecombe	bool
10992f0584f3SRick Edgecombe
11002f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
11012f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
11022f0584f3SRick Edgecombe
11030f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
11040f8975ecSPavel Emelyanov	bool
11050f8975ecSPavel Emelyanov
1106786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
1107786d35d4SDavid Howells	bool
1108786d35d4SDavid Howells	help
1109786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
1110786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
1111786d35d4SDavid Howells	  should not enable this.
1112786d35d4SDavid Howells
1113786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
1114786d35d4SDavid Howells	bool
1115786d35d4SDavid Howells	help
1116786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
1117786d35d4SDavid Howells	  relocations will give an error.
1118786d35d4SDavid Howells
1119786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
1120786d35d4SDavid Howells	bool
1121786d35d4SDavid Howells	help
1122786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
1123786d35d4SDavid Howells	  relocations will give an error.
1124786d35d4SDavid Howells
112501dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
112601dc0386SChristophe Leroy	bool
112701dc0386SChristophe Leroy	help
112801dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
112901dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
113001dc0386SChristophe Leroy
1131223b5e57SMike Rapoport (IBM)config ARCH_WANTS_EXECMEM_LATE
1132223b5e57SMike Rapoport (IBM)	bool
1133223b5e57SMike Rapoport (IBM)	help
1134223b5e57SMike Rapoport (IBM)	  For architectures that do not allocate executable memory early on
1135223b5e57SMike Rapoport (IBM)	  boot, but rather require its initialization late when there is
1136223b5e57SMike Rapoport (IBM)	  enough entropy for module space randomization, for instance
1137223b5e57SMike Rapoport (IBM)	  arm64.
1138223b5e57SMike Rapoport (IBM)
11392e45474aSMike Rapoport (Microsoft)config ARCH_HAS_EXECMEM_ROX
11402e45474aSMike Rapoport (Microsoft)	bool
11412e45474aSMike Rapoport (Microsoft)	depends on MMU && !HIGHMEM
11422e45474aSMike Rapoport (Microsoft)	help
11432e45474aSMike Rapoport (Microsoft)	  For architectures that support allocations of executable memory
11442e45474aSMike Rapoport (Microsoft)	  with read-only execute permissions. Architecture must implement
11452e45474aSMike Rapoport (Microsoft)	  execmem_fill_trapping_insns() callback to enable this.
11462e45474aSMike Rapoport (Microsoft)
1147cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
1148cc1f0274SFrederic Weisbecker	bool
1149cc1f0274SFrederic Weisbecker	help
1150cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
1151cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
1152cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
1153cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
1154cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
1155cc1f0274SFrederic Weisbecker	  processing.
1156cc1f0274SFrederic Weisbecker
1157cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
1158cd1a41ceSThomas Gleixner	bool
1159cd1a41ceSThomas Gleixner	help
1160cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
1161c226bc3cSColin Ian King	  separate stack.
1162cd1a41ceSThomas Gleixner
11638cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
11648cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
11658cbb2b50SSebastian Andrzej Siewior
116612700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
116712700c17SArnd Bergmann	bool
116812700c17SArnd Bergmann	help
116912700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
117012700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
117112700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
117212700c17SArnd Bergmann
1173235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
1174235a8f02SKirill A. Shutemov	int
1175235a8f02SKirill A. Shutemov	default 2
1176235a8f02SKirill A. Shutemov
11772b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
11782b68f6caSKees Cook	bool
11792b68f6caSKees Cook	help
11802b68f6caSKees Cook	  An architecture supports choosing randomized locations for
11812b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
11822b68f6caSKees Cook	  - arch_mmap_rnd()
1183204db6edSKees Cook	  - arch_randomize_brk()
11842b68f6caSKees Cook
1185d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1186d07e2259SDaniel Cashman	bool
1187d07e2259SDaniel Cashman	help
1188d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1189d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1190d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1191d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1192d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1193d07e2259SDaniel Cashman
11945f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
11955f56a5dfSJiri Slaby	bool
11965f56a5dfSJiri Slaby	help
11975f56a5dfSJiri Slaby	  An architecture implements exit_thread.
11985f56a5dfSJiri Slaby
1199d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1200d07e2259SDaniel Cashman	int
1201d07e2259SDaniel Cashman
1202d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1203d07e2259SDaniel Cashman	int
1204d07e2259SDaniel Cashman
1205d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1206d07e2259SDaniel Cashman	int
1207d07e2259SDaniel Cashman
1208d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1209d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1210d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1211d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1212d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1213d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1214d07e2259SDaniel Cashman	help
1215d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1216d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1217d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1218d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1219d07e2259SDaniel Cashman
1220d07e2259SDaniel Cashman	  This value can be changed after boot using the
1221d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1222d07e2259SDaniel Cashman
1223d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1224d07e2259SDaniel Cashman	bool
1225d07e2259SDaniel Cashman	help
1226d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1227d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1228d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1229d07e2259SDaniel Cashman	  enabled and provides values for both:
1230d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1231d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1232d07e2259SDaniel Cashman
1233d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1234d07e2259SDaniel Cashman	int
1235d07e2259SDaniel Cashman
1236d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1237d07e2259SDaniel Cashman	int
1238d07e2259SDaniel Cashman
1239d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1240d07e2259SDaniel Cashman	int
1241d07e2259SDaniel Cashman
1242d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1243d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1244d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1245d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1246d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1247d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1248d07e2259SDaniel Cashman	help
1249d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1250d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1251d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1252d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1253d07e2259SDaniel Cashman	  supported values.
1254d07e2259SDaniel Cashman
1255d07e2259SDaniel Cashman	  This value can be changed after boot using the
1256d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1257d07e2259SDaniel Cashman
12581b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
12591b028f78SDmitry Safonov	bool
12601b028f78SDmitry Safonov	help
12611b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
12621b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
12631b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
12641b028f78SDmitry Safonov
1265ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1266ba89f9c8SArnd Bergmann	bool
1267ba89f9c8SArnd Bergmann
1268ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1269ba89f9c8SArnd Bergmann	bool
1270ba89f9c8SArnd Bergmann
1271ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1272ba89f9c8SArnd Bergmann	bool
1273ba89f9c8SArnd Bergmann
1274ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1275ba89f9c8SArnd Bergmann	bool
1276ba89f9c8SArnd Bergmann
1277ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1278ba89f9c8SArnd Bergmann	bool
1279ba89f9c8SArnd Bergmann
1280ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1281ba89f9c8SArnd Bergmann	bool
1282ba89f9c8SArnd Bergmann
1283ba89f9c8SArnd Bergmannchoice
1284ba89f9c8SArnd Bergmann	prompt "MMU page size"
1285ba89f9c8SArnd Bergmann
1286ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1287ba89f9c8SArnd Bergmann	bool "4KiB pages"
1288ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1289ba89f9c8SArnd Bergmann	help
1290ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1291ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1292ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1293ba89f9c8SArnd Bergmann	  memory systems.
1294ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1295ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1296ba89f9c8SArnd Bergmann
1297ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1298ba89f9c8SArnd Bergmann	bool "8KiB pages"
1299ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1300ba89f9c8SArnd Bergmann	help
1301ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1302ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1303ba89f9c8SArnd Bergmann
1304ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1305ba89f9c8SArnd Bergmann	bool "16KiB pages"
1306ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1307ba89f9c8SArnd Bergmann	help
1308ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1309ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1310ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1311ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1312ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1313ba89f9c8SArnd Bergmann	  page cache.
1314ba89f9c8SArnd Bergmann
1315ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1316ba89f9c8SArnd Bergmann	bool "32KiB pages"
1317ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1318ba89f9c8SArnd Bergmann	help
1319ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1320ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1321ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1322ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1323ba89f9c8SArnd Bergmann	  support this.
1324ba89f9c8SArnd Bergmann
1325ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1326ba89f9c8SArnd Bergmann	bool "64KiB pages"
1327ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1328ba89f9c8SArnd Bergmann	help
1329ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1330ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1331ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1332ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1333ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1334ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1335ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1336ba89f9c8SArnd Bergmann
1337ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1338ba89f9c8SArnd Bergmann	bool "256KiB pages"
1339ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1340ba89f9c8SArnd Bergmann	help
1341ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1342ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1343ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1344ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1345ba89f9c8SArnd Bergmann
1346ba89f9c8SArnd Bergmannendchoice
1347ba89f9c8SArnd Bergmann
13481f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
13491f0e290cSGuenter Roeck	def_bool y
13501f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1351e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1352e4bbd20dSNathan Chancellor
1353e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1354e4bbd20dSNathan Chancellor	def_bool y
13551f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
13561f0e290cSGuenter Roeck
1357ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1358ba89f9c8SArnd Bergmann	int
1359ba89f9c8SArnd Bergmann	default	12 if PAGE_SIZE_4KB
1360ba89f9c8SArnd Bergmann	default	13 if PAGE_SIZE_8KB
1361ba89f9c8SArnd Bergmann	default	14 if PAGE_SIZE_16KB
1362ba89f9c8SArnd Bergmann	default	15 if PAGE_SIZE_32KB
1363ba89f9c8SArnd Bergmann	default	16 if PAGE_SIZE_64KB
1364ba89f9c8SArnd Bergmann	default	18 if PAGE_SIZE_256KB
1365ba89f9c8SArnd Bergmann
136667f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
136767f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
136867f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
136967f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
137067f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
137167f3977fSAlexandre Ghiti# - STACK_RND_MASK
137267f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
137367f3977fSAlexandre Ghiti	bool
137467f3977fSAlexandre Ghiti	depends on MMU
1375e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
137667f3977fSAlexandre Ghiti
137703f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
137803f16cd0SJosh Poimboeuf	bool
137903f16cd0SJosh Poimboeuf
13804ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
13814ab7674fSJosh Poimboeuf	bool
13824ab7674fSJosh Poimboeuf
138322102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
138422102f45SJosh Poimboeuf	bool
138522102f45SJosh Poimboeuf
1386489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1387489e355bSJosh Poimboeuf	bool
1388489e355bSJosh Poimboeuf
13895f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
13905f3da8c0SJosh Poimboeuf	bool
13915f3da8c0SJosh Poimboeuf	select OBJTOOL
13925f3da8c0SJosh Poimboeuf
1393b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1394b9ab5ebbSJosh Poimboeuf	bool
1395b9ab5ebbSJosh Poimboeuf	help
139603f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
139703f16cd0SJosh Poimboeuf	  validation.
1398b9ab5ebbSJosh Poimboeuf
1399af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1400af085d90SJosh Poimboeuf	bool
1401af085d90SJosh Poimboeuf	help
1402140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1403140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1404140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1405af085d90SJosh Poimboeuf
1406468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1407468a9428SGeorge Spelvin	bool
1408468a9428SGeorge Spelvin	default n
1409468a9428SGeorge Spelvin	help
1410468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1411468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1412468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1413468a9428SGeorge Spelvin
1414666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1415666047feSFinn Thain	bool
1416666047feSFinn Thain
14173a495511SWilliam Breathitt Grayconfig ISA_BUS_API
14183a495511SWilliam Breathitt Gray	def_bool ISA
14193a495511SWilliam Breathitt Gray
1420d2125043SAl Viro#
1421d2125043SAl Viro# ABI hall of shame
1422d2125043SAl Viro#
1423d2125043SAl Viroconfig CLONE_BACKWARDS
1424d2125043SAl Viro	bool
1425d2125043SAl Viro	help
1426d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1427d2125043SAl Viro	  not the 5th one.
1428d2125043SAl Viro
1429d2125043SAl Viroconfig CLONE_BACKWARDS2
1430d2125043SAl Viro	bool
1431d2125043SAl Viro	help
1432d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1433d2125043SAl Viro
1434dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1435dfa9771aSMichal Simek	bool
1436dfa9771aSMichal Simek	help
1437dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1438dfa9771aSMichal Simek	  not the 5th one.
1439dfa9771aSMichal Simek
1440eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1441eaca6eaeSAl Viro	bool
1442eaca6eaeSAl Viro	help
1443eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1444eaca6eaeSAl Viro
14450a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
14460a0e8cdfSAl Viro	bool
14470a0e8cdfSAl Viro	help
14480a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
14490a0e8cdfSAl Viro
14500a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
14510a0e8cdfSAl Viro	bool
14520a0e8cdfSAl Viro	help
14530a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
14540a0e8cdfSAl Viro
1455495dfbf7SAl Viroconfig OLD_SIGACTION
1456495dfbf7SAl Viro	bool
1457495dfbf7SAl Viro	help
1458495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1459495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1460495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1461495dfbf7SAl Viro	  compatibility...
1462495dfbf7SAl Viro
1463495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1464495dfbf7SAl Viro	bool
1465495dfbf7SAl Viro
146617435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1467942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1468942437c9SArnd Bergmann	default !64BIT || COMPAT
146917435e5fSDeepa Dinamani	help
147017435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
147117435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
147217435e5fSDeepa Dinamani	  as part of compat syscall handling.
147317435e5fSDeepa Dinamani
147487a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
147587a4c375SChristoph Hellwig	bool
147687a4c375SChristoph Hellwig
1477a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1478a50a3f4bSThomas Gleixner	bool
1479a50a3f4bSThomas Gleixner
1480fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1481fff7fb0bSZhaoxiu Zeng	def_bool n
1482fff7fb0bSZhaoxiu Zeng
1483ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1484ba14a194SAndy Lutomirski	def_bool n
1485ba14a194SAndy Lutomirski	help
1486ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1487ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1488ba14a194SAndy Lutomirski
1489ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1490ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1491ba14a194SAndy Lutomirski
1492ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1493ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1494ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1495ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1496ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1497ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1498ba14a194SAndy Lutomirski
1499ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1500ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1501ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1502ba14a194SAndy Lutomirski
1503ba14a194SAndy Lutomirskiconfig VMAP_STACK
1504ba14a194SAndy Lutomirski	default y
1505ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1506eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
150738dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1508a7f7f624SMasahiro Yamada	help
1509ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1510ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1511ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1512ba14a194SAndy Lutomirski	  corruption.
1513ba14a194SAndy Lutomirski
151438dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
151538dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
151638dd767dSAndrey Konovalov	  must be enabled.
1517ba14a194SAndy Lutomirski
151839218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
151939218ff4SKees Cook	def_bool n
152039218ff4SKees Cook	help
152139218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
152239218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
152339218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
152439218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
152539218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
152639218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
152739218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
152839218ff4SKees Cook	  of the static branch state.
152939218ff4SKees Cook
15308cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
15318cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
15328cb37a59SMarco Elver	default y
153339218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
153439218ff4SKees Cook	help
153539218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
153639218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
153739218ff4SKees Cook	  attacks that depend on stack address determinism or
15388cb37a59SMarco Elver	  cross-syscall address exposures.
15398cb37a59SMarco Elver
15408cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
15418cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
15428cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
15438cb37a59SMarco Elver
15448cb37a59SMarco Elver	  If unsure, say Y.
15458cb37a59SMarco Elver
15468cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
15478cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
15488cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
15498cb37a59SMarco Elver	help
15508cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
15518cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
15528cb37a59SMarco Elver	  boot state.
155339218ff4SKees Cook
1554ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1555ad21fc4fSLaura Abbott	def_bool n
1556ad21fc4fSLaura Abbott
1557ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1558ad21fc4fSLaura Abbott	def_bool n
1559ad21fc4fSLaura Abbott
1560ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1561ad21fc4fSLaura Abbott	def_bool n
1562ad21fc4fSLaura Abbott
15630f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1564ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1565ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1566ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1567ad21fc4fSLaura Abbott	help
1568ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1569ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1570ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1571ad21fc4fSLaura Abbott	  or modifying text)
1572ad21fc4fSLaura Abbott
1573ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1574ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1575ad21fc4fSLaura Abbott
1576ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1577ad21fc4fSLaura Abbott	def_bool n
1578ad21fc4fSLaura Abbott
15790f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1580ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1581ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1582ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1583ad21fc4fSLaura Abbott	help
1584ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1585ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1586ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1587ad21fc4fSLaura Abbott
1588ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1589ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1590ea8c64acSChristoph Hellwig	bool
1591ea8c64acSChristoph Hellwig
1592bff70402SJames Morseconfig ARCH_HAS_CPU_RESCTRL
1593bff70402SJames Morse	bool
1594bff70402SJames Morse	help
1595bff70402SJames Morse	  An architecture selects this option to indicate that the necessary
1596bff70402SJames Morse	  hooks are provided to support the common memory system usage
1597bff70402SJames Morse	  monitoring and control interfaces provided by the 'resctrl'
1598bff70402SJames Morse	  filesystem (see RESCTRL_FS).
1599bff70402SJames Morse
160004f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
160104f264d3SPaul Burton	bool
160204f264d3SPaul Burton	help
160304f264d3SPaul Burton	  An architecture can select this if it provides an
160404f264d3SPaul Burton	  asm/compiler.h header that should be included after
160504f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
160604f264d3SPaul Burton	  headers generally provide.
160704f264d3SPaul Burton
1608e419ddeaSGreg Ungererconfig HAVE_ARCH_LIBGCC_H
1609e419ddeaSGreg Ungerer	bool
1610e419ddeaSGreg Ungerer	help
1611e419ddeaSGreg Ungerer	  An architecture can select this if it provides an
1612e419ddeaSGreg Ungerer	  asm/libgcc.h header that should be included after
1613e419ddeaSGreg Ungerer	  linux/libgcc.h in order to override macro definitions that
1614e419ddeaSGreg Ungerer	  header generally provides.
1615e419ddeaSGreg Ungerer
1616271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1617271ca788SArd Biesheuvel	bool
1618271ca788SArd Biesheuvel	help
1619271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1620271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1621271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1622271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1623271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1624271ca788SArd Biesheuvel	  kernels.
1625271ca788SArd Biesheuvel
1626ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1627ce9084baSArd Biesheuvel	bool
1628ce9084baSArd Biesheuvel
1629fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1630fb346fd9SWaiman Long	bool "Locking event counts collection"
1631fb346fd9SWaiman Long	depends on DEBUG_FS
1632a7f7f624SMasahiro Yamada	help
1633fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1634fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1635fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1636fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1637fb346fd9SWaiman Long
16385cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
16395cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
16405cf896fbSPeter Collingbourne	bool
16415cf896fbSPeter Collingbourne
16425cf896fbSPeter Collingbourneconfig RELR
16435cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
16445cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
16455cf896fbSPeter Collingbourne	default y
16465cf896fbSPeter Collingbourne	help
16475cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
16485cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
16495cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
16505cf896fbSPeter Collingbourne	  are compatible).
16515cf896fbSPeter Collingbourne
16520c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
16530c9c1d56SThiago Jung Bauermann	bool
16540c9c1d56SThiago Jung Bauermann
165546b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
165646b49b12STom Lendacky	bool
165746b49b12STom Lendacky
16580e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
16590e242208SHassan Naveed	bool
16600e242208SHassan Naveed	help
16610e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
16620e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
16630e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
16640e242208SHassan Naveed	  related optimizations for a given architecture.
16650e242208SHassan Naveed
1666365841e1SThomas Weißschuhconfig ARCH_HAS_VDSO_ARCH_DATA
16677b338f6dSThomas Weißschuh	depends on HAVE_GENERIC_VDSO
1668365841e1SThomas Weißschuh	bool
1669365841e1SThomas Weißschuh
1670a812eee0SNam Caoconfig ARCH_HAS_VDSO_TIME_DATA
1671d60d7de3SSven Schnelle	bool
1672d60d7de3SSven Schnelle
1673115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1674115284d8SJosh Poimboeuf	bool
1675115284d8SJosh Poimboeuf
16769183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
16779183c3f9SJosh Poimboeuf	bool
16789183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
167903f16cd0SJosh Poimboeuf	select OBJTOOL
16809183c3f9SJosh Poimboeuf
16816ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
16826ef869e0SMichal Hocko	bool
168399cf983cSMark Rutland
168499cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
168599cf983cSMark Rutland	bool
16866ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
168799cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
16886ef869e0SMichal Hocko	help
168999cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
169099cf983cSMark Rutland	  model being selected at boot time using static calls.
169199cf983cSMark Rutland
169299cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
169399cf983cSMark Rutland	  preemption function will be patched directly.
169499cf983cSMark Rutland
169599cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
169699cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
169799cf983cSMark Rutland	  trampoline will be patched.
169899cf983cSMark Rutland
169999cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
170099cf983cSMark Rutland	  overhead.
170199cf983cSMark Rutland
170299cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
170399cf983cSMark Rutland	bool
1704a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
170599cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
170699cf983cSMark Rutland	help
170799cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
170899cf983cSMark Rutland	  model being selected at boot time using static keys.
170999cf983cSMark Rutland
171099cf983cSMark Rutland	  Each preemption function will be given an early return based on a
171199cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
171299cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
171399cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
171499cf983cSMark Rutland	  integrate better with CFI schemes.
171599cf983cSMark Rutland
171699cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
171799cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
17186ef869e0SMichal Hocko
171959612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
172059612b24SNathan Chancellor	bool
172159612b24SNathan Chancellor	help
172259612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
172359612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
172459612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
172559612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
172659612b24SNathan Chancellor	  versions.
172759612b24SNathan Chancellor
17284f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
17294f5b0c17SMike Rapoport	bool
17304f5b0c17SMike Rapoport
17315d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
17325d6ad668SMike Rapoport	bool
17335d6ad668SMike Rapoport
1734df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1735df4e817bSPasha Tatashin	bool
1736df4e817bSPasha Tatashin
17372ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
17382ca408d9SBrian Gerst	bool
17392ca408d9SBrian Gerst	help
17402ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
17412ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
17422ca408d9SBrian Gerst
17437facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
17447facdc42SAl Viro	bool
17457facdc42SAl Viro
174658e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
174758e106e7SBalbir Singh	bool
174858e106e7SBalbir Singh
1749d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1750d593d64fSPrasad Sodagudi	bool
1751d593d64fSPrasad Sodagudi
17521bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
17531bdda24cSThomas Gleixner	bool
17541bdda24cSThomas Gleixner
175550468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
175650468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
175750468e43SJarkko Sakkinen	bool
175850468e43SJarkko Sakkinen
175971ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
176071ce1ab5SKinsey Ho	bool
176171ce1ab5SKinsey Ho	help
176271ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
176371ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
176471ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
176571ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
176671ce1ab5SKinsey Ho
1767eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1768eed9a328SYu Zhao	bool
1769eed9a328SYu Zhao	help
1770eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1771eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1772eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1773eed9a328SYu Zhao	  may use this capability to reduce their search space.
1774eed9a328SYu Zhao
17756cbd1d6dSSamuel Hollandconfig ARCH_HAS_KERNEL_FPU_SUPPORT
17766cbd1d6dSSamuel Holland	bool
17776cbd1d6dSSamuel Holland	help
17786cbd1d6dSSamuel Holland	  Architectures that select this option can run floating-point code in
17796cbd1d6dSSamuel Holland	  the kernel, as described in Documentation/core-api/floating-point.rst.
17806cbd1d6dSSamuel Holland
17819b400d17SArd Biesheuvelconfig ARCH_VMLINUX_NEEDS_RELOCS
17829b400d17SArd Biesheuvel	bool
17839b400d17SArd Biesheuvel	help
17849b400d17SArd Biesheuvel	  Whether the architecture needs vmlinux to be built with static
17859b400d17SArd Biesheuvel	  relocations preserved. This is used by some architectures to
17869b400d17SArd Biesheuvel	  construct bespoke relocation tables for KASLR.
17879b400d17SArd Biesheuvel
178829589343SThomas Gleixner# Select if architecture uses the common generic TIF bits
178929589343SThomas Gleixnerconfig HAVE_GENERIC_TIF_BITS
179029589343SThomas Gleixner       bool
179129589343SThomas Gleixner
17922521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
179345332b1bSMasahiro Yamada
179445332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1795fa1b5d09SLinus Torvalds
1796d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1797d49a0626SPeter Zijlstra	bool
1798d49a0626SPeter Zijlstra
1799d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1800d49a0626SPeter Zijlstra	bool
1801d49a0626SPeter Zijlstra
1802d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1803d49a0626SPeter Zijlstra	bool
1804d49a0626SPeter Zijlstra
1805d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1806d49a0626SPeter Zijlstra	bool
1807d49a0626SPeter Zijlstra
1808d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1809d49a0626SPeter Zijlstra	bool
1810d49a0626SPeter Zijlstra
1811d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1812d49a0626SPeter Zijlstra	int
1813d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1814d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1815d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1816d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1817d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1818d49a0626SPeter Zijlstra	default 0
1819d49a0626SPeter Zijlstra
18205270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
18215270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
18225270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
18235270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
18245270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
18255270316cSPetr Pavlu
18265270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
18275270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
18285270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
18295270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
18305270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
18315270316cSPetr Pavlu
1832a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1833a88d970cSPaul E. McKenney	bool
1834a88d970cSPaul E. McKenney
18351198c9c6SNaveen N Raoconfig ARCH_WANTS_PRE_LINK_VMLINUX
18361198c9c6SNaveen N Rao	bool
18371198c9c6SNaveen N Rao	help
18381198c9c6SNaveen N Rao	  An architecture can select this if it provides arch/<arch>/tools/Makefile
18391198c9c6SNaveen N Rao	  with .arch.vmlinux.o target to be linked into vmlinux.
18401198c9c6SNaveen N Rao
1841735e5920SDavid Kaplanconfig ARCH_HAS_CPU_ATTACK_VECTORS
1842735e5920SDavid Kaplan	bool
1843735e5920SDavid Kaplan
184422471e13SRandy Dunlapendmenu
1845