Kconfig.debug 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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_INTEL_MID
  38. bool "Early printk for Intel MID platform support"
  39. depends on EARLY_PRINTK && X86_INTEL_MID
  40. config EARLY_PRINTK_DBGP
  41. bool "Early printk via EHCI debug port"
  42. depends on EARLY_PRINTK && PCI
  43. ---help---
  44. Write kernel log output directly into the EHCI debug port.
  45. This is useful for kernel debugging when your machine crashes very
  46. early before the console code is initialized. For normal operation
  47. it is not recommended because it looks ugly and doesn't cooperate
  48. with klogd/syslogd or the X server. You should normally N here,
  49. unless you want to debug such a crash. You need usb debug device.
  50. config DEBUG_STACKOVERFLOW
  51. bool "Check for stack overflows"
  52. depends on DEBUG_KERNEL
  53. ---help---
  54. Say Y here if you want to check the overflows of kernel, IRQ
  55. and exception stacks. This option will cause messages of the
  56. stacks in detail when free stack space drops below a certain
  57. limit.
  58. If in doubt, say "N".
  59. config X86_PTDUMP
  60. bool "Export kernel pagetable layout to userspace via debugfs"
  61. depends on DEBUG_KERNEL
  62. select DEBUG_FS
  63. ---help---
  64. Say Y here if you want to show the kernel pagetable layout in a
  65. debugfs file. This information is only useful for kernel developers
  66. who are working in architecture specific areas of the kernel.
  67. It is probably not a good idea to enable this feature in a production
  68. kernel.
  69. If in doubt, say "N"
  70. config DEBUG_RODATA
  71. bool "Write protect kernel read-only data structures"
  72. default y
  73. depends on DEBUG_KERNEL
  74. ---help---
  75. Mark the kernel read-only data as write-protected in the pagetables,
  76. in order to catch accidental (and incorrect) writes to such const
  77. data. This is recommended so that we can catch kernel bugs sooner.
  78. If in doubt, say "Y".
  79. config DEBUG_RODATA_TEST
  80. bool "Testcase for the DEBUG_RODATA feature"
  81. depends on DEBUG_RODATA
  82. default y
  83. ---help---
  84. This option enables a testcase for the DEBUG_RODATA
  85. feature as well as for the change_page_attr() infrastructure.
  86. If in doubt, say "N"
  87. config DEBUG_SET_MODULE_RONX
  88. bool "Set loadable kernel module data as NX and text as RO"
  89. depends on MODULES
  90. ---help---
  91. This option helps catch unintended modifications to loadable
  92. kernel module's text and read-only data. It also prevents execution
  93. of module data. Such protection may interfere with run-time code
  94. patching and dynamic kernel tracing - and they might also protect
  95. against certain classes of kernel exploits.
  96. If in doubt, say "N".
  97. config DEBUG_NX_TEST
  98. tristate "Testcase for the NX non-executable stack feature"
  99. depends on DEBUG_KERNEL && m
  100. ---help---
  101. This option enables a testcase for the CPU NX capability
  102. and the software setup of this feature.
  103. If in doubt, say "N"
  104. config DOUBLEFAULT
  105. default y
  106. bool "Enable doublefault exception handler" if EXPERT
  107. depends on X86_32
  108. ---help---
  109. This option allows trapping of rare doublefault exceptions that
  110. would otherwise cause a system to silently reboot. Disabling this
  111. option saves about 4k and might cause you much additional grey
  112. hair.
  113. config DEBUG_TLBFLUSH
  114. bool "Set upper limit of TLB entries to flush one-by-one"
  115. depends on DEBUG_KERNEL && (X86_64 || X86_INVLPG)
  116. ---help---
  117. X86-only for now.
  118. This option allows the user to tune the amount of TLB entries the
  119. kernel flushes one-by-one instead of doing a full TLB flush. In
  120. certain situations, the former is cheaper. This is controlled by the
  121. tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
  122. to -1, the code flushes the whole TLB unconditionally. Otherwise,
  123. for positive values of it, the kernel will use single TLB entry
  124. invalidating instructions according to the following formula:
  125. flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
  126. If in doubt, say "N".
  127. config IOMMU_DEBUG
  128. bool "Enable IOMMU debugging"
  129. depends on GART_IOMMU && DEBUG_KERNEL
  130. depends on X86_64
  131. ---help---
  132. Force the IOMMU to on even when you have less than 4GB of
  133. memory and add debugging code. On overflow always panic. And
  134. allow to enable IOMMU leak tracing. Can be disabled at boot
  135. time with iommu=noforce. This will also enable scatter gather
  136. list merging. Currently not recommended for production
  137. code. When you use it make sure you have a big enough
  138. IOMMU/AGP aperture. Most of the options enabled by this can
  139. be set more finegrained using the iommu= command line
  140. options. See Documentation/x86/x86_64/boot-options.txt for more
  141. details.
  142. config IOMMU_STRESS
  143. bool "Enable IOMMU stress-test mode"
  144. ---help---
  145. This option disables various optimizations in IOMMU related
  146. code to do real stress testing of the IOMMU code. This option
  147. will cause a performance drop and should only be enabled for
  148. testing.
  149. config IOMMU_LEAK
  150. bool "IOMMU leak tracing"
  151. depends on IOMMU_DEBUG && DMA_API_DEBUG
  152. ---help---
  153. Add a simple leak tracer to the IOMMU code. This is useful when you
  154. are debugging a buggy device driver that leaks IOMMU mappings.
  155. config HAVE_MMIOTRACE_SUPPORT
  156. def_bool y
  157. config X86_DECODER_SELFTEST
  158. bool "x86 instruction decoder selftest"
  159. depends on DEBUG_KERNEL && KPROBES
  160. ---help---
  161. Perform x86 instruction decoder selftests at build time.
  162. This option is useful for checking the sanity of x86 instruction
  163. decoder code.
  164. If unsure, say "N".
  165. #
  166. # IO delay types:
  167. #
  168. config IO_DELAY_TYPE_0X80
  169. int
  170. default "0"
  171. config IO_DELAY_TYPE_0XED
  172. int
  173. default "1"
  174. config IO_DELAY_TYPE_UDELAY
  175. int
  176. default "2"
  177. config IO_DELAY_TYPE_NONE
  178. int
  179. default "3"
  180. choice
  181. prompt "IO delay type"
  182. default IO_DELAY_0X80
  183. config IO_DELAY_0X80
  184. bool "port 0x80 based port-IO delay [recommended]"
  185. ---help---
  186. This is the traditional Linux IO delay used for in/out_p.
  187. It is the most tested hence safest selection here.
  188. config IO_DELAY_0XED
  189. bool "port 0xed based port-IO delay"
  190. ---help---
  191. Use port 0xed as the IO delay. This frees up port 0x80 which is
  192. often used as a hardware-debug port.
  193. config IO_DELAY_UDELAY
  194. bool "udelay based port-IO delay"
  195. ---help---
  196. Use udelay(2) as the IO delay method. This provides the delay
  197. while not having any side-effect on the IO port space.
  198. config IO_DELAY_NONE
  199. bool "no port-IO delay"
  200. ---help---
  201. No port-IO delay. Will break on old boxes that require port-IO
  202. delay for certain operations. Should work on most new machines.
  203. endchoice
  204. if IO_DELAY_0X80
  205. config DEFAULT_IO_DELAY_TYPE
  206. int
  207. default IO_DELAY_TYPE_0X80
  208. endif
  209. if IO_DELAY_0XED
  210. config DEFAULT_IO_DELAY_TYPE
  211. int
  212. default IO_DELAY_TYPE_0XED
  213. endif
  214. if IO_DELAY_UDELAY
  215. config DEFAULT_IO_DELAY_TYPE
  216. int
  217. default IO_DELAY_TYPE_UDELAY
  218. endif
  219. if IO_DELAY_NONE
  220. config DEFAULT_IO_DELAY_TYPE
  221. int
  222. default IO_DELAY_TYPE_NONE
  223. endif
  224. config DEBUG_BOOT_PARAMS
  225. bool "Debug boot parameters"
  226. depends on DEBUG_KERNEL
  227. depends on DEBUG_FS
  228. ---help---
  229. This option will cause struct boot_params to be exported via debugfs.
  230. config CPA_DEBUG
  231. bool "CPA self-test code"
  232. depends on DEBUG_KERNEL
  233. ---help---
  234. Do change_page_attr() self-tests every 30 seconds.
  235. config OPTIMIZE_INLINING
  236. bool "Allow gcc to uninline functions marked 'inline'"
  237. ---help---
  238. This option determines if the kernel forces gcc to inline the functions
  239. developers have marked 'inline'. Doing so takes away freedom from gcc to
  240. do what it thinks is best, which is desirable for the gcc 3.x series of
  241. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  242. enabling this option will generate a smaller kernel there. Hopefully
  243. this algorithm is so good that allowing gcc 4.x and above to make the
  244. decision will become the default in the future. Until then this option
  245. is there to test gcc for this.
  246. If unsure, say N.
  247. config DEBUG_STRICT_USER_COPY_CHECKS
  248. bool "Strict copy size checks"
  249. depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
  250. ---help---
  251. Enabling this option turns a certain set of sanity checks for user
  252. copy operations into compile time failures.
  253. The copy_from_user() etc checks are there to help test if there
  254. are sufficient security checks on the length argument of
  255. the copy operation, by having gcc prove that the argument is
  256. within bounds.
  257. If unsure, or if you run an older (pre 4.4) gcc, 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. endmenu