Kconfig.debug 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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_RODATA_TEST
  65. bool "Testcase for the marking rodata read-only"
  66. default y
  67. ---help---
  68. This option enables a testcase for the setting rodata read-only
  69. as well as for the change_page_attr() infrastructure.
  70. If in doubt, say "N"
  71. config DEBUG_WX
  72. bool "Warn on W+X mappings at boot"
  73. select X86_PTDUMP_CORE
  74. ---help---
  75. Generate a warning if any W+X mappings are found at boot.
  76. This is useful for discovering cases where the kernel is leaving
  77. W+X mappings after applying NX, as such mappings are a security risk.
  78. Look for a message in dmesg output like this:
  79. x86/mm: Checked W+X mappings: passed, no W+X pages found.
  80. or like this, if the check failed:
  81. x86/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
  82. Note that even if the check fails, your kernel is possibly
  83. still fine, as W+X mappings are not a security hole in
  84. themselves, what they do is that they make the exploitation
  85. of other unfixed kernel bugs easier.
  86. There is no runtime or memory usage effect of this option
  87. once the kernel has booted up - it's a one time check.
  88. If in doubt, say "Y".
  89. config DEBUG_SET_MODULE_RONX
  90. bool "Set loadable kernel module data as NX and text as RO"
  91. depends on MODULES
  92. ---help---
  93. This option helps catch unintended modifications to loadable
  94. kernel module's text and read-only data. It also prevents execution
  95. of module data. Such protection may interfere with run-time code
  96. patching and dynamic kernel tracing - and they might also protect
  97. against certain classes of kernel exploits.
  98. If in doubt, say "N".
  99. config DEBUG_NX_TEST
  100. tristate "Testcase for the NX non-executable stack feature"
  101. depends on DEBUG_KERNEL && m
  102. ---help---
  103. This option enables a testcase for the CPU NX capability
  104. and the software setup of this feature.
  105. If in doubt, say "N"
  106. config DOUBLEFAULT
  107. default y
  108. bool "Enable doublefault exception handler" if EXPERT
  109. ---help---
  110. This option allows trapping of rare doublefault exceptions that
  111. would otherwise cause a system to silently reboot. Disabling this
  112. option saves about 4k and might cause you much additional grey
  113. hair.
  114. config DEBUG_TLBFLUSH
  115. bool "Set upper limit of TLB entries to flush one-by-one"
  116. depends on DEBUG_KERNEL
  117. ---help---
  118. X86-only for now.
  119. This option allows the user to tune the amount of TLB entries the
  120. kernel flushes one-by-one instead of doing a full TLB flush. In
  121. certain situations, the former is cheaper. This is controlled by the
  122. tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
  123. to -1, the code flushes the whole TLB unconditionally. Otherwise,
  124. for positive values of it, the kernel will use single TLB entry
  125. invalidating instructions according to the following formula:
  126. flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
  127. If in doubt, say "N".
  128. config IOMMU_DEBUG
  129. bool "Enable IOMMU debugging"
  130. depends on GART_IOMMU && DEBUG_KERNEL
  131. depends on X86_64
  132. ---help---
  133. Force the IOMMU to on even when you have less than 4GB of
  134. memory and add debugging code. On overflow always panic. And
  135. allow to enable IOMMU leak tracing. Can be disabled at boot
  136. time with iommu=noforce. This will also enable scatter gather
  137. list merging. Currently not recommended for production
  138. code. When you use it make sure you have a big enough
  139. IOMMU/AGP aperture. Most of the options enabled by this can
  140. be set more finegrained using the iommu= command line
  141. options. See Documentation/x86/x86_64/boot-options.txt for more
  142. details.
  143. config IOMMU_STRESS
  144. bool "Enable IOMMU stress-test mode"
  145. ---help---
  146. This option disables various optimizations in IOMMU related
  147. code to do real stress testing of the IOMMU code. This option
  148. will cause a performance drop and should only be enabled for
  149. testing.
  150. config IOMMU_LEAK
  151. bool "IOMMU leak tracing"
  152. depends on IOMMU_DEBUG && DMA_API_DEBUG
  153. ---help---
  154. Add a simple leak tracer to the IOMMU code. This is useful when you
  155. are debugging a buggy device driver that leaks IOMMU mappings.
  156. config HAVE_MMIOTRACE_SUPPORT
  157. def_bool y
  158. config X86_DECODER_SELFTEST
  159. bool "x86 instruction decoder selftest"
  160. depends on DEBUG_KERNEL && KPROBES
  161. depends on !COMPILE_TEST
  162. ---help---
  163. Perform x86 instruction decoder selftests at build time.
  164. This option is useful for checking the sanity of x86 instruction
  165. decoder code.
  166. If unsure, say "N".
  167. #
  168. # IO delay types:
  169. #
  170. config IO_DELAY_TYPE_0X80
  171. int
  172. default "0"
  173. config IO_DELAY_TYPE_0XED
  174. int
  175. default "1"
  176. config IO_DELAY_TYPE_UDELAY
  177. int
  178. default "2"
  179. config IO_DELAY_TYPE_NONE
  180. int
  181. default "3"
  182. choice
  183. prompt "IO delay type"
  184. default IO_DELAY_0X80
  185. config IO_DELAY_0X80
  186. bool "port 0x80 based port-IO delay [recommended]"
  187. ---help---
  188. This is the traditional Linux IO delay used for in/out_p.
  189. It is the most tested hence safest selection here.
  190. config IO_DELAY_0XED
  191. bool "port 0xed based port-IO delay"
  192. ---help---
  193. Use port 0xed as the IO delay. This frees up port 0x80 which is
  194. often used as a hardware-debug port.
  195. config IO_DELAY_UDELAY
  196. bool "udelay based port-IO delay"
  197. ---help---
  198. Use udelay(2) as the IO delay method. This provides the delay
  199. while not having any side-effect on the IO port space.
  200. config IO_DELAY_NONE
  201. bool "no port-IO delay"
  202. ---help---
  203. No port-IO delay. Will break on old boxes that require port-IO
  204. delay for certain operations. Should work on most new machines.
  205. endchoice
  206. if IO_DELAY_0X80
  207. config DEFAULT_IO_DELAY_TYPE
  208. int
  209. default IO_DELAY_TYPE_0X80
  210. endif
  211. if IO_DELAY_0XED
  212. config DEFAULT_IO_DELAY_TYPE
  213. int
  214. default IO_DELAY_TYPE_0XED
  215. endif
  216. if IO_DELAY_UDELAY
  217. config DEFAULT_IO_DELAY_TYPE
  218. int
  219. default IO_DELAY_TYPE_UDELAY
  220. endif
  221. if IO_DELAY_NONE
  222. config DEFAULT_IO_DELAY_TYPE
  223. int
  224. default IO_DELAY_TYPE_NONE
  225. endif
  226. config DEBUG_BOOT_PARAMS
  227. bool "Debug boot parameters"
  228. depends on DEBUG_KERNEL
  229. depends on DEBUG_FS
  230. ---help---
  231. This option will cause struct boot_params to be exported via debugfs.
  232. config CPA_DEBUG
  233. bool "CPA self-test code"
  234. depends on DEBUG_KERNEL
  235. ---help---
  236. Do change_page_attr() self-tests every 30 seconds.
  237. config OPTIMIZE_INLINING
  238. bool "Allow gcc to uninline functions marked 'inline'"
  239. ---help---
  240. This option determines if the kernel forces gcc to inline the functions
  241. developers have marked 'inline'. Doing so takes away freedom from gcc to
  242. do what it thinks is best, which is desirable for the gcc 3.x series of
  243. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  244. enabling this option will generate a smaller kernel there. Hopefully
  245. this algorithm is so good that allowing gcc 4.x and above to make the
  246. decision will become the default in the future. Until then this option
  247. is there to test gcc for this.
  248. If unsure, say N.
  249. config DEBUG_ENTRY
  250. bool "Debug low-level entry code"
  251. depends on DEBUG_KERNEL
  252. ---help---
  253. This option enables sanity checks in x86's low-level entry code.
  254. Some of these sanity checks may slow down kernel entries and
  255. exits or otherwise impact performance.
  256. This is currently used to help test NMI code.
  257. If unsure, say N.
  258. config DEBUG_NMI_SELFTEST
  259. bool "NMI Selftest"
  260. depends on DEBUG_KERNEL && X86_LOCAL_APIC
  261. ---help---
  262. Enabling this option turns on a quick NMI selftest to verify
  263. that the NMI behaves correctly.
  264. This might help diagnose strange hangs that rely on NMI to
  265. function properly.
  266. If unsure, say N.
  267. config DEBUG_IMR_SELFTEST
  268. bool "Isolated Memory Region self test"
  269. default n
  270. depends on INTEL_IMR
  271. ---help---
  272. This option enables automated sanity testing of the IMR code.
  273. Some simple tests are run to verify IMR bounds checking, alignment
  274. and overlapping. This option is really only useful if you are
  275. debugging an IMR memory map or are modifying the IMR code and want to
  276. test your changes.
  277. If unsure say N here.
  278. config X86_DEBUG_FPU
  279. bool "Debug the x86 FPU code"
  280. depends on DEBUG_KERNEL
  281. default y
  282. ---help---
  283. If this option is enabled then there will be extra sanity
  284. checks and (boot time) debug printouts added to the kernel.
  285. This debugging adds some small amount of runtime overhead
  286. to the kernel.
  287. If unsure, say N.
  288. config PUNIT_ATOM_DEBUG
  289. tristate "ATOM Punit debug driver"
  290. depends on PCI
  291. select DEBUG_FS
  292. select IOSF_MBI
  293. ---help---
  294. This is a debug driver, which gets the power states
  295. of all Punit North Complex devices. The power states of
  296. each device is exposed as part of the debugfs interface.
  297. The current power state can be read from
  298. /sys/kernel/debug/punit_atom/dev_power_state
  299. endmenu