Kconfig.debug 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. # SPDX-License-Identifier: GPL-2.0
  2. config TRACE_IRQFLAGS_SUPPORT
  3. def_bool y
  4. config EARLY_PRINTK_USB
  5. bool
  6. config X86_VERBOSE_BOOTUP
  7. bool "Enable verbose x86 bootup info messages"
  8. default y
  9. ---help---
  10. Enables the informational output from the decompression stage
  11. (e.g. bzImage) of the boot. If you disable this you will still
  12. see errors. Disable this if you want silent bootup.
  13. config EARLY_PRINTK
  14. bool "Early printk" if EXPERT
  15. default y
  16. ---help---
  17. Write kernel log output directly into the VGA buffer or to a serial
  18. port.
  19. This is useful for kernel debugging when your machine crashes very
  20. early before the console code is initialized. For normal operation
  21. it is not recommended because it looks ugly and doesn't cooperate
  22. with klogd/syslogd or the X server. You should normally say N here,
  23. unless you want to debug such a crash.
  24. config EARLY_PRINTK_DBGP
  25. bool "Early printk via EHCI debug port"
  26. depends on EARLY_PRINTK && PCI
  27. select EARLY_PRINTK_USB
  28. ---help---
  29. Write kernel log output directly into the EHCI debug 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 say N here,
  34. unless you want to debug such a crash. You need usb debug device.
  35. config EARLY_PRINTK_EFI
  36. bool "Early printk via the EFI framebuffer"
  37. depends on EFI && EARLY_PRINTK
  38. select FONT_SUPPORT
  39. ---help---
  40. Write kernel log output directly into the EFI framebuffer.
  41. This is useful for kernel debugging when your machine crashes very
  42. early before the console code is initialized.
  43. config EARLY_PRINTK_USB_XDBC
  44. bool "Early printk via the xHCI debug port"
  45. depends on EARLY_PRINTK && PCI
  46. select EARLY_PRINTK_USB
  47. ---help---
  48. Write kernel log output directly into the xHCI debug port.
  49. One use for this feature is kernel debugging, for example when your
  50. machine crashes very early before the regular console code is
  51. initialized. Other uses include simpler, lockless logging instead of
  52. a full-blown printk console driver + klogd.
  53. For normal production environments this is normally not recommended,
  54. because it doesn't feed events into klogd/syslogd and doesn't try to
  55. print anything on the screen.
  56. You should normally say N here, unless you want to debug early
  57. crashes or need a very simple printk logging facility.
  58. config MCSAFE_TEST
  59. def_bool n
  60. config X86_PTDUMP_CORE
  61. def_bool n
  62. config X86_PTDUMP
  63. tristate "Export kernel pagetable layout to userspace via debugfs"
  64. depends on DEBUG_KERNEL
  65. select DEBUG_FS
  66. select X86_PTDUMP_CORE
  67. ---help---
  68. Say Y here if you want to show the kernel pagetable layout in a
  69. debugfs file. This information is only useful for kernel developers
  70. who are working in architecture specific areas of the kernel.
  71. It is probably not a good idea to enable this feature in a production
  72. kernel.
  73. If in doubt, say "N"
  74. config EFI_PGT_DUMP
  75. bool "Dump the EFI pagetable"
  76. depends on EFI
  77. select X86_PTDUMP_CORE
  78. ---help---
  79. Enable this if you want to dump the EFI page table before
  80. enabling virtual mode. This can be used to debug miscellaneous
  81. issues with the mapping of the EFI runtime regions into that
  82. table.
  83. config DEBUG_WX
  84. bool "Warn on W+X mappings at boot"
  85. select X86_PTDUMP_CORE
  86. ---help---
  87. Generate a warning if any W+X mappings are found at boot.
  88. This is useful for discovering cases where the kernel is leaving
  89. W+X mappings after applying NX, as such mappings are a security risk.
  90. Look for a message in dmesg output like this:
  91. x86/mm: Checked W+X mappings: passed, no W+X pages found.
  92. or like this, if the check failed:
  93. x86/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
  94. Note that even if the check fails, your kernel is possibly
  95. still fine, as W+X mappings are not a security hole in
  96. themselves, what they do is that they make the exploitation
  97. of other unfixed kernel bugs easier.
  98. There is no runtime or memory usage effect of this option
  99. once the kernel has booted up - it's a one time check.
  100. If in doubt, say "Y".
  101. config DOUBLEFAULT
  102. default y
  103. bool "Enable doublefault exception handler" if EXPERT
  104. ---help---
  105. This option allows trapping of rare doublefault exceptions that
  106. would otherwise cause a system to silently reboot. Disabling this
  107. option saves about 4k and might cause you much additional grey
  108. hair.
  109. config DEBUG_TLBFLUSH
  110. bool "Set upper limit of TLB entries to flush one-by-one"
  111. depends on DEBUG_KERNEL
  112. ---help---
  113. X86-only for now.
  114. This option allows the user to tune the amount of TLB entries the
  115. kernel flushes one-by-one instead of doing a full TLB flush. In
  116. certain situations, the former is cheaper. This is controlled by the
  117. tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
  118. to -1, the code flushes the whole TLB unconditionally. Otherwise,
  119. for positive values of it, the kernel will use single TLB entry
  120. invalidating instructions according to the following formula:
  121. flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
  122. If in doubt, say "N".
  123. config IOMMU_DEBUG
  124. bool "Enable IOMMU debugging"
  125. depends on GART_IOMMU && DEBUG_KERNEL
  126. depends on X86_64
  127. ---help---
  128. Force the IOMMU to on even when you have less than 4GB of
  129. memory and add debugging code. On overflow always panic. And
  130. allow to enable IOMMU leak tracing. Can be disabled at boot
  131. time with iommu=noforce. This will also enable scatter gather
  132. list merging. Currently not recommended for production
  133. code. When you use it make sure you have a big enough
  134. IOMMU/AGP aperture. Most of the options enabled by this can
  135. be set more finegrained using the iommu= command line
  136. options. See Documentation/x86/x86_64/boot-options.txt for more
  137. details.
  138. config IOMMU_LEAK
  139. bool "IOMMU leak tracing"
  140. depends on IOMMU_DEBUG && DMA_API_DEBUG
  141. ---help---
  142. Add a simple leak tracer to the IOMMU code. This is useful when you
  143. are debugging a buggy device driver that leaks IOMMU mappings.
  144. config HAVE_MMIOTRACE_SUPPORT
  145. def_bool y
  146. config X86_DECODER_SELFTEST
  147. bool "x86 instruction decoder selftest"
  148. depends on DEBUG_KERNEL && INSTRUCTION_DECODER
  149. depends on !COMPILE_TEST
  150. ---help---
  151. Perform x86 instruction decoder selftests at build time.
  152. This option is useful for checking the sanity of x86 instruction
  153. decoder code.
  154. If unsure, say "N".
  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. ---help---
  228. This option determines if the kernel forces gcc to inline the functions
  229. developers have marked 'inline'. Doing so takes away freedom from gcc to
  230. do what it thinks is best, which is desirable for the gcc 3.x series of
  231. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  232. enabling this option will generate a smaller kernel there. Hopefully
  233. this algorithm is so good that allowing gcc 4.x and above to make the
  234. decision will become the default in the future. Until then this option
  235. is there to test gcc for this.
  236. If unsure, say N.
  237. config DEBUG_ENTRY
  238. bool "Debug low-level entry code"
  239. depends on DEBUG_KERNEL
  240. ---help---
  241. This option enables sanity checks in x86's low-level entry code.
  242. Some of these sanity checks may slow down kernel entries and
  243. exits or otherwise impact performance.
  244. If unsure, say N.
  245. config DEBUG_NMI_SELFTEST
  246. bool "NMI Selftest"
  247. depends on DEBUG_KERNEL && X86_LOCAL_APIC
  248. ---help---
  249. Enabling this option turns on a quick NMI selftest to verify
  250. that the NMI behaves correctly.
  251. This might help diagnose strange hangs that rely on NMI to
  252. function properly.
  253. If unsure, say N.
  254. config DEBUG_IMR_SELFTEST
  255. bool "Isolated Memory Region self test"
  256. default n
  257. depends on INTEL_IMR
  258. ---help---
  259. This option enables automated sanity testing of the IMR code.
  260. Some simple tests are run to verify IMR bounds checking, alignment
  261. and overlapping. This option is really only useful if you are
  262. debugging an IMR memory map or are modifying the IMR code and want to
  263. test your changes.
  264. If unsure say N here.
  265. config X86_DEBUG_FPU
  266. bool "Debug the x86 FPU code"
  267. depends on DEBUG_KERNEL
  268. default y
  269. ---help---
  270. If this option is enabled then there will be extra sanity
  271. checks and (boot time) debug printouts added to the kernel.
  272. This debugging adds some small amount of runtime overhead
  273. to the kernel.
  274. If unsure, say N.
  275. config PUNIT_ATOM_DEBUG
  276. tristate "ATOM Punit debug driver"
  277. depends on PCI
  278. select DEBUG_FS
  279. select IOSF_MBI
  280. ---help---
  281. This is a debug driver, which gets the power states
  282. of all Punit North Complex devices. The power states of
  283. each device is exposed as part of the debugfs interface.
  284. The current power state can be read from
  285. /sys/kernel/debug/punit_atom/dev_power_state
  286. choice
  287. prompt "Choose kernel unwinder"
  288. default UNWINDER_ORC if X86_64
  289. default UNWINDER_FRAME_POINTER if X86_32
  290. ---help---
  291. This determines which method will be used for unwinding kernel stack
  292. traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
  293. livepatch, lockdep, and more.
  294. config UNWINDER_ORC
  295. bool "ORC unwinder"
  296. depends on X86_64
  297. select STACK_VALIDATION
  298. ---help---
  299. This option enables the ORC (Oops Rewind Capability) unwinder for
  300. unwinding kernel stack traces. It uses a custom data format which is
  301. a simplified version of the DWARF Call Frame Information standard.
  302. This unwinder is more accurate across interrupt entry frames than the
  303. frame pointer unwinder. It also enables a 5-10% performance
  304. improvement across the entire kernel compared to frame pointers.
  305. Enabling this option will increase the kernel's runtime memory usage
  306. by roughly 2-4MB, depending on your kernel config.
  307. config UNWINDER_FRAME_POINTER
  308. bool "Frame pointer unwinder"
  309. select FRAME_POINTER
  310. ---help---
  311. This option enables the frame pointer unwinder for unwinding kernel
  312. stack traces.
  313. The unwinder itself is fast and it uses less RAM than the ORC
  314. unwinder, but the kernel text size will grow by ~3% and the kernel's
  315. overall performance will degrade by roughly 5-10%.
  316. This option is recommended if you want to use the livepatch
  317. consistency model, as this is currently the only way to get a
  318. reliable stack trace (CONFIG_HAVE_RELIABLE_STACKTRACE).
  319. config UNWINDER_GUESS
  320. bool "Guess unwinder"
  321. depends on EXPERT
  322. depends on !STACKDEPOT
  323. ---help---
  324. This option enables the "guess" unwinder for unwinding kernel stack
  325. traces. It scans the stack and reports every kernel text address it
  326. finds. Some of the addresses it reports may be incorrect.
  327. While this option often produces false positives, it can still be
  328. useful in many cases. Unlike the other unwinders, it has no runtime
  329. overhead.
  330. endchoice
  331. config FRAME_POINTER
  332. depends on !UNWINDER_ORC && !UNWINDER_GUESS
  333. bool