Kconfig 26 KB

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