Kconfig.debug 11 KB

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