xref: /linux/arch/Kconfig (revision 812258ff4166bcd41c7d44707e0591f9ae32ac8c)
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
92023ef9d43SKees Cookconfig CFI
92123ef9d43SKees Cook	bool "Use Kernel Control Flow Integrity (kCFI)"
92223ef9d43SKees Cook	default CFI_CLANG
92323ef9d43SKees Cook	depends on ARCH_SUPPORTS_CFI
92489245600SSami Tolvanen	depends on $(cc-option,-fsanitize=kcfi)
925cf68fffbSSami Tolvanen	help
92623ef9d43SKees Cook	  This option enables forward-edge Control Flow Integrity (CFI)
92723ef9d43SKees Cook	  checking, where the compiler injects a runtime check to each
928cf68fffbSSami Tolvanen	  indirect function call to ensure the target is a valid function with
929cf68fffbSSami Tolvanen	  the correct static type. This restricts possible call targets and
930cf68fffbSSami Tolvanen	  makes it more difficult for an attacker to exploit bugs that allow
931cf68fffbSSami Tolvanen	  the modification of stored function pointers. More information can be
932cf68fffbSSami Tolvanen	  found from Clang's documentation:
933cf68fffbSSami Tolvanen
934cf68fffbSSami Tolvanen	    https://clang.llvm.org/docs/ControlFlowIntegrity.html
935cf68fffbSSami Tolvanen
93623ef9d43SKees Cookconfig CFI_CLANG
93723ef9d43SKees Cook	bool
93823ef9d43SKees Cook	transitional
93923ef9d43SKees Cook	help
94023ef9d43SKees Cook	  Transitional config for CFI_CLANG to CFI migration.
94123ef9d43SKees Cook
942ce4a2620SAlice Ryhlconfig CFI_ICALL_NORMALIZE_INTEGERS
943ce4a2620SAlice Ryhl	bool "Normalize CFI tags for integers"
94423ef9d43SKees Cook	depends on CFI
94523ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
946ce4a2620SAlice Ryhl	help
947ce4a2620SAlice Ryhl	  This option normalizes the CFI tags for integer types so that all
948ce4a2620SAlice Ryhl	  integer types of the same size and signedness receive the same CFI
949ce4a2620SAlice Ryhl	  tag.
950ce4a2620SAlice Ryhl
951ce4a2620SAlice Ryhl	  The option is separate from CONFIG_RUST because it affects the ABI.
952ce4a2620SAlice Ryhl	  When working with build systems that care about the ABI, it is
953ce4a2620SAlice Ryhl	  convenient to be able to turn on this flag first, before Rust is
954ce4a2620SAlice Ryhl	  turned on.
955ce4a2620SAlice Ryhl
956ce4a2620SAlice Ryhl	  This option is necessary for using CFI with Rust. If unsure, say N.
957ce4a2620SAlice Ryhl
95823ef9d43SKees Cookconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9598b8ca9c2SAlice Ryhl	def_bool y
9604c66f830SAlice Ryhl	depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
9618b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
9622313ab74SAlice Ryhl	depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9634c66f830SAlice Ryhl
9648b8ca9c2SAlice Ryhlconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
9658b8ca9c2SAlice Ryhl	def_bool y
96623ef9d43SKees Cook	depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
9678b8ca9c2SAlice Ryhl	depends on RUSTC_VERSION >= 107900
968*812258ffSConor Dooley	depends on ARM64 || X86_64
9698b8ca9c2SAlice Ryhl	# With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
9702313ab74SAlice Ryhl	depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
9718b8ca9c2SAlice Ryhl		(!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
9724c66f830SAlice Ryhl
973cf68fffbSSami Tolvanenconfig CFI_PERMISSIVE
974cf68fffbSSami Tolvanen	bool "Use CFI in permissive mode"
97523ef9d43SKees Cook	depends on CFI
976cf68fffbSSami Tolvanen	help
977cf68fffbSSami Tolvanen	  When selected, Control Flow Integrity (CFI) violations result in a
978cf68fffbSSami Tolvanen	  warning instead of a kernel panic. This option should only be used
979cf68fffbSSami Tolvanen	  for finding indirect call type mismatches during development.
980cf68fffbSSami Tolvanen
981cf68fffbSSami Tolvanen	  If unsure, say N.
982cf68fffbSSami Tolvanen
9830f60a8efSKees Cookconfig HAVE_ARCH_WITHIN_STACK_FRAMES
9840f60a8efSKees Cook	bool
9850f60a8efSKees Cook	help
9860f60a8efSKees Cook	  An architecture should select this if it can walk the kernel stack
9870f60a8efSKees Cook	  frames to determine if an object is part of either the arguments
9880f60a8efSKees Cook	  or local variables (i.e. that it excludes saved return addresses,
9890f60a8efSKees Cook	  and similar) by implementing an inline arch_within_stack_frames(),
9900f60a8efSKees Cook	  which is used by CONFIG_HARDENED_USERCOPY.
9910f60a8efSKees Cook
99224a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER
9932b1d5024SFrederic Weisbecker	bool
9942b1d5024SFrederic Weisbecker	help
99591d1aa43SFrederic Weisbecker	  Provide kernel/user boundaries probes necessary for subsystems
99691d1aa43SFrederic Weisbecker	  that need it, such as userspace RCU extended quiescent state.
997490f561bSFrederic Weisbecker	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
998490f561bSFrederic Weisbecker	  optimized behind static key or through the slow path using TIF_NOHZ
999490f561bSFrederic Weisbecker	  flag. Exceptions handlers must be wrapped as well. Irqs are already
10006f0e6c15SFrederic Weisbecker	  protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
1001490f561bSFrederic Weisbecker	  handling on irq exit still need to be protected.
1002490f561bSFrederic Weisbecker
100324a9c541SFrederic Weisbeckerconfig HAVE_CONTEXT_TRACKING_USER_OFFSTACK
100483c2da2eSFrederic Weisbecker	bool
100583c2da2eSFrederic Weisbecker	help
100683c2da2eSFrederic Weisbecker	  Architecture neither relies on exception_enter()/exception_exit()
100783c2da2eSFrederic Weisbecker	  nor on schedule_user(). Also preempt_schedule_notrace() and
100883c2da2eSFrederic Weisbecker	  preempt_schedule_irq() can't be called in a preemptible section
1009d65d411cSValentin Schneider	  while context tracking is CT_STATE_USER. This feature reflects a sane
101083c2da2eSFrederic Weisbecker	  entry implementation where the following requirements are met on
101183c2da2eSFrederic Weisbecker	  critical entry code, ie: before user_exit() or after user_enter():
101283c2da2eSFrederic Weisbecker
101383c2da2eSFrederic Weisbecker	  - Critical entry code isn't preemptible (or better yet:
101483c2da2eSFrederic Weisbecker	    not interruptible).
1015493c1822SFrederic Weisbecker	  - No use of RCU read side critical sections, unless ct_nmi_enter()
101683c2da2eSFrederic Weisbecker	    got called.
101783c2da2eSFrederic Weisbecker	  - No use of instrumentation, unless instrumentation_begin() got
101883c2da2eSFrederic Weisbecker	    called.
101983c2da2eSFrederic Weisbecker
1020490f561bSFrederic Weisbeckerconfig HAVE_TIF_NOHZ
1021490f561bSFrederic Weisbecker	bool
1022490f561bSFrederic Weisbecker	help
1023490f561bSFrederic Weisbecker	  Arch relies on TIF_NOHZ and syscall slow path to implement context
1024490f561bSFrederic Weisbecker	  tracking calls to user_enter()/user_exit().
10252b1d5024SFrederic Weisbecker
1026b952741cSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING
1027b952741cSFrederic Weisbecker	bool
1028b952741cSFrederic Weisbecker
10292b91ec9fSFrederic Weisbeckerconfig HAVE_VIRT_CPU_ACCOUNTING_IDLE
10302b91ec9fSFrederic Weisbecker	bool
10312b91ec9fSFrederic Weisbecker	help
10322b91ec9fSFrederic Weisbecker	  Architecture has its own way to account idle CPU time and therefore
10332b91ec9fSFrederic Weisbecker	  doesn't implement vtime_account_idle().
10342b91ec9fSFrederic Weisbecker
103540565b5aSStanislaw Gruszkaconfig ARCH_HAS_SCALED_CPUTIME
103640565b5aSStanislaw Gruszka	bool
103740565b5aSStanislaw Gruszka
1038554b0004SKevin Hilmanconfig HAVE_VIRT_CPU_ACCOUNTING_GEN
1039554b0004SKevin Hilman	bool
1040554b0004SKevin Hilman	default y if 64BIT
1041554b0004SKevin Hilman	help
1042554b0004SKevin Hilman	  With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
1043554b0004SKevin Hilman	  Before enabling this option, arch code must be audited
1044554b0004SKevin Hilman	  to ensure there are no races in concurrent read/write of
1045554b0004SKevin Hilman	  cputime_t. For example, reading/writing 64-bit cputime_t on
1046554b0004SKevin Hilman	  some 32-bit arches may require multiple accesses, so proper
1047554b0004SKevin Hilman	  locking is needed to protect against concurrent accesses.
1048554b0004SKevin Hilman
1049fdf9c356SFrederic Weisbeckerconfig HAVE_IRQ_TIME_ACCOUNTING
1050fdf9c356SFrederic Weisbecker	bool
1051fdf9c356SFrederic Weisbecker	help
1052fdf9c356SFrederic Weisbecker	  Archs need to ensure they use a high enough resolution clock to
1053fdf9c356SFrederic Weisbecker	  support irq time accounting and then call enable_sched_clock_irqtime().
1054fdf9c356SFrederic Weisbecker
1055c49dd340SKalesh Singhconfig HAVE_MOVE_PUD
1056c49dd340SKalesh Singh	bool
1057c49dd340SKalesh Singh	help
1058c49dd340SKalesh Singh	  Architectures that select this are able to move page tables at the
1059c49dd340SKalesh Singh	  PUD level. If there are only 3 page table levels, the move effectively
1060c49dd340SKalesh Singh	  happens at the PGD level.
1061c49dd340SKalesh Singh
10622c91bd4aSJoel Fernandes (Google)config HAVE_MOVE_PMD
10632c91bd4aSJoel Fernandes (Google)	bool
10642c91bd4aSJoel Fernandes (Google)	help
10652c91bd4aSJoel Fernandes (Google)	  Archs that select this are able to move page tables at the PMD level.
10662c91bd4aSJoel Fernandes (Google)
106715626062SGerald Schaeferconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE
106815626062SGerald Schaefer	bool
106915626062SGerald Schaefer
1070a00cc7d9SMatthew Wilcoxconfig HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
1071a00cc7d9SMatthew Wilcox	bool
1072a00cc7d9SMatthew Wilcox
10730ddab1d2SToshi Kaniconfig HAVE_ARCH_HUGE_VMAP
10740ddab1d2SToshi Kani	bool
10750ddab1d2SToshi Kani
1076121e6f32SNicholas Piggin#
1077121e6f32SNicholas Piggin#  Archs that select this would be capable of PMD-sized vmaps (i.e.,
1078559089e0SSong Liu#  arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
1079559089e0SSong Liu#  must be used to enable allocations to use hugepages.
1080121e6f32SNicholas Piggin#
1081121e6f32SNicholas Pigginconfig HAVE_ARCH_HUGE_VMALLOC
1082121e6f32SNicholas Piggin	depends on HAVE_ARCH_HUGE_VMAP
1083121e6f32SNicholas Piggin	bool
1084121e6f32SNicholas Piggin
10853876d4a3SAlexandre Ghiticonfig ARCH_WANT_HUGE_PMD_SHARE
10863876d4a3SAlexandre Ghiti	bool
10873876d4a3SAlexandre Ghiti
10882f0584f3SRick Edgecombe# Archs that want to use pmd_mkwrite on kernel memory need it defined even
10892f0584f3SRick Edgecombe# if there are no userspace memory management features that use it
10902f0584f3SRick Edgecombeconfig ARCH_WANT_KERNEL_PMD_MKWRITE
10912f0584f3SRick Edgecombe	bool
10922f0584f3SRick Edgecombe
10932f0584f3SRick Edgecombeconfig ARCH_WANT_PMD_MKWRITE
10942f0584f3SRick Edgecombe	def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
10952f0584f3SRick Edgecombe
10960f8975ecSPavel Emelyanovconfig HAVE_ARCH_SOFT_DIRTY
10970f8975ecSPavel Emelyanov	bool
10980f8975ecSPavel Emelyanov
1099786d35d4SDavid Howellsconfig HAVE_MOD_ARCH_SPECIFIC
1100786d35d4SDavid Howells	bool
1101786d35d4SDavid Howells	help
1102786d35d4SDavid Howells	  The arch uses struct mod_arch_specific to store data.  Many arches
1103786d35d4SDavid Howells	  just need a simple module loader without arch specific data - those
1104786d35d4SDavid Howells	  should not enable this.
1105786d35d4SDavid Howells
1106786d35d4SDavid Howellsconfig MODULES_USE_ELF_RELA
1107786d35d4SDavid Howells	bool
1108786d35d4SDavid Howells	help
1109786d35d4SDavid Howells	  Modules only use ELF RELA relocations.  Modules with ELF REL
1110786d35d4SDavid Howells	  relocations will give an error.
1111786d35d4SDavid Howells
1112786d35d4SDavid Howellsconfig MODULES_USE_ELF_REL
1113786d35d4SDavid Howells	bool
1114786d35d4SDavid Howells	help
1115786d35d4SDavid Howells	  Modules only use ELF REL relocations.  Modules with ELF RELA
1116786d35d4SDavid Howells	  relocations will give an error.
1117786d35d4SDavid Howells
111801dc0386SChristophe Leroyconfig ARCH_WANTS_MODULES_DATA_IN_VMALLOC
111901dc0386SChristophe Leroy	bool
112001dc0386SChristophe Leroy	help
112101dc0386SChristophe Leroy	  For architectures like powerpc/32 which have constraints on module
112201dc0386SChristophe Leroy	  allocation and need to allocate module data outside of module area.
112301dc0386SChristophe Leroy
1124223b5e57SMike Rapoport (IBM)config ARCH_WANTS_EXECMEM_LATE
1125223b5e57SMike Rapoport (IBM)	bool
1126223b5e57SMike Rapoport (IBM)	help
1127223b5e57SMike Rapoport (IBM)	  For architectures that do not allocate executable memory early on
1128223b5e57SMike Rapoport (IBM)	  boot, but rather require its initialization late when there is
1129223b5e57SMike Rapoport (IBM)	  enough entropy for module space randomization, for instance
1130223b5e57SMike Rapoport (IBM)	  arm64.
1131223b5e57SMike Rapoport (IBM)
11322e45474aSMike Rapoport (Microsoft)config ARCH_HAS_EXECMEM_ROX
11332e45474aSMike Rapoport (Microsoft)	bool
11342e45474aSMike Rapoport (Microsoft)	depends on MMU && !HIGHMEM
11352e45474aSMike Rapoport (Microsoft)	help
11362e45474aSMike Rapoport (Microsoft)	  For architectures that support allocations of executable memory
11372e45474aSMike Rapoport (Microsoft)	  with read-only execute permissions. Architecture must implement
11382e45474aSMike Rapoport (Microsoft)	  execmem_fill_trapping_insns() callback to enable this.
11392e45474aSMike Rapoport (Microsoft)
1140cc1f0274SFrederic Weisbeckerconfig HAVE_IRQ_EXIT_ON_IRQ_STACK
1141cc1f0274SFrederic Weisbecker	bool
1142cc1f0274SFrederic Weisbecker	help
1143cc1f0274SFrederic Weisbecker	  Architecture doesn't only execute the irq handler on the irq stack
1144cc1f0274SFrederic Weisbecker	  but also irq_exit(). This way we can process softirqs on this irq
1145cc1f0274SFrederic Weisbecker	  stack instead of switching to a new one when we call __do_softirq()
1146cc1f0274SFrederic Weisbecker	  in the end of an hardirq.
1147cc1f0274SFrederic Weisbecker	  This spares a stack switch and improves cache usage on softirq
1148cc1f0274SFrederic Weisbecker	  processing.
1149cc1f0274SFrederic Weisbecker
1150cd1a41ceSThomas Gleixnerconfig HAVE_SOFTIRQ_ON_OWN_STACK
1151cd1a41ceSThomas Gleixner	bool
1152cd1a41ceSThomas Gleixner	help
1153cd1a41ceSThomas Gleixner	  Architecture provides a function to run __do_softirq() on a
1154c226bc3cSColin Ian King	  separate stack.
1155cd1a41ceSThomas Gleixner
11568cbb2b50SSebastian Andrzej Siewiorconfig SOFTIRQ_ON_OWN_STACK
11578cbb2b50SSebastian Andrzej Siewior	def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
11588cbb2b50SSebastian Andrzej Siewior
115912700c17SArnd Bergmannconfig ALTERNATE_USER_ADDRESS_SPACE
116012700c17SArnd Bergmann	bool
116112700c17SArnd Bergmann	help
116212700c17SArnd Bergmann	  Architectures set this when the CPU uses separate address
116312700c17SArnd Bergmann	  spaces for kernel and user space pointers. In this case, the
116412700c17SArnd Bergmann	  access_ok() check on a __user pointer is skipped.
116512700c17SArnd Bergmann
1166235a8f02SKirill A. Shutemovconfig PGTABLE_LEVELS
1167235a8f02SKirill A. Shutemov	int
1168235a8f02SKirill A. Shutemov	default 2
1169235a8f02SKirill A. Shutemov
11702b68f6caSKees Cookconfig ARCH_HAS_ELF_RANDOMIZE
11712b68f6caSKees Cook	bool
11722b68f6caSKees Cook	help
11732b68f6caSKees Cook	  An architecture supports choosing randomized locations for
11742b68f6caSKees Cook	  stack, mmap, brk, and ET_DYN. Defined functions:
11752b68f6caSKees Cook	  - arch_mmap_rnd()
1176204db6edSKees Cook	  - arch_randomize_brk()
11772b68f6caSKees Cook
1178d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_BITS
1179d07e2259SDaniel Cashman	bool
1180d07e2259SDaniel Cashman	help
1181d07e2259SDaniel Cashman	  An arch should select this symbol if it supports setting a variable
1182d07e2259SDaniel Cashman	  number of bits for use in establishing the base address for mmap
1183d07e2259SDaniel Cashman	  allocations, has MMU enabled and provides values for both:
1184d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MIN
1185d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_BITS_MAX
1186d07e2259SDaniel Cashman
11875f56a5dfSJiri Slabyconfig HAVE_EXIT_THREAD
11885f56a5dfSJiri Slaby	bool
11895f56a5dfSJiri Slaby	help
11905f56a5dfSJiri Slaby	  An architecture implements exit_thread.
11915f56a5dfSJiri Slaby
1192d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
1193d07e2259SDaniel Cashman	int
1194d07e2259SDaniel Cashman
1195d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
1196d07e2259SDaniel Cashman	int
1197d07e2259SDaniel Cashman
1198d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_DEFAULT
1199d07e2259SDaniel Cashman	int
1200d07e2259SDaniel Cashman
1201d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_BITS
1202d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address" if EXPERT
1203d07e2259SDaniel Cashman	range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
1204d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1205d07e2259SDaniel Cashman	default ARCH_MMAP_RND_BITS_MIN
1206d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_BITS
1207d07e2259SDaniel Cashman	help
1208d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1209d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1210d07e2259SDaniel Cashman	  resulting from mmap allocations. This value will be bounded
1211d07e2259SDaniel Cashman	  by the architecture's minimum and maximum supported values.
1212d07e2259SDaniel Cashman
1213d07e2259SDaniel Cashman	  This value can be changed after boot using the
1214d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_bits tunable
1215d07e2259SDaniel Cashman
1216d07e2259SDaniel Cashmanconfig HAVE_ARCH_MMAP_RND_COMPAT_BITS
1217d07e2259SDaniel Cashman	bool
1218d07e2259SDaniel Cashman	help
1219d07e2259SDaniel Cashman	  An arch should select this symbol if it supports running applications
1220d07e2259SDaniel Cashman	  in compatibility mode, supports setting a variable number of bits for
1221d07e2259SDaniel Cashman	  use in establishing the base address for mmap allocations, has MMU
1222d07e2259SDaniel Cashman	  enabled and provides values for both:
1223d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MIN
1224d07e2259SDaniel Cashman	  - ARCH_MMAP_RND_COMPAT_BITS_MAX
1225d07e2259SDaniel Cashman
1226d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
1227d07e2259SDaniel Cashman	int
1228d07e2259SDaniel Cashman
1229d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
1230d07e2259SDaniel Cashman	int
1231d07e2259SDaniel Cashman
1232d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1233d07e2259SDaniel Cashman	int
1234d07e2259SDaniel Cashman
1235d07e2259SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS
1236d07e2259SDaniel Cashman	int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
1237d07e2259SDaniel Cashman	range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
1238d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1239d07e2259SDaniel Cashman	default ARCH_MMAP_RND_COMPAT_BITS_MIN
1240d07e2259SDaniel Cashman	depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
1241d07e2259SDaniel Cashman	help
1242d07e2259SDaniel Cashman	  This value can be used to select the number of bits to use to
1243d07e2259SDaniel Cashman	  determine the random offset to the base address of vma regions
1244d07e2259SDaniel Cashman	  resulting from mmap allocations for compatible applications This
1245d07e2259SDaniel Cashman	  value will be bounded by the architecture's minimum and maximum
1246d07e2259SDaniel Cashman	  supported values.
1247d07e2259SDaniel Cashman
1248d07e2259SDaniel Cashman	  This value can be changed after boot using the
1249d07e2259SDaniel Cashman	  /proc/sys/vm/mmap_rnd_compat_bits tunable
1250d07e2259SDaniel Cashman
12511b028f78SDmitry Safonovconfig HAVE_ARCH_COMPAT_MMAP_BASES
12521b028f78SDmitry Safonov	bool
12531b028f78SDmitry Safonov	help
12541b028f78SDmitry Safonov	  This allows 64bit applications to invoke 32-bit mmap() syscall
12551b028f78SDmitry Safonov	  and vice-versa 32-bit applications to call 64-bit mmap().
12561b028f78SDmitry Safonov	  Required for applications doing different bitness syscalls.
12571b028f78SDmitry Safonov
1258ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_4KB
1259ba89f9c8SArnd Bergmann	bool
1260ba89f9c8SArnd Bergmann
1261ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_8KB
1262ba89f9c8SArnd Bergmann	bool
1263ba89f9c8SArnd Bergmann
1264ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_16KB
1265ba89f9c8SArnd Bergmann	bool
1266ba89f9c8SArnd Bergmann
1267ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_32KB
1268ba89f9c8SArnd Bergmann	bool
1269ba89f9c8SArnd Bergmann
1270ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_64KB
1271ba89f9c8SArnd Bergmann	bool
1272ba89f9c8SArnd Bergmann
1273ba89f9c8SArnd Bergmannconfig HAVE_PAGE_SIZE_256KB
1274ba89f9c8SArnd Bergmann	bool
1275ba89f9c8SArnd Bergmann
1276ba89f9c8SArnd Bergmannchoice
1277ba89f9c8SArnd Bergmann	prompt "MMU page size"
1278ba89f9c8SArnd Bergmann
1279ba89f9c8SArnd Bergmannconfig PAGE_SIZE_4KB
1280ba89f9c8SArnd Bergmann	bool "4KiB pages"
1281ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_4KB
1282ba89f9c8SArnd Bergmann	help
1283ba89f9c8SArnd Bergmann	  This option select the standard 4KiB Linux page size and the only
1284ba89f9c8SArnd Bergmann	  available option on many architectures. Using 4KiB page size will
1285ba89f9c8SArnd Bergmann	  minimize memory consumption and is therefore recommended for low
1286ba89f9c8SArnd Bergmann	  memory systems.
1287ba89f9c8SArnd Bergmann	  Some software that is written for x86 systems makes incorrect
1288ba89f9c8SArnd Bergmann	  assumptions about the page size and only runs on 4KiB pages.
1289ba89f9c8SArnd Bergmann
1290ba89f9c8SArnd Bergmannconfig PAGE_SIZE_8KB
1291ba89f9c8SArnd Bergmann	bool "8KiB pages"
1292ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_8KB
1293ba89f9c8SArnd Bergmann	help
1294ba89f9c8SArnd Bergmann	  This option is the only supported page size on a few older
1295ba89f9c8SArnd Bergmann	  processors, and can be slightly faster than 4KiB pages.
1296ba89f9c8SArnd Bergmann
1297ba89f9c8SArnd Bergmannconfig PAGE_SIZE_16KB
1298ba89f9c8SArnd Bergmann	bool "16KiB pages"
1299ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_16KB
1300ba89f9c8SArnd Bergmann	help
1301ba89f9c8SArnd Bergmann	  This option is usually a good compromise between memory
1302ba89f9c8SArnd Bergmann	  consumption and performance for typical desktop and server
1303ba89f9c8SArnd Bergmann	  workloads, often saving a level of page table lookups compared
1304ba89f9c8SArnd Bergmann	  to 4KB pages as well as reducing TLB pressure and overhead of
1305ba89f9c8SArnd Bergmann	  per-page operations in the kernel at the expense of a larger
1306ba89f9c8SArnd Bergmann	  page cache.
1307ba89f9c8SArnd Bergmann
1308ba89f9c8SArnd Bergmannconfig PAGE_SIZE_32KB
1309ba89f9c8SArnd Bergmann	bool "32KiB pages"
1310ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_32KB
1311ba89f9c8SArnd Bergmann	help
1312ba89f9c8SArnd Bergmann	  Using 32KiB page size will result in slightly higher performance
1313ba89f9c8SArnd Bergmann	  kernel at the price of higher memory consumption compared to
1314ba89f9c8SArnd Bergmann	  16KiB pages.	This option is available only on cnMIPS cores.
1315ba89f9c8SArnd Bergmann	  Note that you will need a suitable Linux distribution to
1316ba89f9c8SArnd Bergmann	  support this.
1317ba89f9c8SArnd Bergmann
1318ba89f9c8SArnd Bergmannconfig PAGE_SIZE_64KB
1319ba89f9c8SArnd Bergmann	bool "64KiB pages"
1320ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_64KB
1321ba89f9c8SArnd Bergmann	help
1322ba89f9c8SArnd Bergmann	  Using 64KiB page size will result in slightly higher performance
1323ba89f9c8SArnd Bergmann	  kernel at the price of much higher memory consumption compared to
1324ba89f9c8SArnd Bergmann	  4KiB or 16KiB pages.
1325ba89f9c8SArnd Bergmann	  This is not suitable for general-purpose workloads but the
1326ba89f9c8SArnd Bergmann	  better performance may be worth the cost for certain types of
1327ba89f9c8SArnd Bergmann	  supercomputing or database applications that work mostly with
1328ba89f9c8SArnd Bergmann	  large in-memory data rather than small files.
1329ba89f9c8SArnd Bergmann
1330ba89f9c8SArnd Bergmannconfig PAGE_SIZE_256KB
1331ba89f9c8SArnd Bergmann	bool "256KiB pages"
1332ba89f9c8SArnd Bergmann	depends on HAVE_PAGE_SIZE_256KB
1333ba89f9c8SArnd Bergmann	help
1334ba89f9c8SArnd Bergmann	  256KiB pages have little practical value due to their extreme
1335ba89f9c8SArnd Bergmann	  memory usage.  The kernel will only be able to run applications
1336ba89f9c8SArnd Bergmann	  that have been compiled with '-zmax-page-size' set to 256KiB
1337ba89f9c8SArnd Bergmann	  (the default is 64KiB or 4KiB on most architectures).
1338ba89f9c8SArnd Bergmann
1339ba89f9c8SArnd Bergmannendchoice
1340ba89f9c8SArnd Bergmann
13411f0e290cSGuenter Roeckconfig PAGE_SIZE_LESS_THAN_64KB
13421f0e290cSGuenter Roeck	def_bool y
13431f0e290cSGuenter Roeck	depends on !PAGE_SIZE_64KB
1344e4bbd20dSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB
1345e4bbd20dSNathan Chancellor
1346e4bbd20dSNathan Chancellorconfig PAGE_SIZE_LESS_THAN_256KB
1347e4bbd20dSNathan Chancellor	def_bool y
13481f0e290cSGuenter Roeck	depends on !PAGE_SIZE_256KB
13491f0e290cSGuenter Roeck
1350ba89f9c8SArnd Bergmannconfig PAGE_SHIFT
1351ba89f9c8SArnd Bergmann	int
1352ba89f9c8SArnd Bergmann	default	12 if PAGE_SIZE_4KB
1353ba89f9c8SArnd Bergmann	default	13 if PAGE_SIZE_8KB
1354ba89f9c8SArnd Bergmann	default	14 if PAGE_SIZE_16KB
1355ba89f9c8SArnd Bergmann	default	15 if PAGE_SIZE_32KB
1356ba89f9c8SArnd Bergmann	default	16 if PAGE_SIZE_64KB
1357ba89f9c8SArnd Bergmann	default	18 if PAGE_SIZE_256KB
1358ba89f9c8SArnd Bergmann
135967f3977fSAlexandre Ghiti# This allows to use a set of generic functions to determine mmap base
136067f3977fSAlexandre Ghiti# address by giving priority to top-down scheme only if the process
136167f3977fSAlexandre Ghiti# is not in legacy mode (compat task, unlimited stack size or
136267f3977fSAlexandre Ghiti# sysctl_legacy_va_layout).
136367f3977fSAlexandre Ghiti# Architecture that selects this option can provide its own version of:
136467f3977fSAlexandre Ghiti# - STACK_RND_MASK
136567f3977fSAlexandre Ghiticonfig ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
136667f3977fSAlexandre Ghiti	bool
136767f3977fSAlexandre Ghiti	depends on MMU
1368e7142bf5SAlexandre Ghiti	select ARCH_HAS_ELF_RANDOMIZE
136967f3977fSAlexandre Ghiti
137003f16cd0SJosh Poimboeufconfig HAVE_OBJTOOL
137103f16cd0SJosh Poimboeuf	bool
137203f16cd0SJosh Poimboeuf
13734ab7674fSJosh Poimboeufconfig HAVE_JUMP_LABEL_HACK
13744ab7674fSJosh Poimboeuf	bool
13754ab7674fSJosh Poimboeuf
137622102f45SJosh Poimboeufconfig HAVE_NOINSTR_HACK
137722102f45SJosh Poimboeuf	bool
137822102f45SJosh Poimboeuf
1379489e355bSJosh Poimboeufconfig HAVE_NOINSTR_VALIDATION
1380489e355bSJosh Poimboeuf	bool
1381489e355bSJosh Poimboeuf
13825f3da8c0SJosh Poimboeufconfig HAVE_UACCESS_VALIDATION
13835f3da8c0SJosh Poimboeuf	bool
13845f3da8c0SJosh Poimboeuf	select OBJTOOL
13855f3da8c0SJosh Poimboeuf
1386b9ab5ebbSJosh Poimboeufconfig HAVE_STACK_VALIDATION
1387b9ab5ebbSJosh Poimboeuf	bool
1388b9ab5ebbSJosh Poimboeuf	help
138903f16cd0SJosh Poimboeuf	  Architecture supports objtool compile-time frame pointer rule
139003f16cd0SJosh Poimboeuf	  validation.
1391b9ab5ebbSJosh Poimboeuf
1392af085d90SJosh Poimboeufconfig HAVE_RELIABLE_STACKTRACE
1393af085d90SJosh Poimboeuf	bool
1394af085d90SJosh Poimboeuf	help
1395140d7e88SMiroslav Benes	  Architecture has either save_stack_trace_tsk_reliable() or
1396140d7e88SMiroslav Benes	  arch_stack_walk_reliable() function which only returns a stack trace
1397140d7e88SMiroslav Benes	  if it can guarantee the trace is reliable.
1398af085d90SJosh Poimboeuf
1399468a9428SGeorge Spelvinconfig HAVE_ARCH_HASH
1400468a9428SGeorge Spelvin	bool
1401468a9428SGeorge Spelvin	default n
1402468a9428SGeorge Spelvin	help
1403468a9428SGeorge Spelvin	  If this is set, the architecture provides an <asm/hash.h>
1404468a9428SGeorge Spelvin	  file which provides platform-specific implementations of some
1405468a9428SGeorge Spelvin	  functions in <linux/hash.h> or fs/namei.c.
1406468a9428SGeorge Spelvin
1407666047feSFinn Thainconfig HAVE_ARCH_NVRAM_OPS
1408666047feSFinn Thain	bool
1409666047feSFinn Thain
14103a495511SWilliam Breathitt Grayconfig ISA_BUS_API
14113a495511SWilliam Breathitt Gray	def_bool ISA
14123a495511SWilliam Breathitt Gray
1413d2125043SAl Viro#
1414d2125043SAl Viro# ABI hall of shame
1415d2125043SAl Viro#
1416d2125043SAl Viroconfig CLONE_BACKWARDS
1417d2125043SAl Viro	bool
1418d2125043SAl Viro	help
1419d2125043SAl Viro	  Architecture has tls passed as the 4th argument of clone(2),
1420d2125043SAl Viro	  not the 5th one.
1421d2125043SAl Viro
1422d2125043SAl Viroconfig CLONE_BACKWARDS2
1423d2125043SAl Viro	bool
1424d2125043SAl Viro	help
1425d2125043SAl Viro	  Architecture has the first two arguments of clone(2) swapped.
1426d2125043SAl Viro
1427dfa9771aSMichal Simekconfig CLONE_BACKWARDS3
1428dfa9771aSMichal Simek	bool
1429dfa9771aSMichal Simek	help
1430dfa9771aSMichal Simek	  Architecture has tls passed as the 3rd argument of clone(2),
1431dfa9771aSMichal Simek	  not the 5th one.
1432dfa9771aSMichal Simek
1433eaca6eaeSAl Viroconfig ODD_RT_SIGACTION
1434eaca6eaeSAl Viro	bool
1435eaca6eaeSAl Viro	help
1436eaca6eaeSAl Viro	  Architecture has unusual rt_sigaction(2) arguments
1437eaca6eaeSAl Viro
14380a0e8cdfSAl Viroconfig OLD_SIGSUSPEND
14390a0e8cdfSAl Viro	bool
14400a0e8cdfSAl Viro	help
14410a0e8cdfSAl Viro	  Architecture has old sigsuspend(2) syscall, of one-argument variety
14420a0e8cdfSAl Viro
14430a0e8cdfSAl Viroconfig OLD_SIGSUSPEND3
14440a0e8cdfSAl Viro	bool
14450a0e8cdfSAl Viro	help
14460a0e8cdfSAl Viro	  Even weirder antique ABI - three-argument sigsuspend(2)
14470a0e8cdfSAl Viro
1448495dfbf7SAl Viroconfig OLD_SIGACTION
1449495dfbf7SAl Viro	bool
1450495dfbf7SAl Viro	help
1451495dfbf7SAl Viro	  Architecture has old sigaction(2) syscall.  Nope, not the same
1452495dfbf7SAl Viro	  as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
1453495dfbf7SAl Viro	  but fairly different variant of sigaction(2), thanks to OSF/1
1454495dfbf7SAl Viro	  compatibility...
1455495dfbf7SAl Viro
1456495dfbf7SAl Viroconfig COMPAT_OLD_SIGACTION
1457495dfbf7SAl Viro	bool
1458495dfbf7SAl Viro
145917435e5fSDeepa Dinamaniconfig COMPAT_32BIT_TIME
1460942437c9SArnd Bergmann	bool "Provide system calls for 32-bit time_t"
1461942437c9SArnd Bergmann	default !64BIT || COMPAT
146217435e5fSDeepa Dinamani	help
146317435e5fSDeepa Dinamani	  This enables 32 bit time_t support in addition to 64 bit time_t support.
146417435e5fSDeepa Dinamani	  This is relevant on all 32-bit architectures, and 64-bit architectures
146517435e5fSDeepa Dinamani	  as part of compat syscall handling.
146617435e5fSDeepa Dinamani
146787a4c375SChristoph Hellwigconfig ARCH_NO_PREEMPT
146887a4c375SChristoph Hellwig	bool
146987a4c375SChristoph Hellwig
1470a50a3f4bSThomas Gleixnerconfig ARCH_SUPPORTS_RT
1471a50a3f4bSThomas Gleixner	bool
1472a50a3f4bSThomas Gleixner
1473fff7fb0bSZhaoxiu Zengconfig CPU_NO_EFFICIENT_FFS
1474fff7fb0bSZhaoxiu Zeng	def_bool n
1475fff7fb0bSZhaoxiu Zeng
1476ba14a194SAndy Lutomirskiconfig HAVE_ARCH_VMAP_STACK
1477ba14a194SAndy Lutomirski	def_bool n
1478ba14a194SAndy Lutomirski	help
1479ba14a194SAndy Lutomirski	  An arch should select this symbol if it can support kernel stacks
1480ba14a194SAndy Lutomirski	  in vmalloc space.  This means:
1481ba14a194SAndy Lutomirski
1482ba14a194SAndy Lutomirski	  - vmalloc space must be large enough to hold many kernel stacks.
1483ba14a194SAndy Lutomirski	    This may rule out many 32-bit architectures.
1484ba14a194SAndy Lutomirski
1485ba14a194SAndy Lutomirski	  - Stacks in vmalloc space need to work reliably.  For example, if
1486ba14a194SAndy Lutomirski	    vmap page tables are created on demand, either this mechanism
1487ba14a194SAndy Lutomirski	    needs to work while the stack points to a virtual address with
1488ba14a194SAndy Lutomirski	    unpopulated page tables or arch code (switch_to() and switch_mm(),
1489ba14a194SAndy Lutomirski	    most likely) needs to ensure that the stack's page table entries
1490ba14a194SAndy Lutomirski	    are populated before running on a possibly unpopulated stack.
1491ba14a194SAndy Lutomirski
1492ba14a194SAndy Lutomirski	  - If the stack overflows into a guard page, something reasonable
1493ba14a194SAndy Lutomirski	    should happen.  The definition of "reasonable" is flexible, but
1494ba14a194SAndy Lutomirski	    instantly rebooting without logging anything would be unfriendly.
1495ba14a194SAndy Lutomirski
1496ba14a194SAndy Lutomirskiconfig VMAP_STACK
1497ba14a194SAndy Lutomirski	default y
1498ba14a194SAndy Lutomirski	bool "Use a virtually-mapped stack"
1499eafb149eSDaniel Axtens	depends on HAVE_ARCH_VMAP_STACK
150038dd767dSAndrey Konovalov	depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
1501a7f7f624SMasahiro Yamada	help
1502ba14a194SAndy Lutomirski	  Enable this if you want the use virtually-mapped kernel stacks
1503ba14a194SAndy Lutomirski	  with guard pages.  This causes kernel stack overflows to be
1504ba14a194SAndy Lutomirski	  caught immediately rather than causing difficult-to-diagnose
1505ba14a194SAndy Lutomirski	  corruption.
1506ba14a194SAndy Lutomirski
150738dd767dSAndrey Konovalov	  To use this with software KASAN modes, the architecture must support
150838dd767dSAndrey Konovalov	  backing virtual mappings with real shadow memory, and KASAN_VMALLOC
150938dd767dSAndrey Konovalov	  must be enabled.
1510ba14a194SAndy Lutomirski
151139218ff4SKees Cookconfig HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
151239218ff4SKees Cook	def_bool n
151339218ff4SKees Cook	help
151439218ff4SKees Cook	  An arch should select this symbol if it can support kernel stack
151539218ff4SKees Cook	  offset randomization with calls to add_random_kstack_offset()
151639218ff4SKees Cook	  during syscall entry and choose_random_kstack_offset() during
151739218ff4SKees Cook	  syscall exit. Careful removal of -fstack-protector-strong and
151839218ff4SKees Cook	  -fstack-protector should also be applied to the entry code and
151939218ff4SKees Cook	  closely examined, as the artificial stack bump looks like an array
152039218ff4SKees Cook	  to the compiler, so it will attempt to add canary checks regardless
152139218ff4SKees Cook	  of the static branch state.
152239218ff4SKees Cook
15238cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET
15248cb37a59SMarco Elver	bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
15258cb37a59SMarco Elver	default y
152639218ff4SKees Cook	depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
152739218ff4SKees Cook	help
152839218ff4SKees Cook	  The kernel stack offset can be randomized (after pt_regs) by
152939218ff4SKees Cook	  roughly 5 bits of entropy, frustrating memory corruption
153039218ff4SKees Cook	  attacks that depend on stack address determinism or
15318cb37a59SMarco Elver	  cross-syscall address exposures.
15328cb37a59SMarco Elver
15338cb37a59SMarco Elver	  The feature is controlled via the "randomize_kstack_offset=on/off"
15348cb37a59SMarco Elver	  kernel boot param, and if turned off has zero overhead due to its use
15358cb37a59SMarco Elver	  of static branches (see JUMP_LABEL).
15368cb37a59SMarco Elver
15378cb37a59SMarco Elver	  If unsure, say Y.
15388cb37a59SMarco Elver
15398cb37a59SMarco Elverconfig RANDOMIZE_KSTACK_OFFSET_DEFAULT
15408cb37a59SMarco Elver	bool "Default state of kernel stack offset randomization"
15418cb37a59SMarco Elver	depends on RANDOMIZE_KSTACK_OFFSET
15428cb37a59SMarco Elver	help
15438cb37a59SMarco Elver	  Kernel stack offset randomization is controlled by kernel boot param
15448cb37a59SMarco Elver	  "randomize_kstack_offset=on/off", and this config chooses the default
15458cb37a59SMarco Elver	  boot state.
154639218ff4SKees Cook
1547ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX
1548ad21fc4fSLaura Abbott	def_bool n
1549ad21fc4fSLaura Abbott
1550ad21fc4fSLaura Abbottconfig ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1551ad21fc4fSLaura Abbott	def_bool n
1552ad21fc4fSLaura Abbott
1553ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_KERNEL_RWX
1554ad21fc4fSLaura Abbott	def_bool n
1555ad21fc4fSLaura Abbott
15560f5bf6d0SLaura Abbottconfig STRICT_KERNEL_RWX
1557ad21fc4fSLaura Abbott	bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
1558ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_KERNEL_RWX
1559ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1560ad21fc4fSLaura Abbott	help
1561ad21fc4fSLaura Abbott	  If this is set, kernel text and rodata memory will be made read-only,
1562ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1563ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. executing the heap
1564ad21fc4fSLaura Abbott	  or modifying text)
1565ad21fc4fSLaura Abbott
1566ad21fc4fSLaura Abbott	  These features are considered standard security practice these days.
1567ad21fc4fSLaura Abbott	  You should say Y here in almost all cases.
1568ad21fc4fSLaura Abbott
1569ad21fc4fSLaura Abbottconfig ARCH_HAS_STRICT_MODULE_RWX
1570ad21fc4fSLaura Abbott	def_bool n
1571ad21fc4fSLaura Abbott
15720f5bf6d0SLaura Abbottconfig STRICT_MODULE_RWX
1573ad21fc4fSLaura Abbott	bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
1574ad21fc4fSLaura Abbott	depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
1575ad21fc4fSLaura Abbott	default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
1576ad21fc4fSLaura Abbott	help
1577ad21fc4fSLaura Abbott	  If this is set, module text and rodata memory will be made read-only,
1578ad21fc4fSLaura Abbott	  and non-text memory will be made non-executable. This provides
1579ad21fc4fSLaura Abbott	  protection against certain security exploits (e.g. writing to text)
1580ad21fc4fSLaura Abbott
1581ea8c64acSChristoph Hellwig# select if the architecture provides an asm/dma-direct.h header
1582ea8c64acSChristoph Hellwigconfig ARCH_HAS_PHYS_TO_DMA
1583ea8c64acSChristoph Hellwig	bool
1584ea8c64acSChristoph Hellwig
1585bff70402SJames Morseconfig ARCH_HAS_CPU_RESCTRL
1586bff70402SJames Morse	bool
1587bff70402SJames Morse	help
1588bff70402SJames Morse	  An architecture selects this option to indicate that the necessary
1589bff70402SJames Morse	  hooks are provided to support the common memory system usage
1590bff70402SJames Morse	  monitoring and control interfaces provided by the 'resctrl'
1591bff70402SJames Morse	  filesystem (see RESCTRL_FS).
1592bff70402SJames Morse
159304f264d3SPaul Burtonconfig HAVE_ARCH_COMPILER_H
159404f264d3SPaul Burton	bool
159504f264d3SPaul Burton	help
159604f264d3SPaul Burton	  An architecture can select this if it provides an
159704f264d3SPaul Burton	  asm/compiler.h header that should be included after
159804f264d3SPaul Burton	  linux/compiler-*.h in order to override macro definitions that those
159904f264d3SPaul Burton	  headers generally provide.
160004f264d3SPaul Burton
1601e419ddeaSGreg Ungererconfig HAVE_ARCH_LIBGCC_H
1602e419ddeaSGreg Ungerer	bool
1603e419ddeaSGreg Ungerer	help
1604e419ddeaSGreg Ungerer	  An architecture can select this if it provides an
1605e419ddeaSGreg Ungerer	  asm/libgcc.h header that should be included after
1606e419ddeaSGreg Ungerer	  linux/libgcc.h in order to override macro definitions that
1607e419ddeaSGreg Ungerer	  header generally provides.
1608e419ddeaSGreg Ungerer
1609271ca788SArd Biesheuvelconfig HAVE_ARCH_PREL32_RELOCATIONS
1610271ca788SArd Biesheuvel	bool
1611271ca788SArd Biesheuvel	help
1612271ca788SArd Biesheuvel	  May be selected by an architecture if it supports place-relative
1613271ca788SArd Biesheuvel	  32-bit relocations, both in the toolchain and in the module loader,
1614271ca788SArd Biesheuvel	  in which case relative references can be used in special sections
1615271ca788SArd Biesheuvel	  for PCI fixup, initcalls etc which are only half the size on 64 bit
1616271ca788SArd Biesheuvel	  architectures, and don't require runtime relocation on relocatable
1617271ca788SArd Biesheuvel	  kernels.
1618271ca788SArd Biesheuvel
1619ce9084baSArd Biesheuvelconfig ARCH_USE_MEMREMAP_PROT
1620ce9084baSArd Biesheuvel	bool
1621ce9084baSArd Biesheuvel
1622fb346fd9SWaiman Longconfig LOCK_EVENT_COUNTS
1623fb346fd9SWaiman Long	bool "Locking event counts collection"
1624fb346fd9SWaiman Long	depends on DEBUG_FS
1625a7f7f624SMasahiro Yamada	help
1626fb346fd9SWaiman Long	  Enable light-weight counting of various locking related events
1627fb346fd9SWaiman Long	  in the system with minimal performance impact. This reduces
1628fb346fd9SWaiman Long	  the chance of application behavior change because of timing
1629fb346fd9SWaiman Long	  differences. The counts are reported via debugfs.
1630fb346fd9SWaiman Long
16315cf896fbSPeter Collingbourne# Select if the architecture has support for applying RELR relocations.
16325cf896fbSPeter Collingbourneconfig ARCH_HAS_RELR
16335cf896fbSPeter Collingbourne	bool
16345cf896fbSPeter Collingbourne
16355cf896fbSPeter Collingbourneconfig RELR
16365cf896fbSPeter Collingbourne	bool "Use RELR relocation packing"
16375cf896fbSPeter Collingbourne	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
16385cf896fbSPeter Collingbourne	default y
16395cf896fbSPeter Collingbourne	help
16405cf896fbSPeter Collingbourne	  Store the kernel's dynamic relocations in the RELR relocation packing
16415cf896fbSPeter Collingbourne	  format. Requires a compatible linker (LLD supports this feature), as
16425cf896fbSPeter Collingbourne	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
16435cf896fbSPeter Collingbourne	  are compatible).
16445cf896fbSPeter Collingbourne
16450c9c1d56SThiago Jung Bauermannconfig ARCH_HAS_MEM_ENCRYPT
16460c9c1d56SThiago Jung Bauermann	bool
16470c9c1d56SThiago Jung Bauermann
164846b49b12STom Lendackyconfig ARCH_HAS_CC_PLATFORM
164946b49b12STom Lendacky	bool
165046b49b12STom Lendacky
16510e242208SHassan Naveedconfig HAVE_SPARSE_SYSCALL_NR
16520e242208SHassan Naveed	bool
16530e242208SHassan Naveed	help
16540e242208SHassan Naveed	  An architecture should select this if its syscall numbering is sparse
16550e242208SHassan Naveed	  to save space. For example, MIPS architecture has a syscall array with
16560e242208SHassan Naveed	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
16570e242208SHassan Naveed	  related optimizations for a given architecture.
16580e242208SHassan Naveed
1659365841e1SThomas Weißschuhconfig ARCH_HAS_VDSO_ARCH_DATA
16607b338f6dSThomas Weißschuh	depends on HAVE_GENERIC_VDSO
1661365841e1SThomas Weißschuh	bool
1662365841e1SThomas Weißschuh
1663a812eee0SNam Caoconfig ARCH_HAS_VDSO_TIME_DATA
1664d60d7de3SSven Schnelle	bool
1665d60d7de3SSven Schnelle
1666115284d8SJosh Poimboeufconfig HAVE_STATIC_CALL
1667115284d8SJosh Poimboeuf	bool
1668115284d8SJosh Poimboeuf
16699183c3f9SJosh Poimboeufconfig HAVE_STATIC_CALL_INLINE
16709183c3f9SJosh Poimboeuf	bool
16719183c3f9SJosh Poimboeuf	depends on HAVE_STATIC_CALL
167203f16cd0SJosh Poimboeuf	select OBJTOOL
16739183c3f9SJosh Poimboeuf
16746ef869e0SMichal Hockoconfig HAVE_PREEMPT_DYNAMIC
16756ef869e0SMichal Hocko	bool
167699cf983cSMark Rutland
167799cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_CALL
167899cf983cSMark Rutland	bool
16796ef869e0SMichal Hocko	depends on HAVE_STATIC_CALL
168099cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
16816ef869e0SMichal Hocko	help
168299cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
168399cf983cSMark Rutland	  model being selected at boot time using static calls.
168499cf983cSMark Rutland
168599cf983cSMark Rutland	  Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
168699cf983cSMark Rutland	  preemption function will be patched directly.
168799cf983cSMark Rutland
168899cf983cSMark Rutland	  Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
168999cf983cSMark Rutland	  call to a preemption function will go through a trampoline, and the
169099cf983cSMark Rutland	  trampoline will be patched.
169199cf983cSMark Rutland
169299cf983cSMark Rutland	  It is strongly advised to support inline static call to avoid any
169399cf983cSMark Rutland	  overhead.
169499cf983cSMark Rutland
169599cf983cSMark Rutlandconfig HAVE_PREEMPT_DYNAMIC_KEY
169699cf983cSMark Rutland	bool
1697a0a12c3eSNick Desaulniers	depends on HAVE_ARCH_JUMP_LABEL
169899cf983cSMark Rutland	select HAVE_PREEMPT_DYNAMIC
169999cf983cSMark Rutland	help
170099cf983cSMark Rutland	  An architecture should select this if it can handle the preemption
170199cf983cSMark Rutland	  model being selected at boot time using static keys.
170299cf983cSMark Rutland
170399cf983cSMark Rutland	  Each preemption function will be given an early return based on a
170499cf983cSMark Rutland	  static key. This should have slightly lower overhead than non-inline
170599cf983cSMark Rutland	  static calls, as this effectively inlines each trampoline into the
170699cf983cSMark Rutland	  start of its callee. This may avoid redundant work, and may
170799cf983cSMark Rutland	  integrate better with CFI schemes.
170899cf983cSMark Rutland
170999cf983cSMark Rutland	  This will have greater overhead than using inline static calls as
171099cf983cSMark Rutland	  the call to the preemption function cannot be entirely elided.
17116ef869e0SMichal Hocko
171259612b24SNathan Chancellorconfig ARCH_WANT_LD_ORPHAN_WARN
171359612b24SNathan Chancellor	bool
171459612b24SNathan Chancellor	help
171559612b24SNathan Chancellor	  An arch should select this symbol once all linker sections are explicitly
171659612b24SNathan Chancellor	  included, size-asserted, or discarded in the linker scripts. This is
171759612b24SNathan Chancellor	  important because we never want expected sections to be placed heuristically
171859612b24SNathan Chancellor	  by the linker, since the locations of such sections can change between linker
171959612b24SNathan Chancellor	  versions.
172059612b24SNathan Chancellor
17214f5b0c17SMike Rapoportconfig HAVE_ARCH_PFN_VALID
17224f5b0c17SMike Rapoport	bool
17234f5b0c17SMike Rapoport
17245d6ad668SMike Rapoportconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
17255d6ad668SMike Rapoport	bool
17265d6ad668SMike Rapoport
1727df4e817bSPasha Tatashinconfig ARCH_SUPPORTS_PAGE_TABLE_CHECK
1728df4e817bSPasha Tatashin	bool
1729df4e817bSPasha Tatashin
17302ca408d9SBrian Gerstconfig ARCH_SPLIT_ARG64
17312ca408d9SBrian Gerst	bool
17322ca408d9SBrian Gerst	help
17332ca408d9SBrian Gerst	  If a 32-bit architecture requires 64-bit arguments to be split into
17342ca408d9SBrian Gerst	  pairs of 32-bit arguments, select this option.
17352ca408d9SBrian Gerst
17367facdc42SAl Viroconfig ARCH_HAS_ELFCORE_COMPAT
17377facdc42SAl Viro	bool
17387facdc42SAl Viro
173958e106e7SBalbir Singhconfig ARCH_HAS_PARANOID_L1D_FLUSH
174058e106e7SBalbir Singh	bool
174158e106e7SBalbir Singh
1742d593d64fSPrasad Sodagudiconfig ARCH_HAVE_TRACE_MMIO_ACCESS
1743d593d64fSPrasad Sodagudi	bool
1744d593d64fSPrasad Sodagudi
17451bdda24cSThomas Gleixnerconfig DYNAMIC_SIGFRAME
17461bdda24cSThomas Gleixner	bool
17471bdda24cSThomas Gleixner
174850468e43SJarkko Sakkinen# Select, if arch has a named attribute group bound to NUMA device nodes.
174950468e43SJarkko Sakkinenconfig HAVE_ARCH_NODE_DEV_GROUP
175050468e43SJarkko Sakkinen	bool
175150468e43SJarkko Sakkinen
175271ce1ab5SKinsey Hoconfig ARCH_HAS_HW_PTE_YOUNG
175371ce1ab5SKinsey Ho	bool
175471ce1ab5SKinsey Ho	help
175571ce1ab5SKinsey Ho	  Architectures that select this option are capable of setting the
175671ce1ab5SKinsey Ho	  accessed bit in PTE entries when using them as part of linear address
175771ce1ab5SKinsey Ho	  translations. Architectures that require runtime check should select
175871ce1ab5SKinsey Ho	  this option and override arch_has_hw_pte_young().
175971ce1ab5SKinsey Ho
1760eed9a328SYu Zhaoconfig ARCH_HAS_NONLEAF_PMD_YOUNG
1761eed9a328SYu Zhao	bool
1762eed9a328SYu Zhao	help
1763eed9a328SYu Zhao	  Architectures that select this option are capable of setting the
1764eed9a328SYu Zhao	  accessed bit in non-leaf PMD entries when using them as part of linear
1765eed9a328SYu Zhao	  address translations. Page table walkers that clear the accessed bit
1766eed9a328SYu Zhao	  may use this capability to reduce their search space.
1767eed9a328SYu Zhao
17686cbd1d6dSSamuel Hollandconfig ARCH_HAS_KERNEL_FPU_SUPPORT
17696cbd1d6dSSamuel Holland	bool
17706cbd1d6dSSamuel Holland	help
17716cbd1d6dSSamuel Holland	  Architectures that select this option can run floating-point code in
17726cbd1d6dSSamuel Holland	  the kernel, as described in Documentation/core-api/floating-point.rst.
17736cbd1d6dSSamuel Holland
17749b400d17SArd Biesheuvelconfig ARCH_VMLINUX_NEEDS_RELOCS
17759b400d17SArd Biesheuvel	bool
17769b400d17SArd Biesheuvel	help
17779b400d17SArd Biesheuvel	  Whether the architecture needs vmlinux to be built with static
17789b400d17SArd Biesheuvel	  relocations preserved. This is used by some architectures to
17799b400d17SArd Biesheuvel	  construct bespoke relocation tables for KASLR.
17809b400d17SArd Biesheuvel
178129589343SThomas Gleixner# Select if architecture uses the common generic TIF bits
178229589343SThomas Gleixnerconfig HAVE_GENERIC_TIF_BITS
178329589343SThomas Gleixner       bool
178429589343SThomas Gleixner
17852521f2c2SPeter Oberparleitersource "kernel/gcov/Kconfig"
178645332b1bSMasahiro Yamada
178745332b1bSMasahiro Yamadasource "scripts/gcc-plugins/Kconfig"
1788fa1b5d09SLinus Torvalds
1789d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_4B
1790d49a0626SPeter Zijlstra	bool
1791d49a0626SPeter Zijlstra
1792d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_8B
1793d49a0626SPeter Zijlstra	bool
1794d49a0626SPeter Zijlstra
1795d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_16B
1796d49a0626SPeter Zijlstra	bool
1797d49a0626SPeter Zijlstra
1798d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_32B
1799d49a0626SPeter Zijlstra	bool
1800d49a0626SPeter Zijlstra
1801d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT_64B
1802d49a0626SPeter Zijlstra	bool
1803d49a0626SPeter Zijlstra
1804d49a0626SPeter Zijlstraconfig FUNCTION_ALIGNMENT
1805d49a0626SPeter Zijlstra	int
1806d49a0626SPeter Zijlstra	default 64 if FUNCTION_ALIGNMENT_64B
1807d49a0626SPeter Zijlstra	default 32 if FUNCTION_ALIGNMENT_32B
1808d49a0626SPeter Zijlstra	default 16 if FUNCTION_ALIGNMENT_16B
1809d49a0626SPeter Zijlstra	default 8 if FUNCTION_ALIGNMENT_8B
1810d49a0626SPeter Zijlstra	default 4 if FUNCTION_ALIGNMENT_4B
1811d49a0626SPeter Zijlstra	default 0
1812d49a0626SPeter Zijlstra
18135270316cSPetr Pavluconfig CC_HAS_MIN_FUNCTION_ALIGNMENT
18145270316cSPetr Pavlu	# Detect availability of the GCC option -fmin-function-alignment which
18155270316cSPetr Pavlu	# guarantees minimal alignment for all functions, unlike
18165270316cSPetr Pavlu	# -falign-functions which the compiler ignores for cold functions.
18175270316cSPetr Pavlu	def_bool $(cc-option, -fmin-function-alignment=8)
18185270316cSPetr Pavlu
18195270316cSPetr Pavluconfig CC_HAS_SANE_FUNCTION_ALIGNMENT
18205270316cSPetr Pavlu	# Set if the guaranteed alignment with -fmin-function-alignment is
18215270316cSPetr Pavlu	# available or extra care is required in the kernel. Clang provides
18225270316cSPetr Pavlu	# strict alignment always, even with -falign-functions.
18235270316cSPetr Pavlu	def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
18245270316cSPetr Pavlu
1825a88d970cSPaul E. McKenneyconfig ARCH_NEED_CMPXCHG_1_EMU
1826a88d970cSPaul E. McKenney	bool
1827a88d970cSPaul E. McKenney
18281198c9c6SNaveen N Raoconfig ARCH_WANTS_PRE_LINK_VMLINUX
18291198c9c6SNaveen N Rao	bool
18301198c9c6SNaveen N Rao	help
18311198c9c6SNaveen N Rao	  An architecture can select this if it provides arch/<arch>/tools/Makefile
18321198c9c6SNaveen N Rao	  with .arch.vmlinux.o target to be linked into vmlinux.
18331198c9c6SNaveen N Rao
1834735e5920SDavid Kaplanconfig ARCH_HAS_CPU_ATTACK_VECTORS
1835735e5920SDavid Kaplan	bool
1836735e5920SDavid Kaplan
183722471e13SRandy Dunlapendmenu
1838