Kconfig.debug 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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 DEBUG_STACKOVERFLOW
  38. bool "Check for stack overflows"
  39. depends on DEBUG_KERNEL
  40. help
  41. This option will cause messages to be printed if free stack space
  42. drops below a certain limit.
  43. config DEBUG_STACK_USAGE
  44. bool "Stack utilization instrumentation"
  45. depends on DEBUG_KERNEL
  46. help
  47. Enables the display of the minimum amount of free stack which each
  48. task has ever had available in the sysrq-T and sysrq-P debug output.
  49. This option will slow down process creation somewhat.
  50. config DEBUG_PAGEALLOC
  51. bool "Debug page memory allocations"
  52. depends on DEBUG_KERNEL
  53. help
  54. Unmap pages from the kernel linear mapping after free_pages().
  55. This results in a large slowdown, but helps to find certain types
  56. of memory corruptions.
  57. config DEBUG_PER_CPU_MAPS
  58. bool "Debug access to per_cpu maps"
  59. depends on DEBUG_KERNEL
  60. depends on X86_SMP
  61. default n
  62. help
  63. Say Y to verify that the per_cpu map being accessed has
  64. been setup. Adds a fair amount of code to kernel memory
  65. and decreases performance.
  66. Say N if unsure.
  67. config X86_PTDUMP
  68. bool "Export kernel pagetable layout to userspace via debugfs"
  69. depends on DEBUG_KERNEL
  70. select DEBUG_FS
  71. help
  72. Say Y here if you want to show the kernel pagetable layout in a
  73. debugfs file. This information is only useful for kernel developers
  74. who are working in architecture specific areas of the kernel.
  75. It is probably not a good idea to enable this feature in a production
  76. kernel.
  77. If in doubt, say "N"
  78. config DEBUG_RODATA
  79. bool "Write protect kernel read-only data structures"
  80. default y
  81. depends on DEBUG_KERNEL
  82. help
  83. Mark the kernel read-only data as write-protected in the pagetables,
  84. in order to catch accidental (and incorrect) writes to such const
  85. data. This is recommended so that we can catch kernel bugs sooner.
  86. If in doubt, say "Y".
  87. config DIRECT_GBPAGES
  88. bool "Enable gbpages-mapped kernel pagetables"
  89. depends on DEBUG_KERNEL && EXPERIMENTAL && X86_64
  90. help
  91. Enable gigabyte pages support (if the CPU supports it). This can
  92. improve the kernel's performance a tiny bit by reducing TLB
  93. pressure.
  94. This is experimental code.
  95. If in doubt, say "N".
  96. config DEBUG_RODATA_TEST
  97. bool "Testcase for the DEBUG_RODATA feature"
  98. depends on DEBUG_RODATA
  99. help
  100. This option enables a testcase for the DEBUG_RODATA
  101. feature as well as for the change_page_attr() infrastructure.
  102. If in doubt, say "N"
  103. config DEBUG_NX_TEST
  104. tristate "Testcase for the NX non-executable stack feature"
  105. depends on DEBUG_KERNEL && m
  106. help
  107. This option enables a testcase for the CPU NX capability
  108. and the software setup of this feature.
  109. If in doubt, say "N"
  110. config 4KSTACKS
  111. bool "Use 4Kb for kernel stacks instead of 8Kb"
  112. depends on X86_32
  113. help
  114. If you say Y here the kernel will use a 4Kb stacksize for the
  115. kernel stack attached to each process/thread. This facilitates
  116. running more threads on a system and also reduces the pressure
  117. on the VM subsystem for higher order allocations. This option
  118. will also use IRQ stacks to compensate for the reduced stackspace.
  119. config DOUBLEFAULT
  120. default y
  121. bool "Enable doublefault exception handler" if EMBEDDED
  122. depends on X86_32
  123. help
  124. This option allows trapping of rare doublefault exceptions that
  125. would otherwise cause a system to silently reboot. Disabling this
  126. option saves about 4k and might cause you much additional grey
  127. hair.
  128. config IOMMU_DEBUG
  129. bool "Enable IOMMU debugging"
  130. depends on GART_IOMMU && DEBUG_KERNEL
  131. depends on X86_64
  132. help
  133. Force the IOMMU to on even when you have less than 4GB of
  134. memory and add debugging code. On overflow always panic. And
  135. allow to enable IOMMU leak tracing. Can be disabled at boot
  136. time with iommu=noforce. This will also enable scatter gather
  137. list merging. Currently not recommended for production
  138. code. When you use it make sure you have a big enough
  139. IOMMU/AGP aperture. Most of the options enabled by this can
  140. be set more finegrained using the iommu= command line
  141. options. See Documentation/x86_64/boot-options.txt for more
  142. details.
  143. config IOMMU_LEAK
  144. bool "IOMMU leak tracing"
  145. depends on DEBUG_KERNEL
  146. depends on IOMMU_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 MMIOTRACE_HOOKS
  151. bool
  152. config MMIOTRACE
  153. bool "Memory mapped IO tracing"
  154. depends on DEBUG_KERNEL && PCI
  155. select TRACING
  156. select MMIOTRACE_HOOKS
  157. help
  158. Mmiotrace traces Memory Mapped I/O access and is meant for
  159. debugging and reverse engineering. It is called from the ioremap
  160. implementation and works via page faults. Tracing is disabled by
  161. default and can be enabled at run-time.
  162. See Documentation/tracers/mmiotrace.txt.
  163. If you are not helping to develop drivers, say N.
  164. config MMIOTRACE_TEST
  165. tristate "Test module for mmiotrace"
  166. depends on MMIOTRACE && m
  167. help
  168. This is a dumb module for testing mmiotrace. It is very dangerous
  169. as it will write garbage to IO memory starting at a given address.
  170. However, it should be safe to use on e.g. unused portion of VRAM.
  171. Say N, unless you absolutely know what you are doing.
  172. #
  173. # IO delay types:
  174. #
  175. config IO_DELAY_TYPE_0X80
  176. int
  177. default "0"
  178. config IO_DELAY_TYPE_0XED
  179. int
  180. default "1"
  181. config IO_DELAY_TYPE_UDELAY
  182. int
  183. default "2"
  184. config IO_DELAY_TYPE_NONE
  185. int
  186. default "3"
  187. choice
  188. prompt "IO delay type"
  189. default IO_DELAY_0X80
  190. config IO_DELAY_0X80
  191. bool "port 0x80 based port-IO delay [recommended]"
  192. help
  193. This is the traditional Linux IO delay used for in/out_p.
  194. It is the most tested hence safest selection here.
  195. config IO_DELAY_0XED
  196. bool "port 0xed based port-IO delay"
  197. help
  198. Use port 0xed as the IO delay. This frees up port 0x80 which is
  199. often used as a hardware-debug port.
  200. config IO_DELAY_UDELAY
  201. bool "udelay based port-IO delay"
  202. help
  203. Use udelay(2) as the IO delay method. This provides the delay
  204. while not having any side-effect on the IO port space.
  205. config IO_DELAY_NONE
  206. bool "no port-IO delay"
  207. help
  208. No port-IO delay. Will break on old boxes that require port-IO
  209. delay for certain operations. Should work on most new machines.
  210. endchoice
  211. if IO_DELAY_0X80
  212. config DEFAULT_IO_DELAY_TYPE
  213. int
  214. default IO_DELAY_TYPE_0X80
  215. endif
  216. if IO_DELAY_0XED
  217. config DEFAULT_IO_DELAY_TYPE
  218. int
  219. default IO_DELAY_TYPE_0XED
  220. endif
  221. if IO_DELAY_UDELAY
  222. config DEFAULT_IO_DELAY_TYPE
  223. int
  224. default IO_DELAY_TYPE_UDELAY
  225. endif
  226. if IO_DELAY_NONE
  227. config DEFAULT_IO_DELAY_TYPE
  228. int
  229. default IO_DELAY_TYPE_NONE
  230. endif
  231. config DEBUG_BOOT_PARAMS
  232. bool "Debug boot parameters"
  233. depends on DEBUG_KERNEL
  234. depends on DEBUG_FS
  235. help
  236. This option will cause struct boot_params to be exported via debugfs.
  237. config CPA_DEBUG
  238. bool "CPA self-test code"
  239. depends on DEBUG_KERNEL
  240. help
  241. Do change_page_attr() self-tests every 30 seconds.
  242. config OPTIMIZE_INLINING
  243. bool "Allow gcc to uninline functions marked 'inline'"
  244. help
  245. This option determines if the kernel forces gcc to inline the functions
  246. developers have marked 'inline'. Doing so takes away freedom from gcc to
  247. do what it thinks is best, which is desirable for the gcc 3.x series of
  248. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  249. disabling this option will generate a smaller kernel there. Hopefully
  250. this algorithm is so good that allowing gcc4 to make the decision can
  251. become the default in the future, until then this option is there to
  252. test gcc for this.
  253. If unsure, say N.
  254. endmenu