Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. #
  2. # General architecture dependent options
  3. #
  4. config OPROFILE
  5. tristate "OProfile system profiling"
  6. depends on PROFILING
  7. depends on HAVE_OPROFILE
  8. select RING_BUFFER
  9. select RING_BUFFER_ALLOW_SWAP
  10. help
  11. OProfile is a profiling system capable of profiling the
  12. whole system, include the kernel, kernel modules, libraries,
  13. and applications.
  14. If unsure, say N.
  15. config OPROFILE_EVENT_MULTIPLEX
  16. bool "OProfile multiplexing support (EXPERIMENTAL)"
  17. default n
  18. depends on OPROFILE && X86
  19. help
  20. The number of hardware counters is limited. The multiplexing
  21. feature enables OProfile to gather more events than counters
  22. are provided by the hardware. This is realized by switching
  23. between events at an user specified time interval.
  24. If unsure, say N.
  25. config HAVE_OPROFILE
  26. bool
  27. config OPROFILE_NMI_TIMER
  28. def_bool y
  29. depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
  30. config KPROBES
  31. bool "Kprobes"
  32. depends on MODULES
  33. depends on HAVE_KPROBES
  34. select KALLSYMS
  35. help
  36. Kprobes allows you to trap at almost any kernel address and
  37. execute a callback function. register_kprobe() establishes
  38. a probepoint and specifies the callback. Kprobes is useful
  39. for kernel debugging, non-intrusive instrumentation and testing.
  40. If in doubt, say "N".
  41. config JUMP_LABEL
  42. bool "Optimize very unlikely/likely branches"
  43. depends on HAVE_ARCH_JUMP_LABEL
  44. help
  45. This option enables a transparent branch optimization that
  46. makes certain almost-always-true or almost-always-false branch
  47. conditions even cheaper to execute within the kernel.
  48. Certain performance-sensitive kernel code, such as trace points,
  49. scheduler functionality, networking code and KVM have such
  50. branches and include support for this optimization technique.
  51. If it is detected that the compiler has support for "asm goto",
  52. the kernel will compile such branches with just a nop
  53. instruction. When the condition flag is toggled to true, the
  54. nop will be converted to a jump instruction to execute the
  55. conditional block of instructions.
  56. This technique lowers overhead and stress on the branch prediction
  57. of the processor and generally makes the kernel faster. The update
  58. of the condition is slower, but those are always very rare.
  59. ( On 32-bit x86, the necessary options added to the compiler
  60. flags may increase the size of the kernel slightly. )
  61. config OPTPROBES
  62. def_bool y
  63. depends on KPROBES && HAVE_OPTPROBES
  64. depends on !PREEMPT
  65. config HAVE_EFFICIENT_UNALIGNED_ACCESS
  66. bool
  67. help
  68. Some architectures are unable to perform unaligned accesses
  69. without the use of get_unaligned/put_unaligned. Others are
  70. unable to perform such accesses efficiently (e.g. trap on
  71. unaligned access and require fixing it up in the exception
  72. handler.)
  73. This symbol should be selected by an architecture if it can
  74. perform unaligned accesses efficiently to allow different
  75. code paths to be selected for these cases. Some network
  76. drivers, for example, could opt to not fix up alignment
  77. problems with received packets if doing so would not help
  78. much.
  79. See Documentation/unaligned-memory-access.txt for more
  80. information on the topic of unaligned memory accesses.
  81. config ARCH_USE_BUILTIN_BSWAP
  82. bool
  83. help
  84. Modern versions of GCC (since 4.4) have builtin functions
  85. for handling byte-swapping. Using these, instead of the old
  86. inline assembler that the architecture code provides in the
  87. __arch_bswapXX() macros, allows the compiler to see what's
  88. happening and offers more opportunity for optimisation. In
  89. particular, the compiler will be able to combine the byteswap
  90. with a nearby load or store and use load-and-swap or
  91. store-and-swap instructions if the architecture has them. It
  92. should almost *never* result in code which is worse than the
  93. hand-coded assembler in <asm/swab.h>. But just in case it
  94. does, the use of the builtins is optional.
  95. Any architecture with load-and-swap or store-and-swap
  96. instructions should set this. And it shouldn't hurt to set it
  97. on architectures that don't have such instructions.
  98. config HAVE_SYSCALL_WRAPPERS
  99. bool
  100. config KRETPROBES
  101. def_bool y
  102. depends on KPROBES && HAVE_KRETPROBES
  103. config USER_RETURN_NOTIFIER
  104. bool
  105. depends on HAVE_USER_RETURN_NOTIFIER
  106. help
  107. Provide a kernel-internal notification when a cpu is about to
  108. switch to user mode.
  109. config HAVE_IOREMAP_PROT
  110. bool
  111. config HAVE_KPROBES
  112. bool
  113. config HAVE_KRETPROBES
  114. bool
  115. config HAVE_OPTPROBES
  116. bool
  117. config HAVE_NMI_WATCHDOG
  118. bool
  119. #
  120. # An arch should select this if it provides all these things:
  121. #
  122. # task_pt_regs() in asm/processor.h or asm/ptrace.h
  123. # arch_has_single_step() if there is hardware single-step support
  124. # arch_has_block_step() if there is hardware block-step support
  125. # asm/syscall.h supplying asm-generic/syscall.h interface
  126. # linux/regset.h user_regset interfaces
  127. # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
  128. # TIF_SYSCALL_TRACE calls tracehook_report_syscall_{entry,exit}
  129. # TIF_NOTIFY_RESUME calls tracehook_notify_resume()
  130. # signal delivery calls tracehook_signal_handler()
  131. #
  132. config HAVE_ARCH_TRACEHOOK
  133. bool
  134. config HAVE_DMA_ATTRS
  135. bool
  136. config HAVE_DMA_CONTIGUOUS
  137. bool
  138. config USE_GENERIC_SMP_HELPERS
  139. bool
  140. config HAVE_REGS_AND_STACK_ACCESS_API
  141. bool
  142. help
  143. This symbol should be selected by an architecure if it supports
  144. the API needed to access registers and stack entries from pt_regs,
  145. declared in asm/ptrace.h
  146. For example the kprobes-based event tracer needs this API.
  147. config HAVE_CLK
  148. bool
  149. help
  150. The <linux/clk.h> calls support software clock gating and
  151. thus are a key power management tool on many systems.
  152. config HAVE_DMA_API_DEBUG
  153. bool
  154. config HAVE_HW_BREAKPOINT
  155. bool
  156. depends on PERF_EVENTS
  157. config HAVE_MIXED_BREAKPOINTS_REGS
  158. bool
  159. depends on HAVE_HW_BREAKPOINT
  160. help
  161. Depending on the arch implementation of hardware breakpoints,
  162. some of them have separate registers for data and instruction
  163. breakpoints addresses, others have mixed registers to store
  164. them but define the access type in a control register.
  165. Select this option if your arch implements breakpoints under the
  166. latter fashion.
  167. config HAVE_USER_RETURN_NOTIFIER
  168. bool
  169. config HAVE_PERF_EVENTS_NMI
  170. bool
  171. help
  172. System hardware can generate an NMI using the perf event
  173. subsystem. Also has support for calculating CPU cycle events
  174. to determine how many clock cycles in a given period.
  175. config HAVE_PERF_REGS
  176. bool
  177. help
  178. Support selective register dumps for perf events. This includes
  179. bit-mapping of each registers and a unique architecture id.
  180. config HAVE_PERF_USER_STACK_DUMP
  181. bool
  182. help
  183. Support user stack dumps for perf event samples. This needs
  184. access to the user stack pointer which is not unified across
  185. architectures.
  186. config HAVE_ARCH_JUMP_LABEL
  187. bool
  188. config HAVE_ARCH_MUTEX_CPU_RELAX
  189. bool
  190. config HAVE_RCU_TABLE_FREE
  191. bool
  192. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  193. bool
  194. config HAVE_ALIGNED_STRUCT_PAGE
  195. bool
  196. help
  197. This makes sure that struct pages are double word aligned and that
  198. e.g. the SLUB allocator can perform double word atomic operations
  199. on a struct page for better performance. However selecting this
  200. might increase the size of a struct page by a word.
  201. config HAVE_CMPXCHG_LOCAL
  202. bool
  203. config HAVE_CMPXCHG_DOUBLE
  204. bool
  205. config ARCH_WANT_OLD_COMPAT_IPC
  206. bool
  207. config HAVE_ARCH_MMAP_RND_BITS
  208. bool
  209. help
  210. An arch should select this symbol if it supports setting a variable
  211. number of bits for use in establishing the base address for mmap
  212. allocations, has MMU enabled and provides values for both:
  213. - ARCH_MMAP_RND_BITS_MIN
  214. - ARCH_MMAP_RND_BITS_MAX
  215. config ARCH_MMAP_RND_BITS_MIN
  216. int
  217. config ARCH_MMAP_RND_BITS_MAX
  218. int
  219. config ARCH_MMAP_RND_BITS_DEFAULT
  220. int
  221. config ARCH_MMAP_RND_BITS
  222. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  223. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  224. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  225. default ARCH_MMAP_RND_BITS_MIN
  226. depends on HAVE_ARCH_MMAP_RND_BITS
  227. help
  228. This value can be used to select the number of bits to use to
  229. determine the random offset to the base address of vma regions
  230. resulting from mmap allocations. This value will be bounded
  231. by the architecture's minimum and maximum supported values.
  232. This value can be changed after boot using the
  233. /proc/sys/vm/mmap_rnd_bits tunable
  234. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  235. bool
  236. help
  237. An arch should select this symbol if it supports running applications
  238. in compatibility mode, supports setting a variable number of bits for
  239. use in establishing the base address for mmap allocations, has MMU
  240. enabled and provides values for both:
  241. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  242. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  243. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  244. int
  245. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  246. int
  247. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  248. int
  249. config ARCH_MMAP_RND_COMPAT_BITS
  250. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  251. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  252. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  253. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  254. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  255. help
  256. This value can be used to select the number of bits to use to
  257. determine the random offset to the base address of vma regions
  258. resulting from mmap allocations for compatible applications This
  259. value will be bounded by the architecture's minimum and maximum
  260. supported values.
  261. This value can be changed after boot using the
  262. /proc/sys/vm/mmap_rnd_compat_bits tunable
  263. config HAVE_ARCH_SECCOMP_FILTER
  264. bool
  265. help
  266. An arch should select this symbol if it provides all of these things:
  267. - syscall_get_arch()
  268. - syscall_get_arguments()
  269. - syscall_rollback()
  270. - syscall_set_return_value()
  271. - SIGSYS siginfo_t support
  272. - secure_computing is called from a ptrace_event()-safe context
  273. - secure_computing return value is checked and a return value of -1
  274. results in the system call being skipped immediately.
  275. - seccomp syscall wired up
  276. config SECCOMP_FILTER
  277. def_bool y
  278. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  279. help
  280. Enable tasks to build secure computing environments defined
  281. in terms of Berkeley Packet Filter programs which implement
  282. task-defined system call filtering polices.
  283. See Documentation/prctl/seccomp_filter.txt for details.
  284. config HAVE_CC_STACKPROTECTOR
  285. bool
  286. help
  287. An arch should select this symbol if:
  288. - its compiler supports the -fstack-protector option
  289. - it has implemented a stack canary (e.g. __stack_chk_guard)
  290. config CC_STACKPROTECTOR
  291. def_bool n
  292. help
  293. Set when a stack-protector mode is enabled, so that the build
  294. can enable kernel-side support for the GCC feature.
  295. choice
  296. prompt "Stack Protector buffer overflow detection"
  297. depends on HAVE_CC_STACKPROTECTOR
  298. default CC_STACKPROTECTOR_NONE
  299. help
  300. This option turns on the "stack-protector" GCC feature. This
  301. feature puts, at the beginning of functions, a canary value on
  302. the stack just before the return address, and validates
  303. the value just before actually returning. Stack based buffer
  304. overflows (that need to overwrite this return address) now also
  305. overwrite the canary, which gets detected and the attack is then
  306. neutralized via a kernel panic.
  307. config CC_STACKPROTECTOR_NONE
  308. bool "None"
  309. help
  310. Disable "stack-protector" GCC feature.
  311. config CC_STACKPROTECTOR_REGULAR
  312. bool "Regular"
  313. select CC_STACKPROTECTOR
  314. help
  315. Functions will have the stack-protector canary logic added if they
  316. have an 8-byte or larger character array on the stack.
  317. This feature requires gcc version 4.2 or above, or a distribution
  318. gcc with the feature backported ("-fstack-protector").
  319. On an x86 "defconfig" build, this feature adds canary checks to
  320. about 3% of all kernel functions, which increases kernel code size
  321. by about 0.3%.
  322. config CC_STACKPROTECTOR_STRONG
  323. bool "Strong"
  324. select CC_STACKPROTECTOR
  325. help
  326. Functions will have the stack-protector canary logic added in any
  327. of the following conditions:
  328. - local variable's address used as part of the right hand side of an
  329. assignment or function argument
  330. - local variable is an array (or union containing an array),
  331. regardless of array type or length
  332. - uses register local variables
  333. This feature requires gcc version 4.9 or above, or a distribution
  334. gcc with the feature backported ("-fstack-protector-strong").
  335. On an x86 "defconfig" build, this feature adds canary checks to
  336. about 20% of all kernel functions, which increases the kernel code
  337. size by about 2%.
  338. endchoice
  339. source "kernel/gcov/Kconfig"