Kconfig.debug 8.6 KB

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