Kconfig.debug 9.1 KB

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