Kconfig.debug 8.0 KB

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