Kconfig.debug 11 KB

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