Kconfig.debug 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. menu "Kernel hacking"
  2. config TRACE_IRQFLAGS_SUPPORT
  3. def_bool y
  4. source "lib/Kconfig.debug"
  5. config X86_VERBOSE_BOOTUP
  6. bool "Enable verbose x86 bootup info messages"
  7. default y
  8. ---help---
  9. Enables the informational output from the decompression stage
  10. (e.g. bzImage) of the boot. If you disable this you will still
  11. see errors. Disable this if you want silent bootup.
  12. config EARLY_PRINTK
  13. bool "Early printk" if EXPERT
  14. default y
  15. ---help---
  16. Write kernel log output directly into the VGA buffer or to a serial
  17. port.
  18. This is useful for kernel debugging when your machine crashes very
  19. early before the console code is initialized. For normal operation
  20. it is not recommended because it looks ugly and doesn't cooperate
  21. with klogd/syslogd or the X server. You should normally N here,
  22. unless you want to debug such a crash.
  23. config EARLY_PRINTK_DBGP
  24. bool "Early printk via EHCI debug port"
  25. depends on EARLY_PRINTK && PCI
  26. ---help---
  27. Write kernel log output directly into the EHCI debug port.
  28. This is useful for kernel debugging when your machine crashes very
  29. early before the console code is initialized. For normal operation
  30. it is not recommended because it looks ugly and doesn't cooperate
  31. with klogd/syslogd or the X server. You should normally N here,
  32. unless you want to debug such a crash. You need usb debug device.
  33. config EARLY_PRINTK_EFI
  34. bool "Early printk via the EFI framebuffer"
  35. depends on EFI && EARLY_PRINTK
  36. select FONT_SUPPORT
  37. ---help---
  38. Write kernel log output directly into the EFI framebuffer.
  39. This is useful for kernel debugging when your machine crashes very
  40. early before the console code is initialized.
  41. config X86_PTDUMP_CORE
  42. def_bool n
  43. config X86_PTDUMP
  44. tristate "Export kernel pagetable layout to userspace via debugfs"
  45. depends on DEBUG_KERNEL
  46. select DEBUG_FS
  47. select X86_PTDUMP_CORE
  48. ---help---
  49. Say Y here if you want to show the kernel pagetable layout in a
  50. debugfs file. This information is only useful for kernel developers
  51. who are working in architecture specific areas of the kernel.
  52. It is probably not a good idea to enable this feature in a production
  53. kernel.
  54. If in doubt, say "N"
  55. config EFI_PGT_DUMP
  56. bool "Dump the EFI pagetable"
  57. depends on EFI
  58. select X86_PTDUMP_CORE
  59. ---help---
  60. Enable this if you want to dump the EFI page table before
  61. enabling virtual mode. This can be used to debug miscellaneous
  62. issues with the mapping of the EFI runtime regions into that
  63. table.
  64. config DEBUG_WX
  65. bool "Warn on W+X mappings at boot"
  66. select X86_PTDUMP_CORE
  67. ---help---
  68. Generate a warning if any W+X mappings are found at boot.
  69. This is useful for discovering cases where the kernel is leaving
  70. W+X mappings after applying NX, as such mappings are a security risk.
  71. Look for a message in dmesg output like this:
  72. x86/mm: Checked W+X mappings: passed, no W+X pages found.
  73. or like this, if the check failed:
  74. x86/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
  75. Note that even if the check fails, your kernel is possibly
  76. still fine, as W+X mappings are not a security hole in
  77. themselves, what they do is that they make the exploitation
  78. of other unfixed kernel bugs easier.
  79. There is no runtime or memory usage effect of this option
  80. once the kernel has booted up - it's a one time check.
  81. If in doubt, say "Y".
  82. config DOUBLEFAULT
  83. default y
  84. bool "Enable doublefault exception handler" if EXPERT
  85. ---help---
  86. This option allows trapping of rare doublefault exceptions that
  87. would otherwise cause a system to silently reboot. Disabling this
  88. option saves about 4k and might cause you much additional grey
  89. hair.
  90. config DEBUG_TLBFLUSH
  91. bool "Set upper limit of TLB entries to flush one-by-one"
  92. depends on DEBUG_KERNEL
  93. ---help---
  94. X86-only for now.
  95. This option allows the user to tune the amount of TLB entries the
  96. kernel flushes one-by-one instead of doing a full TLB flush. In
  97. certain situations, the former is cheaper. This is controlled by the
  98. tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
  99. to -1, the code flushes the whole TLB unconditionally. Otherwise,
  100. for positive values of it, the kernel will use single TLB entry
  101. invalidating instructions according to the following formula:
  102. flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
  103. If in doubt, say "N".
  104. config IOMMU_DEBUG
  105. bool "Enable IOMMU debugging"
  106. depends on GART_IOMMU && DEBUG_KERNEL
  107. depends on X86_64
  108. ---help---
  109. Force the IOMMU to on even when you have less than 4GB of
  110. memory and add debugging code. On overflow always panic. And
  111. allow to enable IOMMU leak tracing. Can be disabled at boot
  112. time with iommu=noforce. This will also enable scatter gather
  113. list merging. Currently not recommended for production
  114. code. When you use it make sure you have a big enough
  115. IOMMU/AGP aperture. Most of the options enabled by this can
  116. be set more finegrained using the iommu= command line
  117. options. See Documentation/x86/x86_64/boot-options.txt for more
  118. details.
  119. config IOMMU_STRESS
  120. bool "Enable IOMMU stress-test mode"
  121. ---help---
  122. This option disables various optimizations in IOMMU related
  123. code to do real stress testing of the IOMMU code. This option
  124. will cause a performance drop and should only be enabled for
  125. testing.
  126. config IOMMU_LEAK
  127. bool "IOMMU leak tracing"
  128. depends on IOMMU_DEBUG && DMA_API_DEBUG
  129. ---help---
  130. Add a simple leak tracer to the IOMMU code. This is useful when you
  131. are debugging a buggy device driver that leaks IOMMU mappings.
  132. config HAVE_MMIOTRACE_SUPPORT
  133. def_bool y
  134. config X86_DECODER_SELFTEST
  135. bool "x86 instruction decoder selftest"
  136. depends on DEBUG_KERNEL && KPROBES
  137. depends on !COMPILE_TEST
  138. ---help---
  139. Perform x86 instruction decoder selftests at build time.
  140. This option is useful for checking the sanity of x86 instruction
  141. decoder code.
  142. If unsure, say "N".
  143. #
  144. # IO delay types:
  145. #
  146. config IO_DELAY_TYPE_0X80
  147. int
  148. default "0"
  149. config IO_DELAY_TYPE_0XED
  150. int
  151. default "1"
  152. config IO_DELAY_TYPE_UDELAY
  153. int
  154. default "2"
  155. config IO_DELAY_TYPE_NONE
  156. int
  157. default "3"
  158. choice
  159. prompt "IO delay type"
  160. default IO_DELAY_0X80
  161. config IO_DELAY_0X80
  162. bool "port 0x80 based port-IO delay [recommended]"
  163. ---help---
  164. This is the traditional Linux IO delay used for in/out_p.
  165. It is the most tested hence safest selection here.
  166. config IO_DELAY_0XED
  167. bool "port 0xed based port-IO delay"
  168. ---help---
  169. Use port 0xed as the IO delay. This frees up port 0x80 which is
  170. often used as a hardware-debug port.
  171. config IO_DELAY_UDELAY
  172. bool "udelay based port-IO delay"
  173. ---help---
  174. Use udelay(2) as the IO delay method. This provides the delay
  175. while not having any side-effect on the IO port space.
  176. config IO_DELAY_NONE
  177. bool "no port-IO delay"
  178. ---help---
  179. No port-IO delay. Will break on old boxes that require port-IO
  180. delay for certain operations. Should work on most new machines.
  181. endchoice
  182. if IO_DELAY_0X80
  183. config DEFAULT_IO_DELAY_TYPE
  184. int
  185. default IO_DELAY_TYPE_0X80
  186. endif
  187. if IO_DELAY_0XED
  188. config DEFAULT_IO_DELAY_TYPE
  189. int
  190. default IO_DELAY_TYPE_0XED
  191. endif
  192. if IO_DELAY_UDELAY
  193. config DEFAULT_IO_DELAY_TYPE
  194. int
  195. default IO_DELAY_TYPE_UDELAY
  196. endif
  197. if IO_DELAY_NONE
  198. config DEFAULT_IO_DELAY_TYPE
  199. int
  200. default IO_DELAY_TYPE_NONE
  201. endif
  202. config DEBUG_BOOT_PARAMS
  203. bool "Debug boot parameters"
  204. depends on DEBUG_KERNEL
  205. depends on DEBUG_FS
  206. ---help---
  207. This option will cause struct boot_params to be exported via debugfs.
  208. config CPA_DEBUG
  209. bool "CPA self-test code"
  210. depends on DEBUG_KERNEL
  211. ---help---
  212. Do change_page_attr() self-tests every 30 seconds.
  213. config OPTIMIZE_INLINING
  214. bool "Allow gcc to uninline functions marked 'inline'"
  215. ---help---
  216. This option determines if the kernel forces gcc to inline the functions
  217. developers have marked 'inline'. Doing so takes away freedom from gcc to
  218. do what it thinks is best, which is desirable for the gcc 3.x series of
  219. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  220. enabling this option will generate a smaller kernel there. Hopefully
  221. this algorithm is so good that allowing gcc 4.x and above to make the
  222. decision will become the default in the future. Until then this option
  223. is there to test gcc for this.
  224. If unsure, say N.
  225. config DEBUG_ENTRY
  226. bool "Debug low-level entry code"
  227. depends on DEBUG_KERNEL
  228. ---help---
  229. This option enables sanity checks in x86's low-level entry code.
  230. Some of these sanity checks may slow down kernel entries and
  231. exits or otherwise impact performance.
  232. This is currently used to help test NMI code.
  233. If unsure, say N.
  234. config DEBUG_NMI_SELFTEST
  235. bool "NMI Selftest"
  236. depends on DEBUG_KERNEL && X86_LOCAL_APIC
  237. ---help---
  238. Enabling this option turns on a quick NMI selftest to verify
  239. that the NMI behaves correctly.
  240. This might help diagnose strange hangs that rely on NMI to
  241. function properly.
  242. If unsure, say N.
  243. config DEBUG_IMR_SELFTEST
  244. bool "Isolated Memory Region self test"
  245. default n
  246. depends on INTEL_IMR
  247. ---help---
  248. This option enables automated sanity testing of the IMR code.
  249. Some simple tests are run to verify IMR bounds checking, alignment
  250. and overlapping. This option is really only useful if you are
  251. debugging an IMR memory map or are modifying the IMR code and want to
  252. test your changes.
  253. If unsure say N here.
  254. config X86_DEBUG_FPU
  255. bool "Debug the x86 FPU code"
  256. depends on DEBUG_KERNEL
  257. default y
  258. ---help---
  259. If this option is enabled then there will be extra sanity
  260. checks and (boot time) debug printouts added to the kernel.
  261. This debugging adds some small amount of runtime overhead
  262. to the kernel.
  263. If unsure, say N.
  264. config PUNIT_ATOM_DEBUG
  265. tristate "ATOM Punit debug driver"
  266. select DEBUG_FS
  267. select IOSF_MBI
  268. ---help---
  269. This is a debug driver, which gets the power states
  270. of all Punit North Complex devices. The power states of
  271. each device is exposed as part of the debugfs interface.
  272. The current power state can be read from
  273. /sys/kernel/debug/punit_atom/dev_power_state
  274. endmenu