1# SPDX-License-Identifier: GPL-2.0 2# 3# General architecture dependent options 4# 5 6# 7# Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can 8# override the default values in this file. 9# 10source "arch/$(SRCARCH)/Kconfig" 11 12config ARCH_CONFIGURES_CPU_MITIGATIONS 13 bool 14 15if !ARCH_CONFIGURES_CPU_MITIGATIONS 16config CPU_MITIGATIONS 17 def_bool y 18endif 19 20menu "General architecture-dependent options" 21 22config ARCH_HAS_SUBPAGE_FAULTS 23 bool 24 help 25 Select if the architecture can check permissions at sub-page 26 granularity (e.g. arm64 MTE). The probe_user_*() functions 27 must be implemented. 28 29config HOTPLUG_SMT 30 bool 31 32config SMT_NUM_THREADS_DYNAMIC 33 bool 34 35# Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL 36config HOTPLUG_CORE_SYNC 37 bool 38 39# Basic CPU dead synchronization selected by architecture 40config HOTPLUG_CORE_SYNC_DEAD 41 bool 42 select HOTPLUG_CORE_SYNC 43 44# Full CPU synchronization with alive state selected by architecture 45config HOTPLUG_CORE_SYNC_FULL 46 bool 47 select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU 48 select HOTPLUG_CORE_SYNC 49 50config HOTPLUG_SPLIT_STARTUP 51 bool 52 select HOTPLUG_CORE_SYNC_FULL 53 54config HOTPLUG_PARALLEL 55 bool 56 select HOTPLUG_SPLIT_STARTUP 57 58config GENERIC_ENTRY 59 bool 60 61config KPROBES 62 bool "Kprobes" 63 depends on MODULES 64 depends on HAVE_KPROBES 65 select KALLSYMS 66 select TASKS_RCU if PREEMPTION 67 help 68 Kprobes allows you to trap at almost any kernel address and 69 execute a callback function. register_kprobe() establishes 70 a probepoint and specifies the callback. Kprobes is useful 71 for kernel debugging, non-intrusive instrumentation and testing. 72 If in doubt, say "N". 73 74config JUMP_LABEL 75 bool "Optimize very unlikely/likely branches" 76 depends on HAVE_ARCH_JUMP_LABEL 77 select OBJTOOL if HAVE_JUMP_LABEL_HACK 78 help 79 This option enables a transparent branch optimization that 80 makes certain almost-always-true or almost-always-false branch 81 conditions even cheaper to execute within the kernel. 82 83 Certain performance-sensitive kernel code, such as trace points, 84 scheduler functionality, networking code and KVM have such 85 branches and include support for this optimization technique. 86 87 If it is detected that the compiler has support for "asm goto", 88 the kernel will compile such branches with just a nop 89 instruction. When the condition flag is toggled to true, the 90 nop will be converted to a jump instruction to execute the 91 conditional block of instructions. 92 93 This technique lowers overhead and stress on the branch prediction 94 of the processor and generally makes the kernel faster. The update 95 of the condition is slower, but those are always very rare. 96 97 ( On 32-bit x86, the necessary options added to the compiler 98 flags may increase the size of the kernel slightly. ) 99 100config STATIC_KEYS_SELFTEST 101 bool "Static key selftest" 102 depends on JUMP_LABEL 103 help 104 Boot time self-test of the branch patching code. 105 106config STATIC_CALL_SELFTEST 107 bool "Static call selftest" 108 depends on HAVE_STATIC_CALL 109 help 110 Boot time self-test of the call patching code. 111 112config OPTPROBES 113 def_bool y 114 depends on KPROBES && HAVE_OPTPROBES 115 select TASKS_RCU if PREEMPTION 116 117config KPROBES_ON_FTRACE 118 def_bool y 119 depends on KPROBES && HAVE_KPROBES_ON_FTRACE 120 depends on DYNAMIC_FTRACE_WITH_REGS 121 help 122 If function tracer is enabled and the arch supports full 123 passing of pt_regs to function tracing, then kprobes can 124 optimize on top of function tracing. 125 126config UPROBES 127 def_bool n 128 depends on ARCH_SUPPORTS_UPROBES 129 help 130 Uprobes is the user-space counterpart to kprobes: they 131 enable instrumentation applications (such as 'perf probe') 132 to establish unintrusive probes in user-space binaries and 133 libraries, by executing handler functions when the probes 134 are hit by user-space applications. 135 136 ( These probes come in the form of single-byte breakpoints, 137 managed by the kernel and kept transparent to the probed 138 application. ) 139 140config HAVE_64BIT_ALIGNED_ACCESS 141 def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS 142 help 143 Some architectures require 64 bit accesses to be 64 bit 144 aligned, which also requires structs containing 64 bit values 145 to be 64 bit aligned too. This includes some 32 bit 146 architectures which can do 64 bit accesses, as well as 64 bit 147 architectures without unaligned access. 148 149 This symbol should be selected by an architecture if 64 bit 150 accesses are required to be 64 bit aligned in this way even 151 though it is not a 64 bit architecture. 152 153 See Documentation/core-api/unaligned-memory-access.rst for 154 more information on the topic of unaligned memory accesses. 155 156config HAVE_EFFICIENT_UNALIGNED_ACCESS 157 bool 158 help 159 Some architectures are unable to perform unaligned accesses 160 without the use of get_unaligned/put_unaligned. Others are 161 unable to perform such accesses efficiently (e.g. trap on 162 unaligned access and require fixing it up in the exception 163 handler.) 164 165 This symbol should be selected by an architecture if it can 166 perform unaligned accesses efficiently to allow different 167 code paths to be selected for these cases. Some network 168 drivers, for example, could opt to not fix up alignment 169 problems with received packets if doing so would not help 170 much. 171 172 See Documentation/core-api/unaligned-memory-access.rst for more 173 information on the topic of unaligned memory accesses. 174 175config ARCH_USE_BUILTIN_BSWAP 176 bool 177 help 178 Modern versions of GCC (since 4.4) have builtin functions 179 for handling byte-swapping. Using these, instead of the old 180 inline assembler that the architecture code provides in the 181 __arch_bswapXX() macros, allows the compiler to see what's 182 happening and offers more opportunity for optimisation. In 183 particular, the compiler will be able to combine the byteswap 184 with a nearby load or store and use load-and-swap or 185 store-and-swap instructions if the architecture has them. It 186 should almost *never* result in code which is worse than the 187 hand-coded assembler in <asm/swab.h>. But just in case it 188 does, the use of the builtins is optional. 189 190 Any architecture with load-and-swap or store-and-swap 191 instructions should set this. And it shouldn't hurt to set it 192 on architectures that don't have such instructions. 193 194config KRETPROBES 195 def_bool y 196 depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK) 197 198config KRETPROBE_ON_RETHOOK 199 def_bool y 200 depends on HAVE_RETHOOK 201 depends on KRETPROBES 202 select RETHOOK 203 204config USER_RETURN_NOTIFIER 205 bool 206 depends on HAVE_USER_RETURN_NOTIFIER 207 help 208 Provide a kernel-internal notification when a cpu is about to 209 switch to user mode. 210 211config HAVE_IOREMAP_PROT 212 bool 213 214config HAVE_KPROBES 215 bool 216 217config HAVE_KRETPROBES 218 bool 219 220config HAVE_OPTPROBES 221 bool 222 223config HAVE_KPROBES_ON_FTRACE 224 bool 225 226config ARCH_CORRECT_STACKTRACE_ON_KRETPROBE 227 bool 228 help 229 Since kretprobes modifies return address on the stack, the 230 stacktrace may see the kretprobe trampoline address instead 231 of correct one. If the architecture stacktrace code and 232 unwinder can adjust such entries, select this configuration. 233 234config HAVE_FUNCTION_ERROR_INJECTION 235 bool 236 237config HAVE_NMI 238 bool 239 240config HAVE_FUNCTION_DESCRIPTORS 241 bool 242 243config TRACE_IRQFLAGS_SUPPORT 244 bool 245 246config TRACE_IRQFLAGS_NMI_SUPPORT 247 bool 248 249# 250# An arch should select this if it provides all these things: 251# 252# task_pt_regs() in asm/processor.h or asm/ptrace.h 253# arch_has_single_step() if there is hardware single-step support 254# arch_has_block_step() if there is hardware block-step support 255# asm/syscall.h supplying asm-generic/syscall.h interface 256# linux/regset.h user_regset interfaces 257# CORE_DUMP_USE_REGSET #define'd in linux/elf.h 258# TIF_SYSCALL_TRACE calls ptrace_report_syscall_{entry,exit} 259# TIF_NOTIFY_RESUME calls resume_user_mode_work() 260# 261config HAVE_ARCH_TRACEHOOK 262 bool 263 264config HAVE_DMA_CONTIGUOUS 265 bool 266 267config GENERIC_SMP_IDLE_THREAD 268 bool 269 270config GENERIC_IDLE_POLL_SETUP 271 bool 272 273config ARCH_HAS_FORTIFY_SOURCE 274 bool 275 help 276 An architecture should select this when it can successfully 277 build and run with CONFIG_FORTIFY_SOURCE. 278 279# 280# Select if the arch provides a historic keepinit alias for the retain_initrd 281# command line option 282# 283config ARCH_HAS_KEEPINITRD 284 bool 285 286# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h 287config ARCH_HAS_SET_MEMORY 288 bool 289 290# Select if arch has all set_direct_map_invalid/default() functions 291config ARCH_HAS_SET_DIRECT_MAP 292 bool 293 294# 295# Select if the architecture provides the arch_dma_set_uncached symbol to 296# either provide an uncached segment alias for a DMA allocation, or 297# to remap the page tables in place. 298# 299config ARCH_HAS_DMA_SET_UNCACHED 300 bool 301 302# 303# Select if the architectures provides the arch_dma_clear_uncached symbol 304# to undo an in-place page table remap for uncached access. 305# 306config ARCH_HAS_DMA_CLEAR_UNCACHED 307 bool 308 309config ARCH_HAS_CPU_FINALIZE_INIT 310 bool 311 312# Select if arch init_task must go in the __init_task_data section 313config ARCH_TASK_STRUCT_ON_STACK 314 bool 315 316# Select if arch has its private alloc_task_struct() function 317config ARCH_TASK_STRUCT_ALLOCATOR 318 bool 319 320config HAVE_ARCH_THREAD_STRUCT_WHITELIST 321 bool 322 depends on !ARCH_TASK_STRUCT_ALLOCATOR 323 help 324 An architecture should select this to provide hardened usercopy 325 knowledge about what region of the thread_struct should be 326 whitelisted for copying to userspace. Normally this is only the 327 FPU registers. Specifically, arch_thread_struct_whitelist() 328 should be implemented. Without this, the entire thread_struct 329 field in task_struct will be left whitelisted. 330 331# Select if arch has its private alloc_thread_stack() function 332config ARCH_THREAD_STACK_ALLOCATOR 333 bool 334 335# Select if arch wants to size task_struct dynamically via arch_task_struct_size: 336config ARCH_WANTS_DYNAMIC_TASK_STRUCT 337 bool 338 339config ARCH_WANTS_NO_INSTR 340 bool 341 help 342 An architecture should select this if the noinstr macro is being used on 343 functions to denote that the toolchain should avoid instrumenting such 344 functions and is required for correctness. 345 346config ARCH_32BIT_OFF_T 347 bool 348 depends on !64BIT 349 help 350 All new 32-bit architectures should have 64-bit off_t type on 351 userspace side which corresponds to the loff_t kernel type. This 352 is the requirement for modern ABIs. Some existing architectures 353 still support 32-bit off_t. This option is enabled for all such 354 architectures explicitly. 355 356# Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat 357config ARCH_32BIT_USTAT_F_TINODE 358 bool 359 360config HAVE_ASM_MODVERSIONS 361 bool 362 help 363 This symbol should be selected by an architecture if it provides 364 <asm/asm-prototypes.h> to support the module versioning for symbols 365 exported from assembly code. 366 367config HAVE_REGS_AND_STACK_ACCESS_API 368 bool 369 help 370 This symbol should be selected by an architecture if it supports 371 the API needed to access registers and stack entries from pt_regs, 372 declared in asm/ptrace.h 373 For example the kprobes-based event tracer needs this API. 374 375config HAVE_RSEQ 376 bool 377 depends on HAVE_REGS_AND_STACK_ACCESS_API 378 help 379 This symbol should be selected by an architecture if it 380 supports an implementation of restartable sequences. 381 382config HAVE_RUST 383 bool 384 help 385 This symbol should be selected by an architecture if it 386 supports Rust. 387 388config HAVE_FUNCTION_ARG_ACCESS_API 389 bool 390 help 391 This symbol should be selected by an architecture if it supports 392 the API needed to access function arguments from pt_regs, 393 declared in asm/ptrace.h 394 395config HAVE_HW_BREAKPOINT 396 bool 397 depends on PERF_EVENTS 398 399config HAVE_MIXED_BREAKPOINTS_REGS 400 bool 401 depends on HAVE_HW_BREAKPOINT 402 help 403 Depending on the arch implementation of hardware breakpoints, 404 some of them have separate registers for data and instruction 405 breakpoints addresses, others have mixed registers to store 406 them but define the access type in a control register. 407 Select this option if your arch implements breakpoints under the 408 latter fashion. 409 410config HAVE_USER_RETURN_NOTIFIER 411 bool 412 413config HAVE_PERF_EVENTS_NMI 414 bool 415 help 416 System hardware can generate an NMI using the perf event 417 subsystem. Also has support for calculating CPU cycle events 418 to determine how many clock cycles in a given period. 419 420config HAVE_HARDLOCKUP_DETECTOR_PERF 421 bool 422 depends on HAVE_PERF_EVENTS_NMI 423 help 424 The arch chooses to use the generic perf-NMI-based hardlockup 425 detector. Must define HAVE_PERF_EVENTS_NMI. 426 427config HAVE_HARDLOCKUP_DETECTOR_ARCH 428 bool 429 help 430 The arch provides its own hardlockup detector implementation instead 431 of the generic ones. 432 433 It uses the same command line parameters, and sysctl interface, 434 as the generic hardlockup detectors. 435 436config HAVE_PERF_REGS 437 bool 438 help 439 Support selective register dumps for perf events. This includes 440 bit-mapping of each registers and a unique architecture id. 441 442config HAVE_PERF_USER_STACK_DUMP 443 bool 444 help 445 Support user stack dumps for perf event samples. This needs 446 access to the user stack pointer which is not unified across 447 architectures. 448 449config HAVE_ARCH_JUMP_LABEL 450 bool 451 452config HAVE_ARCH_JUMP_LABEL_RELATIVE 453 bool 454 455config MMU_GATHER_TABLE_FREE 456 bool 457 458config MMU_GATHER_RCU_TABLE_FREE 459 bool 460 select MMU_GATHER_TABLE_FREE 461 462config MMU_GATHER_PAGE_SIZE 463 bool 464 465config MMU_GATHER_NO_RANGE 466 bool 467 select MMU_GATHER_MERGE_VMAS 468 469config MMU_GATHER_NO_FLUSH_CACHE 470 bool 471 472config MMU_GATHER_MERGE_VMAS 473 bool 474 475config MMU_GATHER_NO_GATHER 476 bool 477 depends on MMU_GATHER_TABLE_FREE 478 479config ARCH_WANT_IRQS_OFF_ACTIVATE_MM 480 bool 481 help 482 Temporary select until all architectures can be converted to have 483 irqs disabled over activate_mm. Architectures that do IPI based TLB 484 shootdowns should enable this. 485 486# Use normal mm refcounting for MMU_LAZY_TLB kernel thread references. 487# MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching 488# to/from kernel threads when the same mm is running on a lot of CPUs (a large 489# multi-threaded application), by reducing contention on the mm refcount. 490# 491# This can be disabled if the architecture ensures no CPUs are using an mm as a 492# "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm 493# or its kernel page tables). This could be arranged by arch_exit_mmap(), or 494# final exit(2) TLB flush, for example. 495# 496# To implement this, an arch *must*: 497# Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating 498# the lazy tlb reference of a kthread's ->active_mm (non-arch code has been 499# converted already). 500config MMU_LAZY_TLB_REFCOUNT 501 def_bool y 502 depends on !MMU_LAZY_TLB_SHOOTDOWN 503 504# This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an 505# mm as a lazy tlb beyond its last reference count, by shooting down these 506# users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may 507# be using the mm as a lazy tlb, so that they may switch themselves to using 508# init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs 509# may be using mm as a lazy tlb mm. 510# 511# To implement this, an arch *must*: 512# - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains 513# at least all possible CPUs in which the mm is lazy. 514# - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above). 515config MMU_LAZY_TLB_SHOOTDOWN 516 bool 517 518config ARCH_HAVE_NMI_SAFE_CMPXCHG 519 bool 520 521config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS 522 bool 523 524config HAVE_ALIGNED_STRUCT_PAGE 525 bool 526 help 527 This makes sure that struct pages are double word aligned and that 528 e.g. the SLUB allocator can perform double word atomic operations 529 on a struct page for better performance. However selecting this 530 might increase the size of a struct page by a word. 531 532config HAVE_CMPXCHG_LOCAL 533 bool 534 535config HAVE_CMPXCHG_DOUBLE 536 bool 537 538config ARCH_WEAK_RELEASE_ACQUIRE 539 bool 540 541config ARCH_WANT_IPC_PARSE_VERSION 542 bool 543 544config ARCH_WANT_COMPAT_IPC_PARSE_VERSION 545 bool 546 547config ARCH_WANT_OLD_COMPAT_IPC 548 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 549 bool 550 551config HAVE_ARCH_SECCOMP 552 bool 553 help 554 An arch should select this symbol to support seccomp mode 1 (the fixed 555 syscall policy), and must provide an overrides for __NR_seccomp_sigreturn, 556 and compat syscalls if the asm-generic/seccomp.h defaults need adjustment: 557 - __NR_seccomp_read_32 558 - __NR_seccomp_write_32 559 - __NR_seccomp_exit_32 560 - __NR_seccomp_sigreturn_32 561 562config HAVE_ARCH_SECCOMP_FILTER 563 bool 564 select HAVE_ARCH_SECCOMP 565 help 566 An arch should select this symbol if it provides all of these things: 567 - all the requirements for HAVE_ARCH_SECCOMP 568 - syscall_get_arch() 569 - syscall_get_arguments() 570 - syscall_rollback() 571 - syscall_set_return_value() 572 - SIGSYS siginfo_t support 573 - secure_computing is called from a ptrace_event()-safe context 574 - secure_computing return value is checked and a return value of -1 575 results in the system call being skipped immediately. 576 - seccomp syscall wired up 577 - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE, 578 SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If 579 COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too. 580 581config SECCOMP 582 prompt "Enable seccomp to safely execute untrusted bytecode" 583 def_bool y 584 depends on HAVE_ARCH_SECCOMP 585 help 586 This kernel feature is useful for number crunching applications 587 that may need to handle untrusted bytecode during their 588 execution. By using pipes or other transports made available 589 to the process as file descriptors supporting the read/write 590 syscalls, it's possible to isolate those applications in their 591 own address space using seccomp. Once seccomp is enabled via 592 prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be 593 disabled and the task is only allowed to execute a few safe 594 syscalls defined by each seccomp mode. 595 596 If unsure, say Y. 597 598config SECCOMP_FILTER 599 def_bool y 600 depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET 601 help 602 Enable tasks to build secure computing environments defined 603 in terms of Berkeley Packet Filter programs which implement 604 task-defined system call filtering polices. 605 606 See Documentation/userspace-api/seccomp_filter.rst for details. 607 608config SECCOMP_CACHE_DEBUG 609 bool "Show seccomp filter cache status in /proc/pid/seccomp_cache" 610 depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR 611 depends on PROC_FS 612 help 613 This enables the /proc/pid/seccomp_cache interface to monitor 614 seccomp cache data. The file format is subject to change. Reading 615 the file requires CAP_SYS_ADMIN. 616 617 This option is for debugging only. Enabling presents the risk that 618 an adversary may be able to infer the seccomp filter logic. 619 620 If unsure, say N. 621 622config HAVE_ARCH_STACKLEAK 623 bool 624 help 625 An architecture should select this if it has the code which 626 fills the used part of the kernel stack with the STACKLEAK_POISON 627 value before returning from system calls. 628 629config HAVE_STACKPROTECTOR 630 bool 631 help 632 An arch should select this symbol if: 633 - it has implemented a stack canary (e.g. __stack_chk_guard) 634 635config STACKPROTECTOR 636 bool "Stack Protector buffer overflow detection" 637 depends on HAVE_STACKPROTECTOR 638 depends on $(cc-option,-fstack-protector) 639 default y 640 help 641 This option turns on the "stack-protector" GCC feature. This 642 feature puts, at the beginning of functions, a canary value on 643 the stack just before the return address, and validates 644 the value just before actually returning. Stack based buffer 645 overflows (that need to overwrite this return address) now also 646 overwrite the canary, which gets detected and the attack is then 647 neutralized via a kernel panic. 648 649 Functions will have the stack-protector canary logic added if they 650 have an 8-byte or larger character array on the stack. 651 652 This feature requires gcc version 4.2 or above, or a distribution 653 gcc with the feature backported ("-fstack-protector"). 654 655 On an x86 "defconfig" build, this feature adds canary checks to 656 about 3% of all kernel functions, which increases kernel code size 657 by about 0.3%. 658 659config STACKPROTECTOR_STRONG 660 bool "Strong Stack Protector" 661 depends on STACKPROTECTOR 662 depends on $(cc-option,-fstack-protector-strong) 663 default y 664 help 665 Functions will have the stack-protector canary logic added in any 666 of the following conditions: 667 668 - local variable's address used as part of the right hand side of an 669 assignment or function argument 670 - local variable is an array (or union containing an array), 671 regardless of array type or length 672 - uses register local variables 673 674 This feature requires gcc version 4.9 or above, or a distribution 675 gcc with the feature backported ("-fstack-protector-strong"). 676 677 On an x86 "defconfig" build, this feature adds canary checks to 678 about 20% of all kernel functions, which increases the kernel code 679 size by about 2%. 680 681config ARCH_SUPPORTS_SHADOW_CALL_STACK 682 bool 683 help 684 An architecture should select this if it supports the compiler's 685 Shadow Call Stack and implements runtime support for shadow stack 686 switching. 687 688config SHADOW_CALL_STACK 689 bool "Shadow Call Stack" 690 depends on ARCH_SUPPORTS_SHADOW_CALL_STACK 691 depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER 692 depends on MMU 693 help 694 This option enables the compiler's Shadow Call Stack, which 695 uses a shadow stack to protect function return addresses from 696 being overwritten by an attacker. More information can be found 697 in the compiler's documentation: 698 699 - Clang: https://clang.llvm.org/docs/ShadowCallStack.html 700 - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options 701 702 Note that security guarantees in the kernel differ from the 703 ones documented for user space. The kernel must store addresses 704 of shadow stacks in memory, which means an attacker capable of 705 reading and writing arbitrary memory may be able to locate them 706 and hijack control flow by modifying the stacks. 707 708config DYNAMIC_SCS 709 bool 710 help 711 Set by the arch code if it relies on code patching to insert the 712 shadow call stack push and pop instructions rather than on the 713 compiler. 714 715config LTO 716 bool 717 help 718 Selected if the kernel will be built using the compiler's LTO feature. 719 720config LTO_CLANG 721 bool 722 select LTO 723 help 724 Selected if the kernel will be built using Clang's LTO feature. 725 726config ARCH_SUPPORTS_LTO_CLANG 727 bool 728 help 729 An architecture should select this option if it supports: 730 - compiling with Clang, 731 - compiling inline assembly with Clang's integrated assembler, 732 - and linking with LLD. 733 734config ARCH_SUPPORTS_LTO_CLANG_THIN 735 bool 736 help 737 An architecture should select this option if it can support Clang's 738 ThinLTO mode. 739 740config HAS_LTO_CLANG 741 def_bool y 742 depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM 743 depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) 744 depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) 745 depends on ARCH_SUPPORTS_LTO_CLANG 746 depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT 747 # https://github.com/ClangBuiltLinux/linux/issues/1721 748 depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO 749 depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO 750 depends on !GCOV_KERNEL 751 help 752 The compiler and Kconfig options support building with Clang's 753 LTO. 754 755choice 756 prompt "Link Time Optimization (LTO)" 757 default LTO_NONE 758 help 759 This option enables Link Time Optimization (LTO), which allows the 760 compiler to optimize binaries globally. 761 762 If unsure, select LTO_NONE. Note that LTO is very resource-intensive 763 so it's disabled by default. 764 765config LTO_NONE 766 bool "None" 767 help 768 Build the kernel normally, without Link Time Optimization (LTO). 769 770config LTO_CLANG_FULL 771 bool "Clang Full LTO (EXPERIMENTAL)" 772 depends on HAS_LTO_CLANG 773 depends on !COMPILE_TEST 774 select LTO_CLANG 775 help 776 This option enables Clang's full Link Time Optimization (LTO), which 777 allows the compiler to optimize the kernel globally. If you enable 778 this option, the compiler generates LLVM bitcode instead of ELF 779 object files, and the actual compilation from bitcode happens at 780 the LTO link step, which may take several minutes depending on the 781 kernel configuration. More information can be found from LLVM's 782 documentation: 783 784 https://llvm.org/docs/LinkTimeOptimization.html 785 786 During link time, this option can use a large amount of RAM, and 787 may take much longer than the ThinLTO option. 788 789config LTO_CLANG_THIN 790 bool "Clang ThinLTO (EXPERIMENTAL)" 791 depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN 792 select LTO_CLANG 793 help 794 This option enables Clang's ThinLTO, which allows for parallel 795 optimization and faster incremental compiles compared to the 796 CONFIG_LTO_CLANG_FULL option. More information can be found 797 from Clang's documentation: 798 799 https://clang.llvm.org/docs/ThinLTO.html 800 801 If unsure, say Y. 802endchoice 803 804config ARCH_SUPPORTS_CFI_CLANG 805 bool 806 help 807 An architecture should select this option if it can support Clang's 808 Control-Flow Integrity (CFI) checking. 809 810config ARCH_USES_CFI_TRAPS 811 bool 812 813config CFI_CLANG 814 bool "Use Clang's Control Flow Integrity (CFI)" 815 depends on ARCH_SUPPORTS_CFI_CLANG 816 depends on $(cc-option,-fsanitize=kcfi) 817 help 818 This option enables Clang’s forward-edge Control Flow Integrity 819 (CFI) checking, where the compiler injects a runtime check to each 820 indirect function call to ensure the target is a valid function with 821 the correct static type. This restricts possible call targets and 822 makes it more difficult for an attacker to exploit bugs that allow 823 the modification of stored function pointers. More information can be 824 found from Clang's documentation: 825 826 https://clang.llvm.org/docs/ControlFlowIntegrity.html 827 828config CFI_PERMISSIVE 829 bool "Use CFI in permissive mode" 830 depends on CFI_CLANG 831 help 832 When selected, Control Flow Integrity (CFI) violations result in a 833 warning instead of a kernel panic. This option should only be used 834 for finding indirect call type mismatches during development. 835 836 If unsure, say N. 837 838config HAVE_ARCH_WITHIN_STACK_FRAMES 839 bool 840 help 841 An architecture should select this if it can walk the kernel stack 842 frames to determine if an object is part of either the arguments 843 or local variables (i.e. that it excludes saved return addresses, 844 and similar) by implementing an inline arch_within_stack_frames(), 845 which is used by CONFIG_HARDENED_USERCOPY. 846 847config HAVE_CONTEXT_TRACKING_USER 848 bool 849 help 850 Provide kernel/user boundaries probes necessary for subsystems 851 that need it, such as userspace RCU extended quiescent state. 852 Syscalls need to be wrapped inside user_exit()-user_enter(), either 853 optimized behind static key or through the slow path using TIF_NOHZ 854 flag. Exceptions handlers must be wrapped as well. Irqs are already 855 protected inside ct_irq_enter/ct_irq_exit() but preemption or signal 856 handling on irq exit still need to be protected. 857 858config HAVE_CONTEXT_TRACKING_USER_OFFSTACK 859 bool 860 help 861 Architecture neither relies on exception_enter()/exception_exit() 862 nor on schedule_user(). Also preempt_schedule_notrace() and 863 preempt_schedule_irq() can't be called in a preemptible section 864 while context tracking is CONTEXT_USER. This feature reflects a sane 865 entry implementation where the following requirements are met on 866 critical entry code, ie: before user_exit() or after user_enter(): 867 868 - Critical entry code isn't preemptible (or better yet: 869 not interruptible). 870 - No use of RCU read side critical sections, unless ct_nmi_enter() 871 got called. 872 - No use of instrumentation, unless instrumentation_begin() got 873 called. 874 875config HAVE_TIF_NOHZ 876 bool 877 help 878 Arch relies on TIF_NOHZ and syscall slow path to implement context 879 tracking calls to user_enter()/user_exit(). 880 881config HAVE_VIRT_CPU_ACCOUNTING 882 bool 883 884config HAVE_VIRT_CPU_ACCOUNTING_IDLE 885 bool 886 help 887 Architecture has its own way to account idle CPU time and therefore 888 doesn't implement vtime_account_idle(). 889 890config ARCH_HAS_SCALED_CPUTIME 891 bool 892 893config HAVE_VIRT_CPU_ACCOUNTING_GEN 894 bool 895 default y if 64BIT 896 help 897 With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. 898 Before enabling this option, arch code must be audited 899 to ensure there are no races in concurrent read/write of 900 cputime_t. For example, reading/writing 64-bit cputime_t on 901 some 32-bit arches may require multiple accesses, so proper 902 locking is needed to protect against concurrent accesses. 903 904config HAVE_IRQ_TIME_ACCOUNTING 905 bool 906 help 907 Archs need to ensure they use a high enough resolution clock to 908 support irq time accounting and then call enable_sched_clock_irqtime(). 909 910config HAVE_MOVE_PUD 911 bool 912 help 913 Architectures that select this are able to move page tables at the 914 PUD level. If there are only 3 page table levels, the move effectively 915 happens at the PGD level. 916 917config HAVE_MOVE_PMD 918 bool 919 help 920 Archs that select this are able to move page tables at the PMD level. 921 922config HAVE_ARCH_TRANSPARENT_HUGEPAGE 923 bool 924 925config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 926 bool 927 928config HAVE_ARCH_HUGE_VMAP 929 bool 930 931# 932# Archs that select this would be capable of PMD-sized vmaps (i.e., 933# arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag 934# must be used to enable allocations to use hugepages. 935# 936config HAVE_ARCH_HUGE_VMALLOC 937 depends on HAVE_ARCH_HUGE_VMAP 938 bool 939 940config ARCH_WANT_HUGE_PMD_SHARE 941 bool 942 943# Archs that want to use pmd_mkwrite on kernel memory need it defined even 944# if there are no userspace memory management features that use it 945config ARCH_WANT_KERNEL_PMD_MKWRITE 946 bool 947 948config ARCH_WANT_PMD_MKWRITE 949 def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE 950 951config HAVE_ARCH_SOFT_DIRTY 952 bool 953 954config HAVE_MOD_ARCH_SPECIFIC 955 bool 956 help 957 The arch uses struct mod_arch_specific to store data. Many arches 958 just need a simple module loader without arch specific data - those 959 should not enable this. 960 961config MODULES_USE_ELF_RELA 962 bool 963 help 964 Modules only use ELF RELA relocations. Modules with ELF REL 965 relocations will give an error. 966 967config MODULES_USE_ELF_REL 968 bool 969 help 970 Modules only use ELF REL relocations. Modules with ELF RELA 971 relocations will give an error. 972 973config ARCH_WANTS_MODULES_DATA_IN_VMALLOC 974 bool 975 help 976 For architectures like powerpc/32 which have constraints on module 977 allocation and need to allocate module data outside of module area. 978 979config HAVE_IRQ_EXIT_ON_IRQ_STACK 980 bool 981 help 982 Architecture doesn't only execute the irq handler on the irq stack 983 but also irq_exit(). This way we can process softirqs on this irq 984 stack instead of switching to a new one when we call __do_softirq() 985 in the end of an hardirq. 986 This spares a stack switch and improves cache usage on softirq 987 processing. 988 989config HAVE_SOFTIRQ_ON_OWN_STACK 990 bool 991 help 992 Architecture provides a function to run __do_softirq() on a 993 separate stack. 994 995config SOFTIRQ_ON_OWN_STACK 996 def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT 997 998config ALTERNATE_USER_ADDRESS_SPACE 999 bool 1000 help 1001 Architectures set this when the CPU uses separate address 1002 spaces for kernel and user space pointers. In this case, the 1003 access_ok() check on a __user pointer is skipped. 1004 1005config PGTABLE_LEVELS 1006 int 1007 default 2 1008 1009config ARCH_HAS_ELF_RANDOMIZE 1010 bool 1011 help 1012 An architecture supports choosing randomized locations for 1013 stack, mmap, brk, and ET_DYN. Defined functions: 1014 - arch_mmap_rnd() 1015 - arch_randomize_brk() 1016 1017config HAVE_ARCH_MMAP_RND_BITS 1018 bool 1019 help 1020 An arch should select this symbol if it supports setting a variable 1021 number of bits for use in establishing the base address for mmap 1022 allocations, has MMU enabled and provides values for both: 1023 - ARCH_MMAP_RND_BITS_MIN 1024 - ARCH_MMAP_RND_BITS_MAX 1025 1026config HAVE_EXIT_THREAD 1027 bool 1028 help 1029 An architecture implements exit_thread. 1030 1031config ARCH_MMAP_RND_BITS_MIN 1032 int 1033 1034config ARCH_MMAP_RND_BITS_MAX 1035 int 1036 1037config ARCH_MMAP_RND_BITS_DEFAULT 1038 int 1039 1040config FORCE_MAX_MMAP_RND_BITS 1041 bool "Force maximum number of bits to use for ASLR of mmap base address" 1042 default y if !64BIT 1043 help 1044 ARCH_MMAP_RND_BITS and ARCH_MMAP_RND_COMPAT_BITS represent the number 1045 of bits to use for ASLR and if no custom value is assigned (EXPERT) 1046 then the architecture's lower bound (minimum) value is assumed. 1047 This toggle changes that default assumption to assume the arch upper 1048 bound (maximum) value instead. 1049 1050config ARCH_MMAP_RND_BITS 1051 int "Number of bits to use for ASLR of mmap base address" if EXPERT 1052 range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX 1053 default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT 1054 default ARCH_MMAP_RND_BITS_MAX if FORCE_MAX_MMAP_RND_BITS 1055 default ARCH_MMAP_RND_BITS_MIN 1056 depends on HAVE_ARCH_MMAP_RND_BITS 1057 help 1058 This value can be used to select the number of bits to use to 1059 determine the random offset to the base address of vma regions 1060 resulting from mmap allocations. This value will be bounded 1061 by the architecture's minimum and maximum supported values. 1062 1063 This value can be changed after boot using the 1064 /proc/sys/vm/mmap_rnd_bits tunable 1065 1066config HAVE_ARCH_MMAP_RND_COMPAT_BITS 1067 bool 1068 help 1069 An arch should select this symbol if it supports running applications 1070 in compatibility mode, supports setting a variable number of bits for 1071 use in establishing the base address for mmap allocations, has MMU 1072 enabled and provides values for both: 1073 - ARCH_MMAP_RND_COMPAT_BITS_MIN 1074 - ARCH_MMAP_RND_COMPAT_BITS_MAX 1075 1076config ARCH_MMAP_RND_COMPAT_BITS_MIN 1077 int 1078 1079config ARCH_MMAP_RND_COMPAT_BITS_MAX 1080 int 1081 1082config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT 1083 int 1084 1085config ARCH_MMAP_RND_COMPAT_BITS 1086 int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT 1087 range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX 1088 default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT 1089 default ARCH_MMAP_RND_COMPAT_BITS_MAX if FORCE_MAX_MMAP_RND_BITS 1090 default ARCH_MMAP_RND_COMPAT_BITS_MIN 1091 depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS 1092 help 1093 This value can be used to select the number of bits to use to 1094 determine the random offset to the base address of vma regions 1095 resulting from mmap allocations for compatible applications This 1096 value will be bounded by the architecture's minimum and maximum 1097 supported values. 1098 1099 This value can be changed after boot using the 1100 /proc/sys/vm/mmap_rnd_compat_bits tunable 1101 1102config HAVE_ARCH_COMPAT_MMAP_BASES 1103 bool 1104 help 1105 This allows 64bit applications to invoke 32-bit mmap() syscall 1106 and vice-versa 32-bit applications to call 64-bit mmap(). 1107 Required for applications doing different bitness syscalls. 1108 1109config PAGE_SIZE_LESS_THAN_64KB 1110 def_bool y 1111 depends on !ARM64_64K_PAGES 1112 depends on !IA64_PAGE_SIZE_64KB 1113 depends on !PAGE_SIZE_64KB 1114 depends on !PARISC_PAGE_SIZE_64KB 1115 depends on PAGE_SIZE_LESS_THAN_256KB 1116 1117config PAGE_SIZE_LESS_THAN_256KB 1118 def_bool y 1119 depends on !PAGE_SIZE_256KB 1120 1121# This allows to use a set of generic functions to determine mmap base 1122# address by giving priority to top-down scheme only if the process 1123# is not in legacy mode (compat task, unlimited stack size or 1124# sysctl_legacy_va_layout). 1125# Architecture that selects this option can provide its own version of: 1126# - STACK_RND_MASK 1127config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT 1128 bool 1129 depends on MMU 1130 select ARCH_HAS_ELF_RANDOMIZE 1131 1132config HAVE_OBJTOOL 1133 bool 1134 1135config HAVE_JUMP_LABEL_HACK 1136 bool 1137 1138config HAVE_NOINSTR_HACK 1139 bool 1140 1141config HAVE_NOINSTR_VALIDATION 1142 bool 1143 1144config HAVE_UACCESS_VALIDATION 1145 bool 1146 select OBJTOOL 1147 1148config HAVE_STACK_VALIDATION 1149 bool 1150 help 1151 Architecture supports objtool compile-time frame pointer rule 1152 validation. 1153 1154config HAVE_RELIABLE_STACKTRACE 1155 bool 1156 help 1157 Architecture has either save_stack_trace_tsk_reliable() or 1158 arch_stack_walk_reliable() function which only returns a stack trace 1159 if it can guarantee the trace is reliable. 1160 1161config HAVE_ARCH_HASH 1162 bool 1163 default n 1164 help 1165 If this is set, the architecture provides an <asm/hash.h> 1166 file which provides platform-specific implementations of some 1167 functions in <linux/hash.h> or fs/namei.c. 1168 1169config HAVE_ARCH_NVRAM_OPS 1170 bool 1171 1172config ISA_BUS_API 1173 def_bool ISA 1174 1175# 1176# ABI hall of shame 1177# 1178config CLONE_BACKWARDS 1179 bool 1180 help 1181 Architecture has tls passed as the 4th argument of clone(2), 1182 not the 5th one. 1183 1184config CLONE_BACKWARDS2 1185 bool 1186 help 1187 Architecture has the first two arguments of clone(2) swapped. 1188 1189config CLONE_BACKWARDS3 1190 bool 1191 help 1192 Architecture has tls passed as the 3rd argument of clone(2), 1193 not the 5th one. 1194 1195config ODD_RT_SIGACTION 1196 bool 1197 help 1198 Architecture has unusual rt_sigaction(2) arguments 1199 1200config OLD_SIGSUSPEND 1201 bool 1202 help 1203 Architecture has old sigsuspend(2) syscall, of one-argument variety 1204 1205config OLD_SIGSUSPEND3 1206 bool 1207 help 1208 Even weirder antique ABI - three-argument sigsuspend(2) 1209 1210config OLD_SIGACTION 1211 bool 1212 help 1213 Architecture has old sigaction(2) syscall. Nope, not the same 1214 as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2), 1215 but fairly different variant of sigaction(2), thanks to OSF/1 1216 compatibility... 1217 1218config COMPAT_OLD_SIGACTION 1219 bool 1220 1221config COMPAT_32BIT_TIME 1222 bool "Provide system calls for 32-bit time_t" 1223 default !64BIT || COMPAT 1224 help 1225 This enables 32 bit time_t support in addition to 64 bit time_t support. 1226 This is relevant on all 32-bit architectures, and 64-bit architectures 1227 as part of compat syscall handling. 1228 1229config ARCH_NO_PREEMPT 1230 bool 1231 1232config ARCH_SUPPORTS_RT 1233 bool 1234 1235config CPU_NO_EFFICIENT_FFS 1236 def_bool n 1237 1238config HAVE_ARCH_VMAP_STACK 1239 def_bool n 1240 help 1241 An arch should select this symbol if it can support kernel stacks 1242 in vmalloc space. This means: 1243 1244 - vmalloc space must be large enough to hold many kernel stacks. 1245 This may rule out many 32-bit architectures. 1246 1247 - Stacks in vmalloc space need to work reliably. For example, if 1248 vmap page tables are created on demand, either this mechanism 1249 needs to work while the stack points to a virtual address with 1250 unpopulated page tables or arch code (switch_to() and switch_mm(), 1251 most likely) needs to ensure that the stack's page table entries 1252 are populated before running on a possibly unpopulated stack. 1253 1254 - If the stack overflows into a guard page, something reasonable 1255 should happen. The definition of "reasonable" is flexible, but 1256 instantly rebooting without logging anything would be unfriendly. 1257 1258config VMAP_STACK 1259 default y 1260 bool "Use a virtually-mapped stack" 1261 depends on HAVE_ARCH_VMAP_STACK 1262 depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC 1263 help 1264 Enable this if you want the use virtually-mapped kernel stacks 1265 with guard pages. This causes kernel stack overflows to be 1266 caught immediately rather than causing difficult-to-diagnose 1267 corruption. 1268 1269 To use this with software KASAN modes, the architecture must support 1270 backing virtual mappings with real shadow memory, and KASAN_VMALLOC 1271 must be enabled. 1272 1273config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET 1274 def_bool n 1275 help 1276 An arch should select this symbol if it can support kernel stack 1277 offset randomization with calls to add_random_kstack_offset() 1278 during syscall entry and choose_random_kstack_offset() during 1279 syscall exit. Careful removal of -fstack-protector-strong and 1280 -fstack-protector should also be applied to the entry code and 1281 closely examined, as the artificial stack bump looks like an array 1282 to the compiler, so it will attempt to add canary checks regardless 1283 of the static branch state. 1284 1285config RANDOMIZE_KSTACK_OFFSET 1286 bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT 1287 default y 1288 depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET 1289 depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000 1290 help 1291 The kernel stack offset can be randomized (after pt_regs) by 1292 roughly 5 bits of entropy, frustrating memory corruption 1293 attacks that depend on stack address determinism or 1294 cross-syscall address exposures. 1295 1296 The feature is controlled via the "randomize_kstack_offset=on/off" 1297 kernel boot param, and if turned off has zero overhead due to its use 1298 of static branches (see JUMP_LABEL). 1299 1300 If unsure, say Y. 1301 1302config RANDOMIZE_KSTACK_OFFSET_DEFAULT 1303 bool "Default state of kernel stack offset randomization" 1304 depends on RANDOMIZE_KSTACK_OFFSET 1305 help 1306 Kernel stack offset randomization is controlled by kernel boot param 1307 "randomize_kstack_offset=on/off", and this config chooses the default 1308 boot state. 1309 1310config ARCH_OPTIONAL_KERNEL_RWX 1311 def_bool n 1312 1313config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT 1314 def_bool n 1315 1316config ARCH_HAS_STRICT_KERNEL_RWX 1317 def_bool n 1318 1319config STRICT_KERNEL_RWX 1320 bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX 1321 depends on ARCH_HAS_STRICT_KERNEL_RWX 1322 default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT 1323 help 1324 If this is set, kernel text and rodata memory will be made read-only, 1325 and non-text memory will be made non-executable. This provides 1326 protection against certain security exploits (e.g. executing the heap 1327 or modifying text) 1328 1329 These features are considered standard security practice these days. 1330 You should say Y here in almost all cases. 1331 1332config ARCH_HAS_STRICT_MODULE_RWX 1333 def_bool n 1334 1335config STRICT_MODULE_RWX 1336 bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX 1337 depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES 1338 default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT 1339 help 1340 If this is set, module text and rodata memory will be made read-only, 1341 and non-text memory will be made non-executable. This provides 1342 protection against certain security exploits (e.g. writing to text) 1343 1344# select if the architecture provides an asm/dma-direct.h header 1345config ARCH_HAS_PHYS_TO_DMA 1346 bool 1347 1348config HAVE_ARCH_COMPILER_H 1349 bool 1350 help 1351 An architecture can select this if it provides an 1352 asm/compiler.h header that should be included after 1353 linux/compiler-*.h in order to override macro definitions that those 1354 headers generally provide. 1355 1356config HAVE_ARCH_PREL32_RELOCATIONS 1357 bool 1358 help 1359 May be selected by an architecture if it supports place-relative 1360 32-bit relocations, both in the toolchain and in the module loader, 1361 in which case relative references can be used in special sections 1362 for PCI fixup, initcalls etc which are only half the size on 64 bit 1363 architectures, and don't require runtime relocation on relocatable 1364 kernels. 1365 1366config ARCH_USE_MEMREMAP_PROT 1367 bool 1368 1369config LOCK_EVENT_COUNTS 1370 bool "Locking event counts collection" 1371 depends on DEBUG_FS 1372 help 1373 Enable light-weight counting of various locking related events 1374 in the system with minimal performance impact. This reduces 1375 the chance of application behavior change because of timing 1376 differences. The counts are reported via debugfs. 1377 1378# Select if the architecture has support for applying RELR relocations. 1379config ARCH_HAS_RELR 1380 bool 1381 1382config RELR 1383 bool "Use RELR relocation packing" 1384 depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR 1385 default y 1386 help 1387 Store the kernel's dynamic relocations in the RELR relocation packing 1388 format. Requires a compatible linker (LLD supports this feature), as 1389 well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy 1390 are compatible). 1391 1392config ARCH_HAS_MEM_ENCRYPT 1393 bool 1394 1395config ARCH_HAS_CC_PLATFORM 1396 bool 1397 1398config HAVE_SPARSE_SYSCALL_NR 1399 bool 1400 help 1401 An architecture should select this if its syscall numbering is sparse 1402 to save space. For example, MIPS architecture has a syscall array with 1403 entries at 4000, 5000 and 6000 locations. This option turns on syscall 1404 related optimizations for a given architecture. 1405 1406config ARCH_HAS_VDSO_DATA 1407 bool 1408 1409config HAVE_STATIC_CALL 1410 bool 1411 1412config HAVE_STATIC_CALL_INLINE 1413 bool 1414 depends on HAVE_STATIC_CALL 1415 select OBJTOOL 1416 1417config HAVE_PREEMPT_DYNAMIC 1418 bool 1419 1420config HAVE_PREEMPT_DYNAMIC_CALL 1421 bool 1422 depends on HAVE_STATIC_CALL 1423 select HAVE_PREEMPT_DYNAMIC 1424 help 1425 An architecture should select this if it can handle the preemption 1426 model being selected at boot time using static calls. 1427 1428 Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a 1429 preemption function will be patched directly. 1430 1431 Where an architecture does not select HAVE_STATIC_CALL_INLINE, any 1432 call to a preemption function will go through a trampoline, and the 1433 trampoline will be patched. 1434 1435 It is strongly advised to support inline static call to avoid any 1436 overhead. 1437 1438config HAVE_PREEMPT_DYNAMIC_KEY 1439 bool 1440 depends on HAVE_ARCH_JUMP_LABEL 1441 select HAVE_PREEMPT_DYNAMIC 1442 help 1443 An architecture should select this if it can handle the preemption 1444 model being selected at boot time using static keys. 1445 1446 Each preemption function will be given an early return based on a 1447 static key. This should have slightly lower overhead than non-inline 1448 static calls, as this effectively inlines each trampoline into the 1449 start of its callee. This may avoid redundant work, and may 1450 integrate better with CFI schemes. 1451 1452 This will have greater overhead than using inline static calls as 1453 the call to the preemption function cannot be entirely elided. 1454 1455config ARCH_WANT_LD_ORPHAN_WARN 1456 bool 1457 help 1458 An arch should select this symbol once all linker sections are explicitly 1459 included, size-asserted, or discarded in the linker scripts. This is 1460 important because we never want expected sections to be placed heuristically 1461 by the linker, since the locations of such sections can change between linker 1462 versions. 1463 1464config HAVE_ARCH_PFN_VALID 1465 bool 1466 1467config ARCH_SUPPORTS_DEBUG_PAGEALLOC 1468 bool 1469 1470config ARCH_SUPPORTS_PAGE_TABLE_CHECK 1471 bool 1472 1473config ARCH_SPLIT_ARG64 1474 bool 1475 help 1476 If a 32-bit architecture requires 64-bit arguments to be split into 1477 pairs of 32-bit arguments, select this option. 1478 1479config ARCH_HAS_ELFCORE_COMPAT 1480 bool 1481 1482config ARCH_HAS_PARANOID_L1D_FLUSH 1483 bool 1484 1485config ARCH_HAVE_TRACE_MMIO_ACCESS 1486 bool 1487 1488config DYNAMIC_SIGFRAME 1489 bool 1490 1491# Select, if arch has a named attribute group bound to NUMA device nodes. 1492config HAVE_ARCH_NODE_DEV_GROUP 1493 bool 1494 1495config ARCH_HAS_NONLEAF_PMD_YOUNG 1496 bool 1497 help 1498 Architectures that select this option are capable of setting the 1499 accessed bit in non-leaf PMD entries when using them as part of linear 1500 address translations. Page table walkers that clear the accessed bit 1501 may use this capability to reduce their search space. 1502 1503source "kernel/gcov/Kconfig" 1504 1505source "scripts/gcc-plugins/Kconfig" 1506 1507config FUNCTION_ALIGNMENT_4B 1508 bool 1509 1510config FUNCTION_ALIGNMENT_8B 1511 bool 1512 1513config FUNCTION_ALIGNMENT_16B 1514 bool 1515 1516config FUNCTION_ALIGNMENT_32B 1517 bool 1518 1519config FUNCTION_ALIGNMENT_64B 1520 bool 1521 1522config FUNCTION_ALIGNMENT 1523 int 1524 default 64 if FUNCTION_ALIGNMENT_64B 1525 default 32 if FUNCTION_ALIGNMENT_32B 1526 default 16 if FUNCTION_ALIGNMENT_16B 1527 default 8 if FUNCTION_ALIGNMENT_8B 1528 default 4 if FUNCTION_ALIGNMENT_4B 1529 default 0 1530 1531endmenu 1532