Kconfig.debug 6.6 KB

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