Kconfig 26 KB

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