Kconfig.debug 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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_MRST
  38. bool "Early printk for MRST platform support"
  39. depends on EARLY_PRINTK && X86_MRST
  40. config EARLY_PRINTK_DBGP
  41. bool "Early printk via EHCI debug port"
  42. depends on EARLY_PRINTK && PCI
  43. ---help---
  44. Write kernel log output directly into the EHCI debug port.
  45. This is useful for kernel debugging when your machine crashes very
  46. early before the console code is initialized. For normal operation
  47. it is not recommended because it looks ugly and doesn't cooperate
  48. with klogd/syslogd or the X server. You should normally N here,
  49. unless you want to debug such a crash. You need usb debug device.
  50. config DEBUG_STACKOVERFLOW
  51. bool "Check for stack overflows"
  52. depends on DEBUG_KERNEL
  53. ---help---
  54. This option will cause messages to be printed if free stack space
  55. drops below a certain limit.
  56. config DEBUG_STACK_USAGE
  57. bool "Stack utilization instrumentation"
  58. depends on DEBUG_KERNEL
  59. ---help---
  60. Enables the display of the minimum amount of free stack which each
  61. task has ever had available in the sysrq-T and sysrq-P debug output.
  62. This option will slow down process creation somewhat.
  63. config DEBUG_PER_CPU_MAPS
  64. bool "Debug access to per_cpu maps"
  65. depends on DEBUG_KERNEL
  66. depends on SMP
  67. ---help---
  68. Say Y to verify that the per_cpu map being accessed has
  69. been setup. Adds a fair amount of code to kernel memory
  70. and decreases performance.
  71. Say N if unsure.
  72. config X86_PTDUMP
  73. bool "Export kernel pagetable layout to userspace via debugfs"
  74. depends on DEBUG_KERNEL
  75. select DEBUG_FS
  76. ---help---
  77. Say Y here if you want to show the kernel pagetable layout in a
  78. debugfs file. This information is only useful for kernel developers
  79. who are working in architecture specific areas of the kernel.
  80. It is probably not a good idea to enable this feature in a production
  81. kernel.
  82. If in doubt, say "N"
  83. config DEBUG_RODATA
  84. bool "Write protect kernel read-only data structures"
  85. default y
  86. depends on DEBUG_KERNEL
  87. ---help---
  88. Mark the kernel read-only data as write-protected in the pagetables,
  89. in order to catch accidental (and incorrect) writes to such const
  90. data. This is recommended so that we can catch kernel bugs sooner.
  91. If in doubt, say "Y".
  92. config DEBUG_RODATA_TEST
  93. bool "Testcase for the DEBUG_RODATA feature"
  94. depends on DEBUG_RODATA
  95. default y
  96. ---help---
  97. This option enables a testcase for the DEBUG_RODATA
  98. feature as well as for the change_page_attr() infrastructure.
  99. If in doubt, say "N"
  100. config DEBUG_NX_TEST
  101. tristate "Testcase for the NX non-executable stack feature"
  102. depends on DEBUG_KERNEL && m
  103. ---help---
  104. This option enables a testcase for the CPU NX capability
  105. and the software setup of this feature.
  106. If in doubt, say "N"
  107. config 4KSTACKS
  108. bool "Use 4Kb for kernel stacks instead of 8Kb"
  109. depends on X86_32
  110. ---help---
  111. If you say Y here the kernel will use a 4Kb stacksize for the
  112. kernel stack attached to each process/thread. This facilitates
  113. running more threads on a system and also reduces the pressure
  114. on the VM subsystem for higher order allocations. This option
  115. will also use IRQ stacks to compensate for the reduced stackspace.
  116. config DOUBLEFAULT
  117. default y
  118. bool "Enable doublefault exception handler" if EMBEDDED
  119. depends on X86_32
  120. ---help---
  121. This option allows trapping of rare doublefault exceptions that
  122. would otherwise cause a system to silently reboot. Disabling this
  123. option saves about 4k and might cause you much additional grey
  124. hair.
  125. config IOMMU_DEBUG
  126. bool "Enable IOMMU debugging"
  127. depends on GART_IOMMU && DEBUG_KERNEL
  128. depends on X86_64
  129. ---help---
  130. Force the IOMMU to on even when you have less than 4GB of
  131. memory and add debugging code. On overflow always panic. And
  132. allow to enable IOMMU leak tracing. Can be disabled at boot
  133. time with iommu=noforce. This will also enable scatter gather
  134. list merging. Currently not recommended for production
  135. code. When you use it make sure you have a big enough
  136. IOMMU/AGP aperture. Most of the options enabled by this can
  137. be set more finegrained using the iommu= command line
  138. options. See Documentation/x86_64/boot-options.txt for more
  139. details.
  140. config IOMMU_STRESS
  141. bool "Enable IOMMU stress-test mode"
  142. ---help---
  143. This option disables various optimizations in IOMMU related
  144. code to do real stress testing of the IOMMU code. This option
  145. will cause a performance drop and should only be enabled for
  146. testing.
  147. config IOMMU_LEAK
  148. bool "IOMMU leak tracing"
  149. depends on IOMMU_DEBUG && DMA_API_DEBUG
  150. ---help---
  151. Add a simple leak tracer to the IOMMU code. This is useful when you
  152. are debugging a buggy device driver that leaks IOMMU mappings.
  153. config HAVE_MMIOTRACE_SUPPORT
  154. def_bool y
  155. config X86_DECODER_SELFTEST
  156. bool "x86 instruction decoder selftest"
  157. depends on DEBUG_KERNEL && KPROBES
  158. ---help---
  159. Perform x86 instruction decoder selftests at build time.
  160. This option is useful for checking the sanity of x86 instruction
  161. decoder code.
  162. If unsure, say "N".
  163. #
  164. # IO delay types:
  165. #
  166. config IO_DELAY_TYPE_0X80
  167. int
  168. default "0"
  169. config IO_DELAY_TYPE_0XED
  170. int
  171. default "1"
  172. config IO_DELAY_TYPE_UDELAY
  173. int
  174. default "2"
  175. config IO_DELAY_TYPE_NONE
  176. int
  177. default "3"
  178. choice
  179. prompt "IO delay type"
  180. default IO_DELAY_0X80
  181. config IO_DELAY_0X80
  182. bool "port 0x80 based port-IO delay [recommended]"
  183. ---help---
  184. This is the traditional Linux IO delay used for in/out_p.
  185. It is the most tested hence safest selection here.
  186. config IO_DELAY_0XED
  187. bool "port 0xed based port-IO delay"
  188. ---help---
  189. Use port 0xed as the IO delay. This frees up port 0x80 which is
  190. often used as a hardware-debug port.
  191. config IO_DELAY_UDELAY
  192. bool "udelay based port-IO delay"
  193. ---help---
  194. Use udelay(2) as the IO delay method. This provides the delay
  195. while not having any side-effect on the IO port space.
  196. config IO_DELAY_NONE
  197. bool "no port-IO delay"
  198. ---help---
  199. No port-IO delay. Will break on old boxes that require port-IO
  200. delay for certain operations. Should work on most new machines.
  201. endchoice
  202. if IO_DELAY_0X80
  203. config DEFAULT_IO_DELAY_TYPE
  204. int
  205. default IO_DELAY_TYPE_0X80
  206. endif
  207. if IO_DELAY_0XED
  208. config DEFAULT_IO_DELAY_TYPE
  209. int
  210. default IO_DELAY_TYPE_0XED
  211. endif
  212. if IO_DELAY_UDELAY
  213. config DEFAULT_IO_DELAY_TYPE
  214. int
  215. default IO_DELAY_TYPE_UDELAY
  216. endif
  217. if IO_DELAY_NONE
  218. config DEFAULT_IO_DELAY_TYPE
  219. int
  220. default IO_DELAY_TYPE_NONE
  221. endif
  222. config DEBUG_BOOT_PARAMS
  223. bool "Debug boot parameters"
  224. depends on DEBUG_KERNEL
  225. depends on DEBUG_FS
  226. ---help---
  227. This option will cause struct boot_params to be exported via debugfs.
  228. config CPA_DEBUG
  229. bool "CPA self-test code"
  230. depends on DEBUG_KERNEL
  231. ---help---
  232. Do change_page_attr() self-tests every 30 seconds.
  233. config OPTIMIZE_INLINING
  234. bool "Allow gcc to uninline functions marked 'inline'"
  235. ---help---
  236. This option determines if the kernel forces gcc to inline the functions
  237. developers have marked 'inline'. Doing so takes away freedom from gcc to
  238. do what it thinks is best, which is desirable for the gcc 3.x series of
  239. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  240. enabling this option will generate a smaller kernel there. Hopefully
  241. this algorithm is so good that allowing gcc 4.x and above to make the
  242. decision will become the default in the future. Until then this option
  243. is there to test gcc for this.
  244. If unsure, say N.
  245. config DEBUG_STRICT_USER_COPY_CHECKS
  246. bool "Strict copy size checks"
  247. depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
  248. ---help---
  249. Enabling this option turns a certain set of sanity checks for user
  250. copy operations into compile time failures.
  251. The copy_from_user() etc checks are there to help test if there
  252. are sufficient security checks on the length argument of
  253. the copy operation, by having gcc prove that the argument is
  254. within bounds.
  255. If unsure, or if you run an older (pre 4.4) gcc, say N.
  256. endmenu