Kconfig.debug 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. config PAGE_EXTENSION
  2. bool "Extend memmap on extra space for more information on page"
  3. ---help---
  4. Extend memmap on extra space for more information on page. This
  5. could be used for debugging features that need to insert extra
  6. field for every page. This extension enables us to save memory
  7. by not allocating this extra memory according to boottime
  8. configuration.
  9. config DEBUG_PAGEALLOC
  10. bool "Debug page memory allocations"
  11. depends on DEBUG_KERNEL
  12. depends on !HIBERNATION || ARCH_SUPPORTS_DEBUG_PAGEALLOC && !PPC && !SPARC
  13. select PAGE_EXTENSION
  14. select PAGE_POISONING if !ARCH_SUPPORTS_DEBUG_PAGEALLOC
  15. ---help---
  16. Unmap pages from the kernel linear mapping after free_pages().
  17. Depending on runtime enablement, this results in a small or large
  18. slowdown, but helps to find certain types of memory corruption.
  19. For architectures which don't enable ARCH_SUPPORTS_DEBUG_PAGEALLOC,
  20. fill the pages with poison patterns after free_pages() and verify
  21. the patterns before alloc_pages(). Additionally,
  22. this option cannot be enabled in combination with hibernation as
  23. that would result in incorrect warnings of memory corruption after
  24. a resume because free pages are not saved to the suspend image.
  25. By default this option will have a small overhead, e.g. by not
  26. allowing the kernel mapping to be backed by large pages on some
  27. architectures. Even bigger overhead comes when the debugging is
  28. enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc
  29. command line parameter.
  30. config DEBUG_PAGEALLOC_ENABLE_DEFAULT
  31. bool "Enable debug page memory allocations by default?"
  32. default n
  33. depends on DEBUG_PAGEALLOC
  34. ---help---
  35. Enable debug page memory allocations by default? This value
  36. can be overridden by debug_pagealloc=off|on.
  37. config PAGE_POISONING
  38. bool "Poison pages after freeing"
  39. select PAGE_POISONING_NO_SANITY if HIBERNATION
  40. ---help---
  41. Fill the pages with poison patterns after free_pages() and verify
  42. the patterns before alloc_pages. The filling of the memory helps
  43. reduce the risk of information leaks from freed data. This does
  44. have a potential performance impact if enabled with the
  45. "page_poison=1" kernel boot option.
  46. Note that "poison" here is not the same thing as the "HWPoison"
  47. for CONFIG_MEMORY_FAILURE. This is software poisoning only.
  48. If unsure, say N
  49. config PAGE_POISONING_NO_SANITY
  50. depends on PAGE_POISONING
  51. bool "Only poison, don't sanity check"
  52. ---help---
  53. Skip the sanity checking on alloc, only fill the pages with
  54. poison on free. This reduces some of the overhead of the
  55. poisoning feature.
  56. If you are only interested in sanitization, say Y. Otherwise
  57. say N.
  58. config PAGE_POISONING_ZERO
  59. bool "Use zero for poisoning instead of debugging value"
  60. depends on PAGE_POISONING
  61. ---help---
  62. Instead of using the existing poison value, fill the pages with
  63. zeros. This makes it harder to detect when errors are occurring
  64. due to sanitization but the zeroing at free means that it is
  65. no longer necessary to write zeros when GFP_ZERO is used on
  66. allocation.
  67. If unsure, say N
  68. config DEBUG_PAGE_REF
  69. bool "Enable tracepoint to track down page reference manipulation"
  70. depends on DEBUG_KERNEL
  71. depends on TRACEPOINTS
  72. ---help---
  73. This is a feature to add tracepoint for tracking down page reference
  74. manipulation. This tracking is useful to diagnose functional failure
  75. due to migration failures caused by page reference mismatches. Be
  76. careful when enabling this feature because it adds about 30 KB to the
  77. kernel code. However the runtime performance overhead is virtually
  78. nil until the tracepoints are actually enabled.
  79. config DEBUG_RODATA_TEST
  80. bool "Testcase for the marking rodata read-only"
  81. depends on STRICT_KERNEL_RWX
  82. ---help---
  83. This option enables a testcase for the setting rodata read-only.