Kconfig.debug 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. menu "Kernel hacking"
  2. config TRACE_IRQFLAGS_SUPPORT
  3. def_bool y
  4. source "lib/Kconfig.debug"
  5. config STRICT_DEVMEM
  6. bool "Filter access to /dev/mem"
  7. ---help---
  8. If this option is disabled, you allow userspace (root) access to all
  9. of memory, including kernel and userspace memory. Accidental
  10. access to this is obviously disastrous, but specific access can
  11. be used by people debugging the kernel. Note that with PAT support
  12. enabled, even in this case there are restrictions on /dev/mem
  13. use due to the cache aliasing requirements.
  14. If this option is switched on, the /dev/mem file only allows
  15. userspace access to PCI space and the BIOS code and data regions.
  16. This is sufficient for dosemu and X and all common users of
  17. /dev/mem.
  18. If in doubt, say Y.
  19. config X86_VERBOSE_BOOTUP
  20. bool "Enable verbose x86 bootup info messages"
  21. default y
  22. ---help---
  23. Enables the informational output from the decompression stage
  24. (e.g. bzImage) of the boot. If you disable this you will still
  25. see errors. Disable this if you want silent bootup.
  26. config EARLY_PRINTK
  27. bool "Early printk" if EMBEDDED
  28. default y
  29. ---help---
  30. Write kernel log output directly into the VGA buffer or to a serial
  31. port.
  32. This is useful for kernel debugging when your machine crashes very
  33. early before the console code is initialized. For normal operation
  34. it is not recommended because it looks ugly and doesn't cooperate
  35. with klogd/syslogd or the X server. You should normally N here,
  36. unless you want to debug such a crash.
  37. config EARLY_PRINTK_DBGP
  38. bool "Early printk via EHCI debug port"
  39. default n
  40. depends on EARLY_PRINTK && PCI
  41. ---help---
  42. Write kernel log output directly into the EHCI debug port.
  43. This is useful for kernel debugging when your machine crashes very
  44. early before the console code is initialized. For normal operation
  45. it is not recommended because it looks ugly and doesn't cooperate
  46. with klogd/syslogd or the X server. You should normally N here,
  47. unless you want to debug such a crash. You need usb debug device.
  48. config DEBUG_STACKOVERFLOW
  49. bool "Check for stack overflows"
  50. depends on DEBUG_KERNEL
  51. ---help---
  52. This option will cause messages to be printed if free stack space
  53. drops below a certain limit.
  54. config DEBUG_STACK_USAGE
  55. bool "Stack utilization instrumentation"
  56. depends on DEBUG_KERNEL
  57. ---help---
  58. Enables the display of the minimum amount of free stack which each
  59. task has ever had available in the sysrq-T and sysrq-P debug output.
  60. This option will slow down process creation somewhat.
  61. config DEBUG_PER_CPU_MAPS
  62. bool "Debug access to per_cpu maps"
  63. depends on DEBUG_KERNEL
  64. depends on SMP
  65. default n
  66. ---help---
  67. Say Y to verify that the per_cpu map being accessed has
  68. been setup. Adds a fair amount of code to kernel memory
  69. and decreases performance.
  70. Say N if unsure.
  71. config X86_PTDUMP
  72. bool "Export kernel pagetable layout to userspace via debugfs"
  73. depends on DEBUG_KERNEL
  74. select DEBUG_FS
  75. ---help---
  76. Say Y here if you want to show the kernel pagetable layout in a
  77. debugfs file. This information is only useful for kernel developers
  78. who are working in architecture specific areas of the kernel.
  79. It is probably not a good idea to enable this feature in a production
  80. kernel.
  81. If in doubt, say "N"
  82. config DEBUG_RODATA
  83. bool "Write protect kernel read-only data structures"
  84. default y
  85. depends on DEBUG_KERNEL
  86. ---help---
  87. Mark the kernel read-only data as write-protected in the pagetables,
  88. in order to catch accidental (and incorrect) writes to such const
  89. data. This is recommended so that we can catch kernel bugs sooner.
  90. If in doubt, say "Y".
  91. config DEBUG_RODATA_TEST
  92. bool "Testcase for the DEBUG_RODATA feature"
  93. depends on DEBUG_RODATA
  94. default y
  95. ---help---
  96. This option enables a testcase for the DEBUG_RODATA
  97. feature as well as for the change_page_attr() infrastructure.
  98. If in doubt, say "N"
  99. config DEBUG_NX_TEST
  100. tristate "Testcase for the NX non-executable stack feature"
  101. depends on DEBUG_KERNEL && m
  102. ---help---
  103. This option enables a testcase for the CPU NX capability
  104. and the software setup of this feature.
  105. If in doubt, say "N"
  106. config 4KSTACKS
  107. bool "Use 4Kb for kernel stacks instead of 8Kb"
  108. depends on X86_32
  109. ---help---
  110. If you say Y here the kernel will use a 4Kb stacksize for the
  111. kernel stack attached to each process/thread. This facilitates
  112. running more threads on a system and also reduces the pressure
  113. on the VM subsystem for higher order allocations. This option
  114. will also use IRQ stacks to compensate for the reduced stackspace.
  115. config DOUBLEFAULT
  116. default y
  117. bool "Enable doublefault exception handler" if EMBEDDED
  118. depends on X86_32
  119. ---help---
  120. This option allows trapping of rare doublefault exceptions that
  121. would otherwise cause a system to silently reboot. Disabling this
  122. option saves about 4k and might cause you much additional grey
  123. hair.
  124. config IOMMU_DEBUG
  125. bool "Enable IOMMU debugging"
  126. depends on GART_IOMMU && DEBUG_KERNEL
  127. depends on X86_64
  128. ---help---
  129. Force the IOMMU to on even when you have less than 4GB of
  130. memory and add debugging code. On overflow always panic. And
  131. allow to enable IOMMU leak tracing. Can be disabled at boot
  132. time with iommu=noforce. This will also enable scatter gather
  133. list merging. Currently not recommended for production
  134. code. When you use it make sure you have a big enough
  135. IOMMU/AGP aperture. Most of the options enabled by this can
  136. be set more finegrained using the iommu= command line
  137. options. See Documentation/x86_64/boot-options.txt for more
  138. details.
  139. config IOMMU_STRESS
  140. bool "Enable IOMMU stress-test mode"
  141. ---help---
  142. This option disables various optimizations in IOMMU related
  143. code to do real stress testing of the IOMMU code. This option
  144. will cause a performance drop and should only be enabled for
  145. testing.
  146. config IOMMU_LEAK
  147. bool "IOMMU leak tracing"
  148. depends on IOMMU_DEBUG && DMA_API_DEBUG
  149. ---help---
  150. Add a simple leak tracer to the IOMMU code. This is useful when you
  151. are debugging a buggy device driver that leaks IOMMU mappings.
  152. config X86_DS_SELFTEST
  153. bool "DS selftest"
  154. default y
  155. depends on DEBUG_KERNEL
  156. depends on X86_DS
  157. ---help---
  158. Perform Debug Store selftests at boot time.
  159. If in doubt, say "N".
  160. config HAVE_MMIOTRACE_SUPPORT
  161. def_bool y
  162. #
  163. # IO delay types:
  164. #
  165. config IO_DELAY_TYPE_0X80
  166. int
  167. default "0"
  168. config IO_DELAY_TYPE_0XED
  169. int
  170. default "1"
  171. config IO_DELAY_TYPE_UDELAY
  172. int
  173. default "2"
  174. config IO_DELAY_TYPE_NONE
  175. int
  176. default "3"
  177. choice
  178. prompt "IO delay type"
  179. default IO_DELAY_0X80
  180. config IO_DELAY_0X80
  181. bool "port 0x80 based port-IO delay [recommended]"
  182. ---help---
  183. This is the traditional Linux IO delay used for in/out_p.
  184. It is the most tested hence safest selection here.
  185. config IO_DELAY_0XED
  186. bool "port 0xed based port-IO delay"
  187. ---help---
  188. Use port 0xed as the IO delay. This frees up port 0x80 which is
  189. often used as a hardware-debug port.
  190. config IO_DELAY_UDELAY
  191. bool "udelay based port-IO delay"
  192. ---help---
  193. Use udelay(2) as the IO delay method. This provides the delay
  194. while not having any side-effect on the IO port space.
  195. config IO_DELAY_NONE
  196. bool "no port-IO delay"
  197. ---help---
  198. No port-IO delay. Will break on old boxes that require port-IO
  199. delay for certain operations. Should work on most new machines.
  200. endchoice
  201. if IO_DELAY_0X80
  202. config DEFAULT_IO_DELAY_TYPE
  203. int
  204. default IO_DELAY_TYPE_0X80
  205. endif
  206. if IO_DELAY_0XED
  207. config DEFAULT_IO_DELAY_TYPE
  208. int
  209. default IO_DELAY_TYPE_0XED
  210. endif
  211. if IO_DELAY_UDELAY
  212. config DEFAULT_IO_DELAY_TYPE
  213. int
  214. default IO_DELAY_TYPE_UDELAY
  215. endif
  216. if IO_DELAY_NONE
  217. config DEFAULT_IO_DELAY_TYPE
  218. int
  219. default IO_DELAY_TYPE_NONE
  220. endif
  221. menuconfig KMEMCHECK
  222. bool "kmemcheck: trap use of uninitialized memory"
  223. depends on DEBUG_KERNEL
  224. depends on !X86_USE_3DNOW
  225. depends on SLUB || SLAB
  226. depends on !CC_OPTIMIZE_FOR_SIZE
  227. depends on !FUNCTION_TRACER
  228. select FRAME_POINTER
  229. select STACKTRACE
  230. default n
  231. help
  232. This option enables tracing of dynamically allocated kernel memory
  233. to see if memory is used before it has been given an initial value.
  234. Be aware that this requires half of your memory for bookkeeping and
  235. will insert extra code at *every* read and write to tracked memory
  236. thus slow down the kernel code (but user code is unaffected).
  237. The kernel may be started with kmemcheck=0 or kmemcheck=1 to disable
  238. or enable kmemcheck at boot-time. If the kernel is started with
  239. kmemcheck=0, the large memory and CPU overhead is not incurred.
  240. choice
  241. prompt "kmemcheck: default mode at boot"
  242. depends on KMEMCHECK
  243. default KMEMCHECK_ONESHOT_BY_DEFAULT
  244. help
  245. This option controls the default behaviour of kmemcheck when the
  246. kernel boots and no kmemcheck= parameter is given.
  247. config KMEMCHECK_DISABLED_BY_DEFAULT
  248. bool "disabled"
  249. depends on KMEMCHECK
  250. config KMEMCHECK_ENABLED_BY_DEFAULT
  251. bool "enabled"
  252. depends on KMEMCHECK
  253. config KMEMCHECK_ONESHOT_BY_DEFAULT
  254. bool "one-shot"
  255. depends on KMEMCHECK
  256. help
  257. In one-shot mode, only the first error detected is reported before
  258. kmemcheck is disabled.
  259. endchoice
  260. config KMEMCHECK_QUEUE_SIZE
  261. int "kmemcheck: error queue size"
  262. depends on KMEMCHECK
  263. default 64
  264. help
  265. Select the maximum number of errors to store in the queue. Since
  266. errors can occur virtually anywhere and in any context, we need a
  267. temporary storage area which is guarantueed not to generate any
  268. other faults. The queue will be emptied as soon as a tasklet may
  269. be scheduled. If the queue is full, new error reports will be
  270. lost.
  271. config KMEMCHECK_SHADOW_COPY_SHIFT
  272. int "kmemcheck: shadow copy size (5 => 32 bytes, 6 => 64 bytes)"
  273. depends on KMEMCHECK
  274. range 2 8
  275. default 5
  276. help
  277. Select the number of shadow bytes to save along with each entry of
  278. the queue. These bytes indicate what parts of an allocation are
  279. initialized, uninitialized, etc. and will be displayed when an
  280. error is detected to help the debugging of a particular problem.
  281. config KMEMCHECK_PARTIAL_OK
  282. bool "kmemcheck: allow partially uninitialized memory"
  283. depends on KMEMCHECK
  284. default y
  285. help
  286. This option works around certain GCC optimizations that produce
  287. 32-bit reads from 16-bit variables where the upper 16 bits are
  288. thrown away afterwards. This may of course also hide some real
  289. bugs.
  290. config KMEMCHECK_BITOPS_OK
  291. bool "kmemcheck: allow bit-field manipulation"
  292. depends on KMEMCHECK
  293. default n
  294. help
  295. This option silences warnings that would be generated for bit-field
  296. accesses where not all the bits are initialized at the same time.
  297. This may also hide some real bugs.
  298. config DEBUG_BOOT_PARAMS
  299. bool "Debug boot parameters"
  300. depends on DEBUG_KERNEL
  301. depends on DEBUG_FS
  302. ---help---
  303. This option will cause struct boot_params to be exported via debugfs.
  304. config CPA_DEBUG
  305. bool "CPA self-test code"
  306. depends on DEBUG_KERNEL
  307. ---help---
  308. Do change_page_attr() self-tests every 30 seconds.
  309. config OPTIMIZE_INLINING
  310. bool "Allow gcc to uninline functions marked 'inline'"
  311. ---help---
  312. This option determines if the kernel forces gcc to inline the functions
  313. developers have marked 'inline'. Doing so takes away freedom from gcc to
  314. do what it thinks is best, which is desirable for the gcc 3.x series of
  315. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  316. enabling this option will generate a smaller kernel there. Hopefully
  317. this algorithm is so good that allowing gcc 4.x and above to make the
  318. decision will become the default in the future. Until then this option
  319. is there to test gcc for this.
  320. If unsure, say N.
  321. endmenu