8543bc3c21fe9ee3b3a1af0572fbea38fa20e20e
[platform/kernel/linux-rpi.git] / arch / Kconfig
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # General architecture dependent options
4 #
5
6 config CRASH_CORE
7         bool
8
9 config KEXEC_CORE
10         select CRASH_CORE
11         bool
12
13 config HAVE_IMA_KEXEC
14         bool
15
16 config HOTPLUG_SMT
17         bool
18
19 config OPROFILE
20         tristate "OProfile system profiling"
21         depends on PROFILING
22         depends on HAVE_OPROFILE
23         select RING_BUFFER
24         select RING_BUFFER_ALLOW_SWAP
25         help
26           OProfile is a profiling system capable of profiling the
27           whole system, include the kernel, kernel modules, libraries,
28           and applications.
29
30           If unsure, say N.
31
32 config OPROFILE_EVENT_MULTIPLEX
33         bool "OProfile multiplexing support (EXPERIMENTAL)"
34         default n
35         depends on OPROFILE && X86
36         help
37           The number of hardware counters is limited. The multiplexing
38           feature enables OProfile to gather more events than counters
39           are provided by the hardware. This is realized by switching
40           between events at a user specified time interval.
41
42           If unsure, say N.
43
44 config HAVE_OPROFILE
45         bool
46
47 config OPROFILE_NMI_TIMER
48         def_bool y
49         depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
50
51 config KPROBES
52         bool "Kprobes"
53         depends on MODULES
54         depends on HAVE_KPROBES
55         select KALLSYMS
56         help
57           Kprobes allows you to trap at almost any kernel address and
58           execute a callback function.  register_kprobe() establishes
59           a probepoint and specifies the callback.  Kprobes is useful
60           for kernel debugging, non-intrusive instrumentation and testing.
61           If in doubt, say "N".
62
63 config JUMP_LABEL
64        bool "Optimize very unlikely/likely branches"
65        depends on HAVE_ARCH_JUMP_LABEL
66        help
67          This option enables a transparent branch optimization that
68          makes certain almost-always-true or almost-always-false branch
69          conditions even cheaper to execute within the kernel.
70
71          Certain performance-sensitive kernel code, such as trace points,
72          scheduler functionality, networking code and KVM have such
73          branches and include support for this optimization technique.
74
75          If it is detected that the compiler has support for "asm goto",
76          the kernel will compile such branches with just a nop
77          instruction. When the condition flag is toggled to true, the
78          nop will be converted to a jump instruction to execute the
79          conditional block of instructions.
80
81          This technique lowers overhead and stress on the branch prediction
82          of the processor and generally makes the kernel faster. The update
83          of the condition is slower, but those are always very rare.
84
85          ( On 32-bit x86, the necessary options added to the compiler
86            flags may increase the size of the kernel slightly. )
87
88 config STATIC_KEYS_SELFTEST
89         bool "Static key selftest"
90         depends on JUMP_LABEL
91         help
92           Boot time self-test of the branch patching code.
93
94 config OPTPROBES
95         def_bool y
96         depends on KPROBES && HAVE_OPTPROBES
97         select TASKS_RCU if PREEMPT
98
99 config KPROBES_ON_FTRACE
100         def_bool y
101         depends on KPROBES && HAVE_KPROBES_ON_FTRACE
102         depends on DYNAMIC_FTRACE_WITH_REGS
103         help
104          If function tracer is enabled and the arch supports full
105          passing of pt_regs to function tracing, then kprobes can
106          optimize on top of function tracing.
107
108 config UPROBES
109         def_bool n
110         depends on ARCH_SUPPORTS_UPROBES
111         help
112           Uprobes is the user-space counterpart to kprobes: they
113           enable instrumentation applications (such as 'perf probe')
114           to establish unintrusive probes in user-space binaries and
115           libraries, by executing handler functions when the probes
116           are hit by user-space applications.
117
118           ( These probes come in the form of single-byte breakpoints,
119             managed by the kernel and kept transparent to the probed
120             application. )
121
122 config HAVE_64BIT_ALIGNED_ACCESS
123         def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
124         help
125           Some architectures require 64 bit accesses to be 64 bit
126           aligned, which also requires structs containing 64 bit values
127           to be 64 bit aligned too. This includes some 32 bit
128           architectures which can do 64 bit accesses, as well as 64 bit
129           architectures without unaligned access.
130
131           This symbol should be selected by an architecture if 64 bit
132           accesses are required to be 64 bit aligned in this way even
133           though it is not a 64 bit architecture.
134
135           See Documentation/unaligned-memory-access.txt for more
136           information on the topic of unaligned memory accesses.
137
138 config HAVE_EFFICIENT_UNALIGNED_ACCESS
139         bool
140         help
141           Some architectures are unable to perform unaligned accesses
142           without the use of get_unaligned/put_unaligned. Others are
143           unable to perform such accesses efficiently (e.g. trap on
144           unaligned access and require fixing it up in the exception
145           handler.)
146
147           This symbol should be selected by an architecture if it can
148           perform unaligned accesses efficiently to allow different
149           code paths to be selected for these cases. Some network
150           drivers, for example, could opt to not fix up alignment
151           problems with received packets if doing so would not help
152           much.
153
154           See Documentation/unaligned-memory-access.txt for more
155           information on the topic of unaligned memory accesses.
156
157 config ARCH_USE_BUILTIN_BSWAP
158        bool
159        help
160          Modern versions of GCC (since 4.4) have builtin functions
161          for handling byte-swapping. Using these, instead of the old
162          inline assembler that the architecture code provides in the
163          __arch_bswapXX() macros, allows the compiler to see what's
164          happening and offers more opportunity for optimisation. In
165          particular, the compiler will be able to combine the byteswap
166          with a nearby load or store and use load-and-swap or
167          store-and-swap instructions if the architecture has them. It
168          should almost *never* result in code which is worse than the
169          hand-coded assembler in <asm/swab.h>.  But just in case it
170          does, the use of the builtins is optional.
171
172          Any architecture with load-and-swap or store-and-swap
173          instructions should set this. And it shouldn't hurt to set it
174          on architectures that don't have such instructions.
175
176 config KRETPROBES
177         def_bool y
178         depends on KPROBES && HAVE_KRETPROBES
179
180 config USER_RETURN_NOTIFIER
181         bool
182         depends on HAVE_USER_RETURN_NOTIFIER
183         help
184           Provide a kernel-internal notification when a cpu is about to
185           switch to user mode.
186
187 config HAVE_IOREMAP_PROT
188         bool
189
190 config HAVE_KPROBES
191         bool
192
193 config HAVE_KRETPROBES
194         bool
195
196 config HAVE_OPTPROBES
197         bool
198
199 config HAVE_KPROBES_ON_FTRACE
200         bool
201
202 config HAVE_FUNCTION_ERROR_INJECTION
203         bool
204
205 config HAVE_NMI
206         bool
207
208 #
209 # An arch should select this if it provides all these things:
210 #
211 #       task_pt_regs()          in asm/processor.h or asm/ptrace.h
212 #       arch_has_single_step()  if there is hardware single-step support
213 #       arch_has_block_step()   if there is hardware block-step support
214 #       asm/syscall.h           supplying asm-generic/syscall.h interface
215 #       linux/regset.h          user_regset interfaces
216 #       CORE_DUMP_USE_REGSET    #define'd in linux/elf.h
217 #       TIF_SYSCALL_TRACE       calls tracehook_report_syscall_{entry,exit}
218 #       TIF_NOTIFY_RESUME       calls tracehook_notify_resume()
219 #       signal delivery         calls tracehook_signal_handler()
220 #
221 config HAVE_ARCH_TRACEHOOK
222         bool
223
224 config HAVE_DMA_CONTIGUOUS
225         bool
226
227 config GENERIC_SMP_IDLE_THREAD
228        bool
229
230 config GENERIC_IDLE_POLL_SETUP
231        bool
232
233 config ARCH_HAS_FORTIFY_SOURCE
234         bool
235         help
236           An architecture should select this when it can successfully
237           build and run with CONFIG_FORTIFY_SOURCE.
238
239 # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
240 config ARCH_HAS_SET_MEMORY
241         bool
242
243 # Select if arch init_task must go in the __init_task_data section
244 config ARCH_TASK_STRUCT_ON_STACK
245        bool
246
247 # Select if arch has its private alloc_task_struct() function
248 config ARCH_TASK_STRUCT_ALLOCATOR
249         bool
250
251 config HAVE_ARCH_THREAD_STRUCT_WHITELIST
252         bool
253         depends on !ARCH_TASK_STRUCT_ALLOCATOR
254         help
255           An architecture should select this to provide hardened usercopy
256           knowledge about what region of the thread_struct should be
257           whitelisted for copying to userspace. Normally this is only the
258           FPU registers. Specifically, arch_thread_struct_whitelist()
259           should be implemented. Without this, the entire thread_struct
260           field in task_struct will be left whitelisted.
261
262 # Select if arch has its private alloc_thread_stack() function
263 config ARCH_THREAD_STACK_ALLOCATOR
264         bool
265
266 # Select if arch wants to size task_struct dynamically via arch_task_struct_size:
267 config ARCH_WANTS_DYNAMIC_TASK_STRUCT
268         bool
269
270 config HAVE_REGS_AND_STACK_ACCESS_API
271         bool
272         help
273           This symbol should be selected by an architecure if it supports
274           the API needed to access registers and stack entries from pt_regs,
275           declared in asm/ptrace.h
276           For example the kprobes-based event tracer needs this API.
277
278 config HAVE_RSEQ
279         bool
280         depends on HAVE_REGS_AND_STACK_ACCESS_API
281         help
282           This symbol should be selected by an architecture if it
283           supports an implementation of restartable sequences.
284
285 config HAVE_CLK
286         bool
287         help
288           The <linux/clk.h> calls support software clock gating and
289           thus are a key power management tool on many systems.
290
291 config HAVE_HW_BREAKPOINT
292         bool
293         depends on PERF_EVENTS
294
295 config HAVE_MIXED_BREAKPOINTS_REGS
296         bool
297         depends on HAVE_HW_BREAKPOINT
298         help
299           Depending on the arch implementation of hardware breakpoints,
300           some of them have separate registers for data and instruction
301           breakpoints addresses, others have mixed registers to store
302           them but define the access type in a control register.
303           Select this option if your arch implements breakpoints under the
304           latter fashion.
305
306 config HAVE_USER_RETURN_NOTIFIER
307         bool
308
309 config HAVE_PERF_EVENTS_NMI
310         bool
311         help
312           System hardware can generate an NMI using the perf event
313           subsystem.  Also has support for calculating CPU cycle events
314           to determine how many clock cycles in a given period.
315
316 config HAVE_HARDLOCKUP_DETECTOR_PERF
317         bool
318         depends on HAVE_PERF_EVENTS_NMI
319         help
320           The arch chooses to use the generic perf-NMI-based hardlockup
321           detector. Must define HAVE_PERF_EVENTS_NMI.
322
323 config HAVE_NMI_WATCHDOG
324         depends on HAVE_NMI
325         bool
326         help
327           The arch provides a low level NMI watchdog. It provides
328           asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
329
330 config HAVE_HARDLOCKUP_DETECTOR_ARCH
331         bool
332         select HAVE_NMI_WATCHDOG
333         help
334           The arch chooses to provide its own hardlockup detector, which is
335           a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
336           interfaces and parameters provided by hardlockup detector subsystem.
337
338 config HAVE_PERF_REGS
339         bool
340         help
341           Support selective register dumps for perf events. This includes
342           bit-mapping of each registers and a unique architecture id.
343
344 config HAVE_PERF_USER_STACK_DUMP
345         bool
346         help
347           Support user stack dumps for perf event samples. This needs
348           access to the user stack pointer which is not unified across
349           architectures.
350
351 config HAVE_ARCH_JUMP_LABEL
352         bool
353
354 config HAVE_RCU_TABLE_FREE
355         bool
356
357 config ARCH_HAVE_NMI_SAFE_CMPXCHG
358         bool
359
360 config HAVE_ALIGNED_STRUCT_PAGE
361         bool
362         help
363           This makes sure that struct pages are double word aligned and that
364           e.g. the SLUB allocator can perform double word atomic operations
365           on a struct page for better performance. However selecting this
366           might increase the size of a struct page by a word.
367
368 config HAVE_CMPXCHG_LOCAL
369         bool
370
371 config HAVE_CMPXCHG_DOUBLE
372         bool
373
374 config ARCH_WEAK_RELEASE_ACQUIRE
375         bool
376
377 config ARCH_WANT_IPC_PARSE_VERSION
378         bool
379
380 config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
381         bool
382
383 config ARCH_WANT_OLD_COMPAT_IPC
384         select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
385         bool
386
387 config HAVE_ARCH_SECCOMP_FILTER
388         bool
389         help
390           An arch should select this symbol if it provides all of these things:
391           - syscall_get_arch()
392           - syscall_get_arguments()
393           - syscall_rollback()
394           - syscall_set_return_value()
395           - SIGSYS siginfo_t support
396           - secure_computing is called from a ptrace_event()-safe context
397           - secure_computing return value is checked and a return value of -1
398             results in the system call being skipped immediately.
399           - seccomp syscall wired up
400
401 config SECCOMP_FILTER
402         def_bool y
403         depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
404         help
405           Enable tasks to build secure computing environments defined
406           in terms of Berkeley Packet Filter programs which implement
407           task-defined system call filtering polices.
408
409           See Documentation/userspace-api/seccomp_filter.rst for details.
410
411 config HAVE_STACKPROTECTOR
412         bool
413         help
414           An arch should select this symbol if:
415           - it has implemented a stack canary (e.g. __stack_chk_guard)
416
417 config CC_HAS_STACKPROTECTOR_NONE
418         def_bool $(cc-option,-fno-stack-protector)
419
420 config STACKPROTECTOR
421         bool "Stack Protector buffer overflow detection"
422         depends on HAVE_STACKPROTECTOR
423         depends on $(cc-option,-fstack-protector)
424         default y
425         help
426           This option turns on the "stack-protector" GCC feature. This
427           feature puts, at the beginning of functions, a canary value on
428           the stack just before the return address, and validates
429           the value just before actually returning.  Stack based buffer
430           overflows (that need to overwrite this return address) now also
431           overwrite the canary, which gets detected and the attack is then
432           neutralized via a kernel panic.
433
434           Functions will have the stack-protector canary logic added if they
435           have an 8-byte or larger character array on the stack.
436
437           This feature requires gcc version 4.2 or above, or a distribution
438           gcc with the feature backported ("-fstack-protector").
439
440           On an x86 "defconfig" build, this feature adds canary checks to
441           about 3% of all kernel functions, which increases kernel code size
442           by about 0.3%.
443
444 config STACKPROTECTOR_STRONG
445         bool "Strong Stack Protector"
446         depends on STACKPROTECTOR
447         depends on $(cc-option,-fstack-protector-strong)
448         default y
449         help
450           Functions will have the stack-protector canary logic added in any
451           of the following conditions:
452
453           - local variable's address used as part of the right hand side of an
454             assignment or function argument
455           - local variable is an array (or union containing an array),
456             regardless of array type or length
457           - uses register local variables
458
459           This feature requires gcc version 4.9 or above, or a distribution
460           gcc with the feature backported ("-fstack-protector-strong").
461
462           On an x86 "defconfig" build, this feature adds canary checks to
463           about 20% of all kernel functions, which increases the kernel code
464           size by about 2%.
465
466 config HAVE_ARCH_WITHIN_STACK_FRAMES
467         bool
468         help
469           An architecture should select this if it can walk the kernel stack
470           frames to determine if an object is part of either the arguments
471           or local variables (i.e. that it excludes saved return addresses,
472           and similar) by implementing an inline arch_within_stack_frames(),
473           which is used by CONFIG_HARDENED_USERCOPY.
474
475 config HAVE_CONTEXT_TRACKING
476         bool
477         help
478           Provide kernel/user boundaries probes necessary for subsystems
479           that need it, such as userspace RCU extended quiescent state.
480           Syscalls need to be wrapped inside user_exit()-user_enter() through
481           the slow path using TIF_NOHZ flag. Exceptions handlers must be
482           wrapped as well. Irqs are already protected inside
483           rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
484           irq exit still need to be protected.
485
486 config HAVE_VIRT_CPU_ACCOUNTING
487         bool
488
489 config ARCH_HAS_SCALED_CPUTIME
490         bool
491
492 config HAVE_VIRT_CPU_ACCOUNTING_GEN
493         bool
494         default y if 64BIT
495         help
496           With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
497           Before enabling this option, arch code must be audited
498           to ensure there are no races in concurrent read/write of
499           cputime_t. For example, reading/writing 64-bit cputime_t on
500           some 32-bit arches may require multiple accesses, so proper
501           locking is needed to protect against concurrent accesses.
502
503
504 config HAVE_IRQ_TIME_ACCOUNTING
505         bool
506         help
507           Archs need to ensure they use a high enough resolution clock to
508           support irq time accounting and then call enable_sched_clock_irqtime().
509
510 config HAVE_ARCH_TRANSPARENT_HUGEPAGE
511         bool
512
513 config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
514         bool
515
516 config HAVE_ARCH_HUGE_VMAP
517         bool
518
519 config HAVE_ARCH_SOFT_DIRTY
520         bool
521
522 config HAVE_MOD_ARCH_SPECIFIC
523         bool
524         help
525           The arch uses struct mod_arch_specific to store data.  Many arches
526           just need a simple module loader without arch specific data - those
527           should not enable this.
528
529 config MODULES_USE_ELF_RELA
530         bool
531         help
532           Modules only use ELF RELA relocations.  Modules with ELF REL
533           relocations will give an error.
534
535 config MODULES_USE_ELF_REL
536         bool
537         help
538           Modules only use ELF REL relocations.  Modules with ELF RELA
539           relocations will give an error.
540
541 config HAVE_IRQ_EXIT_ON_IRQ_STACK
542         bool
543         help
544           Architecture doesn't only execute the irq handler on the irq stack
545           but also irq_exit(). This way we can process softirqs on this irq
546           stack instead of switching to a new one when we call __do_softirq()
547           in the end of an hardirq.
548           This spares a stack switch and improves cache usage on softirq
549           processing.
550
551 config PGTABLE_LEVELS
552         int
553         default 2
554
555 config ARCH_HAS_ELF_RANDOMIZE
556         bool
557         help
558           An architecture supports choosing randomized locations for
559           stack, mmap, brk, and ET_DYN. Defined functions:
560           - arch_mmap_rnd()
561           - arch_randomize_brk()
562
563 config HAVE_ARCH_MMAP_RND_BITS
564         bool
565         help
566           An arch should select this symbol if it supports setting a variable
567           number of bits for use in establishing the base address for mmap
568           allocations, has MMU enabled and provides values for both:
569           - ARCH_MMAP_RND_BITS_MIN
570           - ARCH_MMAP_RND_BITS_MAX
571
572 config HAVE_EXIT_THREAD
573         bool
574         help
575           An architecture implements exit_thread.
576
577 config ARCH_MMAP_RND_BITS_MIN
578         int
579
580 config ARCH_MMAP_RND_BITS_MAX
581         int
582
583 config ARCH_MMAP_RND_BITS_DEFAULT
584         int
585
586 config ARCH_MMAP_RND_BITS
587         int "Number of bits to use for ASLR of mmap base address" if EXPERT
588         range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
589         default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
590         default ARCH_MMAP_RND_BITS_MIN
591         depends on HAVE_ARCH_MMAP_RND_BITS
592         help
593           This value can be used to select the number of bits to use to
594           determine the random offset to the base address of vma regions
595           resulting from mmap allocations. This value will be bounded
596           by the architecture's minimum and maximum supported values.
597
598           This value can be changed after boot using the
599           /proc/sys/vm/mmap_rnd_bits tunable
600
601 config HAVE_ARCH_MMAP_RND_COMPAT_BITS
602         bool
603         help
604           An arch should select this symbol if it supports running applications
605           in compatibility mode, supports setting a variable number of bits for
606           use in establishing the base address for mmap allocations, has MMU
607           enabled and provides values for both:
608           - ARCH_MMAP_RND_COMPAT_BITS_MIN
609           - ARCH_MMAP_RND_COMPAT_BITS_MAX
610
611 config ARCH_MMAP_RND_COMPAT_BITS_MIN
612         int
613
614 config ARCH_MMAP_RND_COMPAT_BITS_MAX
615         int
616
617 config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
618         int
619
620 config ARCH_MMAP_RND_COMPAT_BITS
621         int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
622         range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
623         default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
624         default ARCH_MMAP_RND_COMPAT_BITS_MIN
625         depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
626         help
627           This value can be used to select the number of bits to use to
628           determine the random offset to the base address of vma regions
629           resulting from mmap allocations for compatible applications This
630           value will be bounded by the architecture's minimum and maximum
631           supported values.
632
633           This value can be changed after boot using the
634           /proc/sys/vm/mmap_rnd_compat_bits tunable
635
636 config HAVE_ARCH_COMPAT_MMAP_BASES
637         bool
638         help
639           This allows 64bit applications to invoke 32-bit mmap() syscall
640           and vice-versa 32-bit applications to call 64-bit mmap().
641           Required for applications doing different bitness syscalls.
642
643 config HAVE_COPY_THREAD_TLS
644         bool
645         help
646           Architecture provides copy_thread_tls to accept tls argument via
647           normal C parameter passing, rather than extracting the syscall
648           argument from pt_regs.
649
650 config HAVE_STACK_VALIDATION
651         bool
652         help
653           Architecture supports the 'objtool check' host tool command, which
654           performs compile-time stack metadata validation.
655
656 config HAVE_RELIABLE_STACKTRACE
657         bool
658         help
659           Architecture has a save_stack_trace_tsk_reliable() function which
660           only returns a stack trace if it can guarantee the trace is reliable.
661
662 config HAVE_ARCH_HASH
663         bool
664         default n
665         help
666           If this is set, the architecture provides an <asm/hash.h>
667           file which provides platform-specific implementations of some
668           functions in <linux/hash.h> or fs/namei.c.
669
670 config ISA_BUS_API
671         def_bool ISA
672
673 #
674 # ABI hall of shame
675 #
676 config CLONE_BACKWARDS
677         bool
678         help
679           Architecture has tls passed as the 4th argument of clone(2),
680           not the 5th one.
681
682 config CLONE_BACKWARDS2
683         bool
684         help
685           Architecture has the first two arguments of clone(2) swapped.
686
687 config CLONE_BACKWARDS3
688         bool
689         help
690           Architecture has tls passed as the 3rd argument of clone(2),
691           not the 5th one.
692
693 config ODD_RT_SIGACTION
694         bool
695         help
696           Architecture has unusual rt_sigaction(2) arguments
697
698 config OLD_SIGSUSPEND
699         bool
700         help
701           Architecture has old sigsuspend(2) syscall, of one-argument variety
702
703 config OLD_SIGSUSPEND3
704         bool
705         help
706           Even weirder antique ABI - three-argument sigsuspend(2)
707
708 config OLD_SIGACTION
709         bool
710         help
711           Architecture has old sigaction(2) syscall.  Nope, not the same
712           as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
713           but fairly different variant of sigaction(2), thanks to OSF/1
714           compatibility...
715
716 config COMPAT_OLD_SIGACTION
717         bool
718
719 config 64BIT_TIME
720         def_bool ARCH_HAS_64BIT_TIME
721         help
722           This should be selected by all architectures that need to support
723           new system calls with a 64-bit time_t. This is relevant on all 32-bit
724           architectures, and 64-bit architectures as part of compat syscall
725           handling.
726
727 config COMPAT_32BIT_TIME
728         def_bool (!64BIT && 64BIT_TIME) || COMPAT
729         help
730           This enables 32 bit time_t support in addition to 64 bit time_t support.
731           This is relevant on all 32-bit architectures, and 64-bit architectures
732           as part of compat syscall handling.
733
734 config ARCH_NO_COHERENT_DMA_MMAP
735         bool
736
737 config CPU_NO_EFFICIENT_FFS
738         def_bool n
739
740 config HAVE_ARCH_VMAP_STACK
741         def_bool n
742         help
743           An arch should select this symbol if it can support kernel stacks
744           in vmalloc space.  This means:
745
746           - vmalloc space must be large enough to hold many kernel stacks.
747             This may rule out many 32-bit architectures.
748
749           - Stacks in vmalloc space need to work reliably.  For example, if
750             vmap page tables are created on demand, either this mechanism
751             needs to work while the stack points to a virtual address with
752             unpopulated page tables or arch code (switch_to() and switch_mm(),
753             most likely) needs to ensure that the stack's page table entries
754             are populated before running on a possibly unpopulated stack.
755
756           - If the stack overflows into a guard page, something reasonable
757             should happen.  The definition of "reasonable" is flexible, but
758             instantly rebooting without logging anything would be unfriendly.
759
760 config VMAP_STACK
761         default y
762         bool "Use a virtually-mapped stack"
763         depends on HAVE_ARCH_VMAP_STACK && !KASAN
764         ---help---
765           Enable this if you want the use virtually-mapped kernel stacks
766           with guard pages.  This causes kernel stack overflows to be
767           caught immediately rather than causing difficult-to-diagnose
768           corruption.
769
770           This is presently incompatible with KASAN because KASAN expects
771           the stack to map directly to the KASAN shadow map using a formula
772           that is incorrect if the stack is in vmalloc space.
773
774 config ARCH_OPTIONAL_KERNEL_RWX
775         def_bool n
776
777 config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
778         def_bool n
779
780 config ARCH_HAS_STRICT_KERNEL_RWX
781         def_bool n
782
783 config STRICT_KERNEL_RWX
784         bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
785         depends on ARCH_HAS_STRICT_KERNEL_RWX
786         default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
787         help
788           If this is set, kernel text and rodata memory will be made read-only,
789           and non-text memory will be made non-executable. This provides
790           protection against certain security exploits (e.g. executing the heap
791           or modifying text)
792
793           These features are considered standard security practice these days.
794           You should say Y here in almost all cases.
795
796 config ARCH_HAS_STRICT_MODULE_RWX
797         def_bool n
798
799 config STRICT_MODULE_RWX
800         bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
801         depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
802         default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
803         help
804           If this is set, module text and rodata memory will be made read-only,
805           and non-text memory will be made non-executable. This provides
806           protection against certain security exploits (e.g. writing to text)
807
808 # select if the architecture provides an asm/dma-direct.h header
809 config ARCH_HAS_PHYS_TO_DMA
810         bool
811
812 config ARCH_HAS_REFCOUNT
813         bool
814         help
815           An architecture selects this when it has implemented refcount_t
816           using open coded assembly primitives that provide an optimized
817           refcount_t implementation, possibly at the expense of some full
818           refcount state checks of CONFIG_REFCOUNT_FULL=y.
819
820           The refcount overflow check behavior, however, must be retained.
821           Catching overflows is the primary security concern for protecting
822           against bugs in reference counts.
823
824 config REFCOUNT_FULL
825         bool "Perform full reference count validation at the expense of speed"
826         help
827           Enabling this switches the refcounting infrastructure from a fast
828           unchecked atomic_t implementation to a fully state checked
829           implementation, which can be (slightly) slower but provides protections
830           against various use-after-free conditions that can be used in
831           security flaw exploits.
832
833 source "kernel/gcov/Kconfig"
834
835 source "scripts/gcc-plugins/Kconfig"