Kconfig.debug 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. menu "Kernel hacking"
  2. config TRACE_IRQFLAGS_SUPPORT
  3. def_bool y
  4. source "lib/Kconfig.debug"
  5. config NONPROMISC_DEVMEM
  6. bool "Disable promiscuous /dev/mem"
  7. help
  8. The /dev/mem file by default only allows userspace access to PCI
  9. space and the BIOS code and data regions. This is sufficient for
  10. dosemu and X and all common users of /dev/mem. With this config
  11. option, you allow userspace access to all of memory, including
  12. kernel and userspace memory. Accidental access to this is
  13. obviously disasterous, but specific access can be used by people
  14. debugging the kernel.
  15. config EARLY_PRINTK
  16. bool "Early printk" if EMBEDDED
  17. default y
  18. help
  19. Write kernel log output directly into the VGA buffer or to a serial
  20. port.
  21. This is useful for kernel debugging when your machine crashes very
  22. early before the console code is initialized. For normal operation
  23. it is not recommended because it looks ugly and doesn't cooperate
  24. with klogd/syslogd or the X server. You should normally N here,
  25. unless you want to debug such a crash.
  26. config DEBUG_STACKOVERFLOW
  27. bool "Check for stack overflows"
  28. depends on DEBUG_KERNEL
  29. help
  30. This option will cause messages to be printed if free stack space
  31. drops below a certain limit.
  32. config DEBUG_STACK_USAGE
  33. bool "Stack utilization instrumentation"
  34. depends on DEBUG_KERNEL
  35. help
  36. Enables the display of the minimum amount of free stack which each
  37. task has ever had available in the sysrq-T and sysrq-P debug output.
  38. This option will slow down process creation somewhat.
  39. config DEBUG_PAGEALLOC
  40. bool "Debug page memory allocations"
  41. depends on DEBUG_KERNEL
  42. help
  43. Unmap pages from the kernel linear mapping after free_pages().
  44. This results in a large slowdown, but helps to find certain types
  45. of memory corruptions.
  46. config DEBUG_PER_CPU_MAPS
  47. bool "Debug access to per_cpu maps"
  48. depends on DEBUG_KERNEL
  49. depends on X86_64_SMP
  50. default n
  51. help
  52. Say Y to verify that the per_cpu map being accessed has
  53. been setup. Adds a fair amount of code to kernel memory
  54. and decreases performance.
  55. Say N if unsure.
  56. config X86_PTDUMP
  57. bool "Export kernel pagetable layout to userspace via debugfs"
  58. depends on DEBUG_KERNEL
  59. select DEBUG_FS
  60. help
  61. Say Y here if you want to show the kernel pagetable layout in a
  62. debugfs file. This information is only useful for kernel developers
  63. who are working in architecture specific areas of the kernel.
  64. It is probably not a good idea to enable this feature in a production
  65. kernel.
  66. If in doubt, say "N"
  67. config DEBUG_RODATA
  68. bool "Write protect kernel read-only data structures"
  69. default y
  70. depends on DEBUG_KERNEL
  71. help
  72. Mark the kernel read-only data as write-protected in the pagetables,
  73. in order to catch accidental (and incorrect) writes to such const
  74. data. This is recommended so that we can catch kernel bugs sooner.
  75. If in doubt, say "Y".
  76. config DIRECT_GBPAGES
  77. bool "Enable gbpages-mapped kernel pagetables"
  78. depends on DEBUG_KERNEL && EXPERIMENTAL && X86_64
  79. help
  80. Enable gigabyte pages support (if the CPU supports it). This can
  81. improve the kernel's performance a tiny bit by reducing TLB
  82. pressure.
  83. This is experimental code.
  84. If in doubt, say "N".
  85. config DEBUG_RODATA_TEST
  86. bool "Testcase for the DEBUG_RODATA feature"
  87. depends on DEBUG_RODATA
  88. help
  89. This option enables a testcase for the DEBUG_RODATA
  90. feature as well as for the change_page_attr() infrastructure.
  91. If in doubt, say "N"
  92. config DEBUG_NX_TEST
  93. tristate "Testcase for the NX non-executable stack feature"
  94. depends on DEBUG_KERNEL && m
  95. help
  96. This option enables a testcase for the CPU NX capability
  97. and the software setup of this feature.
  98. If in doubt, say "N"
  99. config 4KSTACKS
  100. bool "Use 4Kb for kernel stacks instead of 8Kb"
  101. depends on X86_32
  102. help
  103. If you say Y here the kernel will use a 4Kb stacksize for the
  104. kernel stack attached to each process/thread. This facilitates
  105. running more threads on a system and also reduces the pressure
  106. on the VM subsystem for higher order allocations. This option
  107. will also use IRQ stacks to compensate for the reduced stackspace.
  108. config X86_FIND_SMP_CONFIG
  109. def_bool y
  110. depends on X86_LOCAL_APIC || X86_VOYAGER
  111. depends on X86_32
  112. config X86_MPPARSE
  113. def_bool y
  114. depends on (X86_32 && (X86_LOCAL_APIC && !X86_VISWS)) || X86_64
  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_LEAK
  140. bool "IOMMU leak tracing"
  141. depends on DEBUG_KERNEL
  142. depends on IOMMU_DEBUG
  143. help
  144. Add a simple leak tracer to the IOMMU code. This is useful when you
  145. are debugging a buggy device driver that leaks IOMMU mappings.
  146. config PAGE_FAULT_HANDLERS
  147. bool "Custom page fault handlers"
  148. depends on DEBUG_KERNEL
  149. help
  150. Allow the use of custom page fault handlers. A kernel module may
  151. register a function that is called on every page fault. Custom
  152. handlers are used by some debugging and reverse engineering tools.
  153. config MMIOTRACE
  154. tristate "Memory mapped IO tracing"
  155. depends on DEBUG_KERNEL && PAGE_FAULT_HANDLERS && RELAY && DEBUG_FS
  156. default n
  157. help
  158. This will build a kernel module called mmiotrace.
  159. Mmiotrace traces Memory Mapped I/O access and is meant for debugging
  160. and reverse engineering. The kernel module offers wrapped
  161. versions of the ioremap family of functions. The driver to be traced
  162. must be modified to call these wrappers. A user space program is
  163. required to collect the MMIO data.
  164. See http://nouveau.freedesktop.org/wiki/MmioTrace
  165. If you are not helping to develop drivers, say N.
  166. config MMIOTRACE_TEST
  167. tristate "Test module for mmiotrace"
  168. depends on MMIOTRACE && m
  169. default n
  170. help
  171. This is a dumb module for testing mmiotrace. It is very dangerous
  172. as it will write garbage to IO memory starting at a given address.
  173. However, it should be safe to use on e.g. unused portion of VRAM.
  174. Say N, unless you absolutely know what you are doing.
  175. #
  176. # IO delay types:
  177. #
  178. config IO_DELAY_TYPE_0X80
  179. int
  180. default "0"
  181. config IO_DELAY_TYPE_0XED
  182. int
  183. default "1"
  184. config IO_DELAY_TYPE_UDELAY
  185. int
  186. default "2"
  187. config IO_DELAY_TYPE_NONE
  188. int
  189. default "3"
  190. choice
  191. prompt "IO delay type"
  192. default IO_DELAY_0X80
  193. config IO_DELAY_0X80
  194. bool "port 0x80 based port-IO delay [recommended]"
  195. help
  196. This is the traditional Linux IO delay used for in/out_p.
  197. It is the most tested hence safest selection here.
  198. config IO_DELAY_0XED
  199. bool "port 0xed based port-IO delay"
  200. help
  201. Use port 0xed as the IO delay. This frees up port 0x80 which is
  202. often used as a hardware-debug port.
  203. config IO_DELAY_UDELAY
  204. bool "udelay based port-IO delay"
  205. help
  206. Use udelay(2) as the IO delay method. This provides the delay
  207. while not having any side-effect on the IO port space.
  208. config IO_DELAY_NONE
  209. bool "no port-IO delay"
  210. help
  211. No port-IO delay. Will break on old boxes that require port-IO
  212. delay for certain operations. Should work on most new machines.
  213. endchoice
  214. if IO_DELAY_0X80
  215. config DEFAULT_IO_DELAY_TYPE
  216. int
  217. default IO_DELAY_TYPE_0X80
  218. endif
  219. if IO_DELAY_0XED
  220. config DEFAULT_IO_DELAY_TYPE
  221. int
  222. default IO_DELAY_TYPE_0XED
  223. endif
  224. if IO_DELAY_UDELAY
  225. config DEFAULT_IO_DELAY_TYPE
  226. int
  227. default IO_DELAY_TYPE_UDELAY
  228. endif
  229. if IO_DELAY_NONE
  230. config DEFAULT_IO_DELAY_TYPE
  231. int
  232. default IO_DELAY_TYPE_NONE
  233. endif
  234. config DEBUG_BOOT_PARAMS
  235. bool "Debug boot parameters"
  236. depends on DEBUG_KERNEL
  237. depends on DEBUG_FS
  238. help
  239. This option will cause struct boot_params to be exported via debugfs.
  240. config CPA_DEBUG
  241. bool "CPA self-test code"
  242. depends on DEBUG_KERNEL
  243. help
  244. Do change_page_attr() self-tests every 30 seconds.
  245. config OPTIMIZE_INLINING
  246. bool "Allow gcc to uninline functions marked 'inline'"
  247. depends on BROKEN
  248. help
  249. This option determines if the kernel forces gcc to inline the functions
  250. developers have marked 'inline'. Doing so takes away freedom from gcc to
  251. do what it thinks is best, which is desirable for the gcc 3.x series of
  252. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  253. disabling this option will generate a smaller kernel there. Hopefully
  254. this algorithm is so good that allowing gcc4 to make the decision can
  255. become the default in the future, until then this option is there to
  256. test gcc for this.
  257. endmenu