Kconfig.debug 11 KB

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