Kconfig.debug 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. # SPDX-License-Identifier: GPL-2.0
  2. config EARLY_PRINTK_USB
  3. bool
  4. config X86_VERBOSE_BOOTUP
  5. bool "Enable verbose x86 bootup info messages"
  6. default y
  7. help
  8. Enables the informational output from the decompression stage
  9. (e.g. bzImage) of the boot. If you disable this you will still
  10. see errors. Disable this if you want silent bootup.
  11. config EARLY_PRINTK
  12. bool "Early printk" if EXPERT
  13. default y
  14. help
  15. Write kernel log output directly into the VGA buffer or to a serial
  16. port.
  17. This is useful for kernel debugging when your machine crashes very
  18. early before the console code is initialized. For normal operation
  19. it is not recommended because it looks ugly and doesn't cooperate
  20. with klogd/syslogd or the X server. You should normally say N here,
  21. unless you want to debug such a crash.
  22. config EARLY_PRINTK_DBGP
  23. bool "Early printk via EHCI debug port"
  24. depends on EARLY_PRINTK && PCI
  25. select EARLY_PRINTK_USB
  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 say N here,
  32. unless you want to debug such a crash. You need usb debug device.
  33. config EARLY_PRINTK_USB_XDBC
  34. bool "Early printk via the xHCI debug port"
  35. depends on EARLY_PRINTK && PCI
  36. select EARLY_PRINTK_USB
  37. help
  38. Write kernel log output directly into the xHCI debug port.
  39. One use for this feature is kernel debugging, for example when your
  40. machine crashes very early before the regular console code is
  41. initialized. Other uses include simpler, lockless logging instead of
  42. a full-blown printk console driver + klogd.
  43. For normal production environments this is normally not recommended,
  44. because it doesn't feed events into klogd/syslogd and doesn't try to
  45. print anything on the screen.
  46. You should normally say N here, unless you want to debug early
  47. crashes or need a very simple printk logging facility.
  48. config EFI_PGT_DUMP
  49. bool "Dump the EFI pagetable"
  50. depends on EFI
  51. select PTDUMP_CORE
  52. help
  53. Enable this if you want to dump the EFI page table before
  54. enabling virtual mode. This can be used to debug miscellaneous
  55. issues with the mapping of the EFI runtime regions into that
  56. table.
  57. config DEBUG_TLBFLUSH
  58. bool "Set upper limit of TLB entries to flush one-by-one"
  59. depends on DEBUG_KERNEL
  60. help
  61. X86-only for now.
  62. This option allows the user to tune the amount of TLB entries the
  63. kernel flushes one-by-one instead of doing a full TLB flush. In
  64. certain situations, the former is cheaper. This is controlled by the
  65. tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
  66. to -1, the code flushes the whole TLB unconditionally. Otherwise,
  67. for positive values of it, the kernel will use single TLB entry
  68. invalidating instructions according to the following formula:
  69. flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
  70. If in doubt, say "N".
  71. config IOMMU_DEBUG
  72. bool "Enable IOMMU debugging"
  73. depends on GART_IOMMU && DEBUG_KERNEL
  74. depends on X86_64
  75. help
  76. Force the IOMMU to on even when you have less than 4GB of
  77. memory and add debugging code. On overflow always panic. And
  78. allow to enable IOMMU leak tracing. Can be disabled at boot
  79. time with iommu=noforce. This will also enable scatter gather
  80. list merging. Currently not recommended for production
  81. code. When you use it make sure you have a big enough
  82. IOMMU/AGP aperture. Most of the options enabled by this can
  83. be set more finegrained using the iommu= command line
  84. options. See Documentation/x86/x86_64/boot-options.rst for more
  85. details.
  86. config IOMMU_LEAK
  87. bool "IOMMU leak tracing"
  88. depends on IOMMU_DEBUG && DMA_API_DEBUG
  89. help
  90. Add a simple leak tracer to the IOMMU code. This is useful when you
  91. are debugging a buggy device driver that leaks IOMMU mappings.
  92. config HAVE_MMIOTRACE_SUPPORT
  93. def_bool y
  94. config X86_DECODER_SELFTEST
  95. bool "x86 instruction decoder selftest"
  96. depends on DEBUG_KERNEL && INSTRUCTION_DECODER
  97. depends on !COMPILE_TEST
  98. help
  99. Perform x86 instruction decoder selftests at build time.
  100. This option is useful for checking the sanity of x86 instruction
  101. decoder code.
  102. If unsure, say "N".
  103. choice
  104. prompt "IO delay type"
  105. default IO_DELAY_0X80
  106. config IO_DELAY_0X80
  107. bool "port 0x80 based port-IO delay [recommended]"
  108. help
  109. This is the traditional Linux IO delay used for in/out_p.
  110. It is the most tested hence safest selection here.
  111. config IO_DELAY_0XED
  112. bool "port 0xed based port-IO delay"
  113. help
  114. Use port 0xed as the IO delay. This frees up port 0x80 which is
  115. often used as a hardware-debug port.
  116. config IO_DELAY_UDELAY
  117. bool "udelay based port-IO delay"
  118. help
  119. Use udelay(2) as the IO delay method. This provides the delay
  120. while not having any side-effect on the IO port space.
  121. config IO_DELAY_NONE
  122. bool "no port-IO delay"
  123. help
  124. No port-IO delay. Will break on old boxes that require port-IO
  125. delay for certain operations. Should work on most new machines.
  126. endchoice
  127. config DEBUG_BOOT_PARAMS
  128. bool "Debug boot parameters"
  129. depends on DEBUG_KERNEL
  130. depends on DEBUG_FS
  131. help
  132. This option will cause struct boot_params to be exported via debugfs.
  133. config CPA_DEBUG
  134. bool "CPA self-test code"
  135. depends on DEBUG_KERNEL
  136. help
  137. Do change_page_attr() self-tests every 30 seconds.
  138. config DEBUG_ENTRY
  139. bool "Debug low-level entry code"
  140. depends on DEBUG_KERNEL
  141. help
  142. This option enables sanity checks in x86's low-level entry code.
  143. Some of these sanity checks may slow down kernel entries and
  144. exits or otherwise impact performance.
  145. If unsure, say N.
  146. config DEBUG_NMI_SELFTEST
  147. bool "NMI Selftest"
  148. depends on DEBUG_KERNEL && X86_LOCAL_APIC
  149. help
  150. Enabling this option turns on a quick NMI selftest to verify
  151. that the NMI behaves correctly.
  152. This might help diagnose strange hangs that rely on NMI to
  153. function properly.
  154. If unsure, say N.
  155. config DEBUG_IMR_SELFTEST
  156. bool "Isolated Memory Region self test"
  157. depends on INTEL_IMR
  158. help
  159. This option enables automated sanity testing of the IMR code.
  160. Some simple tests are run to verify IMR bounds checking, alignment
  161. and overlapping. This option is really only useful if you are
  162. debugging an IMR memory map or are modifying the IMR code and want to
  163. test your changes.
  164. If unsure say N here.
  165. config X86_DEBUG_FPU
  166. bool "Debug the x86 FPU code"
  167. depends on DEBUG_KERNEL
  168. default y
  169. help
  170. If this option is enabled then there will be extra sanity
  171. checks and (boot time) debug printouts added to the kernel.
  172. This debugging adds some small amount of runtime overhead
  173. to the kernel.
  174. If unsure, say N.
  175. config PUNIT_ATOM_DEBUG
  176. tristate "ATOM Punit debug driver"
  177. depends on PCI
  178. select DEBUG_FS
  179. select IOSF_MBI
  180. help
  181. This is a debug driver, which gets the power states
  182. of all Punit North Complex devices. The power states of
  183. each device is exposed as part of the debugfs interface.
  184. The current power state can be read from
  185. /sys/kernel/debug/punit_atom/dev_power_state
  186. choice
  187. prompt "Choose kernel unwinder"
  188. default UNWINDER_ORC if X86_64
  189. default UNWINDER_FRAME_POINTER if X86_32
  190. help
  191. This determines which method will be used for unwinding kernel stack
  192. traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
  193. livepatch, lockdep, and more.
  194. config UNWINDER_ORC
  195. bool "ORC unwinder"
  196. depends on X86_64
  197. select OBJTOOL
  198. help
  199. This option enables the ORC (Oops Rewind Capability) unwinder for
  200. unwinding kernel stack traces. It uses a custom data format which is
  201. a simplified version of the DWARF Call Frame Information standard.
  202. This unwinder is more accurate across interrupt entry frames than the
  203. frame pointer unwinder. It also enables a 5-10% performance
  204. improvement across the entire kernel compared to frame pointers.
  205. Enabling this option will increase the kernel's runtime memory usage
  206. by roughly 2-4MB, depending on your kernel config.
  207. config UNWINDER_FRAME_POINTER
  208. bool "Frame pointer unwinder"
  209. select FRAME_POINTER
  210. help
  211. This option enables the frame pointer unwinder for unwinding kernel
  212. stack traces.
  213. The unwinder itself is fast and it uses less RAM than the ORC
  214. unwinder, but the kernel text size will grow by ~3% and the kernel's
  215. overall performance will degrade by roughly 5-10%.
  216. config UNWINDER_GUESS
  217. bool "Guess unwinder"
  218. depends on EXPERT
  219. depends on !STACKDEPOT
  220. help
  221. This option enables the "guess" unwinder for unwinding kernel stack
  222. traces. It scans the stack and reports every kernel text address it
  223. finds. Some of the addresses it reports may be incorrect.
  224. While this option often produces false positives, it can still be
  225. useful in many cases. Unlike the other unwinders, it has no runtime
  226. overhead.
  227. endchoice
  228. config FRAME_POINTER
  229. depends on !UNWINDER_ORC && !UNWINDER_GUESS
  230. bool