Kconfig.debug 9.3 KB

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