^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) menu "Kernel hacking"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) menu "printk and dmesg options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) config PRINTK_TIME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) bool "Show timing information on printks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) depends on PRINTK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Selecting this option causes time stamps of the printk()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) messages to be added to the output of the syslog() system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) call and at the console.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) The timestamp is always recorded internally, and exported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) to /dev/kmsg. This flag just specifies if the timestamp should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) be included, not that the timestamp is recorded.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) The behavior is also controlled by the kernel command line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) config PRINTK_TIME_FROM_ARM_ARCH_TIMER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) bool "Timing from ARM architected timer"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) depends on PRINTK_TIME && ARM_ARCH_TIMER && NO_GKI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) config PRINTK_CALLER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) bool "Show caller information on printks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) depends on PRINTK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Selecting this option causes printk() to add a caller "thread id" (if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) in task context) or a caller "processor id" (if not in task context)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) to every message.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) This option is intended for environments where multiple threads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) concurrently call printk() for many times, for it is difficult to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) interpret without knowing where these lines (or sometimes individual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) line which was divided into multiple lines due to race) came from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) Since toggling after boot makes the code racy, currently there is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) no option to enable/disable at the kernel command line parameter or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) sysfs interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) config CONSOLE_LOGLEVEL_DEFAULT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int "Default console loglevel (1-15)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) range 1 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) default "7"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) Default loglevel to determine what will be printed on the console.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Setting a default here is equivalent to passing in loglevel=<x> in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) the kernel bootargs. loglevel=<x> continues to override whatever
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) value is specified here as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Note: This does not affect the log level of un-prefixed printk()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) option.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) config CONSOLE_LOGLEVEL_QUIET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int "quiet console loglevel (1-15)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) range 1 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) default "4"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) loglevel to use when "quiet" is passed on the kernel commandline.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) When "quiet" is passed on the kernel commandline this loglevel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) will be used as the loglevel. IOW passing "quiet" will be the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) equivalent of passing "loglevel=<CONSOLE_LOGLEVEL_QUIET>"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) config MESSAGE_LOGLEVEL_DEFAULT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int "Default message log level (1-7)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) range 1 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) default "4"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) Default log level for printk statements with no specified priority.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) that are auditing their logs closely may want to set it to a lower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) priority.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) Note: This does not affect what message level gets printed on the console
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) by default. To change that, use loglevel=<x> in the kernel bootargs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) config BOOT_PRINTK_DELAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) bool "Delay each boot printk message by N milliseconds"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) This build option allows you to read kernel boot messages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) by inserting a short delay after each one. The delay is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) specified in milliseconds on the kernel command line,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) using "boot_delay=N".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) It is likely that you would also need to use "lpj=M" to preset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) the "loops per jiffie" value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) See a previous boot log for the "lpj" value to use for your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) system, and then set "lpj=M" before setting "boot_delay=N".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) NOTE: Using this option may adversely affect SMP systems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) I.e., processors other than the first one may not boot up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) what it believes to be lockup conditions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) config DYNAMIC_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) bool "Enable dynamic printk() support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) depends on PRINTK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) depends on (DEBUG_FS || PROC_FS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) select DYNAMIC_DEBUG_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) Compiles debug level messages into the kernel, which would not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) otherwise be available at runtime. These messages can then be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) enabled/disabled based on various levels of scope - per source file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) function, module, format string, and line number. This mechanism
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) implicitly compiles in all pr_debug() and dev_dbg() calls, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) enlarges the kernel text size by about 2%.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) If a source file is compiled with DEBUG flag set, any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) pr_debug() calls in it are enabled by default, but can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) disabled at runtime as below. Note that DEBUG flag is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) turned on by many CONFIG_*DEBUG* options.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) Usage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) Dynamic debugging is controlled via the 'dynamic_debug/control' file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) which is contained in the 'debugfs' filesystem or procfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) Thus, the debugfs or procfs filesystem must first be mounted before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) making use of this feature.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) We refer the control file as: <debugfs>/dynamic_debug/control. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) file contains a list of the debug statements that can be enabled. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) format for each line of the file is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) filename:lineno [module]function flags format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) filename : source file of the debug statement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) lineno : line number of the debug statement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) module : module that contains the debug statement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) function : function that contains the debug statement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) flags : '=p' means the line is turned 'on' for printing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) format : the format used for the debug statement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) From a live system:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) nullarbor:~ # cat <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) # filename:lineno [module]function flags format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) Example usage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) // enable the message at line 1603 of file svcsock.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) // enable all the messages in file svcsock.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) nullarbor:~ # echo -n 'file svcsock.c +p' >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) // enable all the messages in the NFS server module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) nullarbor:~ # echo -n 'module nfsd +p' >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) // enable all 12 messages in the function svc_process()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) nullarbor:~ # echo -n 'func svc_process +p' >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) // disable all 12 messages in the function svc_process()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) nullarbor:~ # echo -n 'func svc_process -p' >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) <debugfs>/dynamic_debug/control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) See Documentation/admin-guide/dynamic-debug-howto.rst for additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) config DYNAMIC_DEBUG_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) bool "Enable core function of dynamic debug support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) depends on PRINTK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) depends on (DEBUG_FS || PROC_FS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) Enable core functional support of dynamic debug. It is useful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) when you want to tie dynamic debug to your kernel modules with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) DYNAMIC_DEBUG_MODULE defined for each of them, especially for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) the case of embedded system where the kernel image size is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) sensitive for people.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) config SYMBOLIC_ERRNAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) bool "Support symbolic error names in printf"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) default y if PRINTK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) If you say Y here, the kernel's printf implementation will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) be able to print symbolic error names such as ENOSPC instead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) of the number 28. It makes the kernel image slightly larger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) (about 3KB), but can make the kernel logs easier to read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) config DEBUG_BUGVERBOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) Say Y here to make BUG() panics output the file name and line number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) of the BUG call as well as the EIP and oops trace. This aids
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) debugging but costs about 70-100K of memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) endmenu # "printk and dmesg options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) menu "Compile-time checks and compiler options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) config DEBUG_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) bool "Compile the kernel with debug info"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) depends on DEBUG_KERNEL && !COMPILE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) If you say Y here the resulting kernel image will include
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) debugging info resulting in a larger kernel image.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) This adds debug symbols to the kernel and modules (gcc -g), and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) is needed if you intend to use kernel crashdump or binary object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) tools like crash, kgdb, LKCD, gdb, etc on the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) Say Y here only if you plan to debug the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) if DEBUG_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) config DEBUG_INFO_REDUCED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) bool "Reduce debugging information"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) If you say Y here gcc is instructed to generate less debugging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) information for structure types. This means that tools that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) need full debugging information (like kgdb or systemtap) won't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) be happy. But if you merely need debugging information to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) resolve line numbers there is no loss. Advantage is that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) build directory object sizes shrink dramatically over a full
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) DEBUG_INFO build and compile times are reduced too.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) Only works with newer gcc versions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) config DEBUG_INFO_COMPRESSED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) bool "Compressed debugging information"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) depends on $(cc-option,-gz=zlib)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) depends on $(ld-option,--compress-debug-sections=zlib)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) Compress the debug information using zlib. Requires GCC 5.0+ or Clang
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 5.0+, binutils 2.26+, and zlib.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) Users of dpkg-deb via scripts/package/builddeb may find an increase in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) size of their debug .deb packages with this config set, due to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) debug info being compressed with zlib, then the object files being
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) recompressed with a different compression scheme. But this is still
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) preferable to setting $KDEB_COMPRESS to "none" which would be even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) larger.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) config DEBUG_INFO_SPLIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) bool "Produce split debuginfo in .dwo files"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) depends on $(cc-option,-gsplit-dwarf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) Generate debug info into separate .dwo files. This significantly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) reduces the build directory size for builds with DEBUG_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) because it stores the information only once on disk in .dwo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) files instead of multiple times in object files and executables.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) In addition the debug information is also compressed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) Requires recent gcc (4.7+) and recent gdb/binutils.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) Any tool that packages or reads debug information would need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) to know about the .dwo files and include them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) Incompatible with older versions of ccache.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) config DEBUG_INFO_DWARF4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) bool "Generate dwarf4 debuginfo"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) depends on $(cc-option,-gdwarf-4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) Generate dwarf4 debug info. This requires recent versions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) of gcc and gdb. It makes the debug information larger.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) But it significantly improves the success of resolving
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) variables in gdb on optimized code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) config DEBUG_INFO_BTF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) bool "Generate BTF typeinfo"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) Generate deduplicated BTF type information from DWARF debug info.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) Turning this on expects presence of pahole tool, which will convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) DWARF type info into equivalent deduplicated BTF type info.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) config GDB_SCRIPTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) bool "Provide GDB scripts for kernel debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) This creates the required links to GDB helper scripts in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) build directory. If you load vmlinux into gdb, the helper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) scripts will be automatically imported by gdb as well, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) additional functions are available to analyze a Linux kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) instance. See Documentation/dev-tools/gdb-kernel-debugging.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) for further details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) endif # DEBUG_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) config ENABLE_MUST_CHECK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) bool "Enable __must_check logic"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) Enable the __must_check logic in the kernel build. Disable this to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) suppress the "warning: ignoring return value of 'foo', declared with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) attribute warn_unused_result" messages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) config FRAME_WARN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) int "Warn for stack frames larger than"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) range 0 8192
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) default 2048 if GCC_PLUGIN_LATENT_ENTROPY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) default 1280 if (!64BIT && PARISC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) default 1024 if (!64BIT && !PARISC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) default 2048 if 64BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) Tell gcc to warn at build time for stack frames larger than this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) Setting this too low will cause a lot of warnings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) Setting it to 0 disables the warning.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) config STRIP_ASM_SYMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) bool "Strip assembler-generated symbols during link"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) Strip internal assembler-generated symbols during a link (symbols
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) that look like '.Lxxx') so they don't pollute the output of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) get_wchan() and suchlike.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) config READABLE_ASM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) bool "Generate readable assembler code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) Disable some compiler optimizations that tend to generate human unreadable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) assembler output. This may make the kernel slightly slower, but it helps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) to keep kernel developers who have to stare a lot at assembler listings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) sane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) config HEADERS_INSTALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) bool "Install uapi headers to usr/include"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) depends on !UML
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) This option will install uapi headers (headers exported to user-space)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) into the usr/include directory for use during the kernel build.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) This is unneeded for building the kernel itself, but needed for some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) user-space program samples. It is also needed by some features such
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) as uapi header sanity checks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) config DEBUG_SECTION_MISMATCH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) bool "Enable full Section mismatch analysis"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) The section mismatch analysis checks if there are illegal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) references from one section to another section.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) During linktime or runtime, some sections are dropped;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) any use of code/data previously in these sections would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) most likely result in an oops.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) In the code, functions and variables are annotated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) __init,, etc. (see the full list in include/linux/init.h),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) which results in the code/data being placed in specific sections.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) The section mismatch analysis is always performed after a full
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) kernel build, and enabling this option causes the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) additional step to occur:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) - Add the option -fno-inline-functions-called-once to gcc commands.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) When inlining a function annotated with __init in a non-init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) function, we would lose the section information and thus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) the analysis would not catch the illegal reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) This option tells gcc to inline less (but it does result in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) a larger kernel).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) config SECTION_MISMATCH_WARN_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) bool "Make section mismatch errors non-fatal"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) If you say N here, the build process will fail if there are any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) section mismatch, instead of just throwing warnings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) If unsure, say Y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) config DEBUG_FORCE_FUNCTION_ALIGN_32B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) bool "Force all function address 32B aligned" if EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) There are cases that a commit from one domain changes the function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) address alignment of other domains, and cause magic performance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) bump (regression or improvement). Enable this option will help to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) verify if the bump is caused by function alignment changes, while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) it will slightly increase the kernel size and affect icache usage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) It is mainly for debug and performance tuning use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) # Select this config option from the architecture Kconfig, if it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) # is preferred to always offer frame pointers as a config
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) # option on the architecture (regardless of KERNEL_DEBUG):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) config ARCH_WANT_FRAME_POINTERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) config FRAME_POINTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) bool "Compile the kernel with frame pointers"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) If you say Y here the resulting kernel image will be slightly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) larger and slower, but it gives very useful debugging information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) in case of kernel bugs. (precise oopses/stacktraces/warnings)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) config STACK_VALIDATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) bool "Compile-time stack metadata validation"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) depends on HAVE_STACK_VALIDATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) Add compile-time checks to validate stack metadata, including frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) pointers (if CONFIG_FRAME_POINTER is enabled). This helps ensure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) that runtime stack traces are more reliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) This is also a prerequisite for generation of ORC unwind data, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) is needed for CONFIG_UNWINDER_ORC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) For more information, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) tools/objtool/Documentation/stack-validation.txt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) config VMLINUX_VALIDATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) depends on STACK_VALIDATION && DEBUG_ENTRY && !PARAVIRT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) config DEBUG_FORCE_WEAK_PER_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) bool "Force weak per-cpu definitions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) s390 and alpha require percpu variables in modules to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) defined weak to work around addressing range issue which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) puts the following two restrictions on percpu variable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) definitions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 1. percpu symbols must be unique whether static or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 2. percpu variables can't be defined inside a function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) To ensure that generic code follows the above rules, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) option forces all percpu variables to be defined as weak.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) endmenu # "Compiler options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) menu "Generic Kernel Debugging Instruments"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) config MAGIC_SYSRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) bool "Magic SysRq key"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) depends on !UML
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) If you say Y here, you will have some control over the system even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) if the system crashes for example during kernel debugging (e.g., you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) will be able to flush the buffer cache to disk, reboot the system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) immediately or dump some status information). This is accomplished
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) by pressing various keys while holding SysRq (Alt+PrintScreen). It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) also works on a serial console (on PC hardware at least), if you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) send a BREAK and then within 5 seconds a command keypress. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) keys are documented in <file:Documentation/admin-guide/sysrq.rst>.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) Don't say Y unless you really know what this hack does.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) config MAGIC_SYSRQ_DEFAULT_ENABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) hex "Enable magic SysRq key functions by default"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) depends on MAGIC_SYSRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) default 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) Specifies which SysRq key functions are enabled by default.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) This may be set to 1 or 0 to enable or disable them all, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) to a bitmask as described in Documentation/admin-guide/sysrq.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) config MAGIC_SYSRQ_SERIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) bool "Enable magic SysRq key over serial"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) depends on MAGIC_SYSRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) Many embedded boards have a disconnected TTL level serial which can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) generate some garbage that can lead to spurious false sysrq detects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) This option allows you to decide whether you want to enable the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) magic SysRq key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) config MAGIC_SYSRQ_SERIAL_SEQUENCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) string "Char sequence that enables magic SysRq over serial"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) depends on MAGIC_SYSRQ_SERIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) default ""
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) Specifies a sequence of characters that can follow BREAK to enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) SysRq on a serial console.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) If unsure, leave an empty string and the option will not be enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) config DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) bool "Debug Filesystem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) debugfs is a virtual file system that kernel developers use to put
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) debugging files into. Enable this option to be able to read and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) write to these files.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) For detailed documentation on the debugfs API, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) Documentation/filesystems/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) choice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) prompt "Debugfs default access"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) depends on DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) default DEBUG_FS_ALLOW_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) This selects the default access restrictions for debugfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) It can be overridden with kernel command line option
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) debugfs=[on,no-mount,off]. The restrictions apply for API access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) and filesystem registration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) config DEBUG_FS_ALLOW_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) bool "Access normal"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) No restrictions apply. Both API and filesystem registration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) is on. This is the normal default operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) config DEBUG_FS_DISALLOW_MOUNT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) bool "Do not register debugfs as filesystem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) The API is open but filesystem is not loaded. Clients can still do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) their work and read with debug tools that do not need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) debugfs filesystem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) config DEBUG_FS_ALLOW_NONE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) bool "No access"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) Access is off. Clients get -PERM when trying to create nodes in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) debugfs tree and debugfs is not registered as a filesystem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) Client can then back-off or continue without debugfs access.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) endchoice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) source "lib/Kconfig.kgdb"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) source "lib/Kconfig.ubsan"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) source "lib/Kconfig.kcsan"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) config DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) bool "Kernel debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) Say Y here if you are developing drivers or trying to debug and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) identify kernel problems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) config DEBUG_MISC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) bool "Miscellaneous debug code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) default DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) Say Y here if you need to enable miscellaneous debug code that should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) be under a more specific debug option but isn't.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) menu "Memory Debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) source "mm/Kconfig.debug"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) config DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) bool "Debug object operations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) If you say Y here, additional code will be inserted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) kernel to track the life time of various objects and validate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) the operations on those objects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) config DEBUG_OBJECTS_SELFTEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) bool "Debug objects selftest"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) This enables the selftest of the object debug code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) config DEBUG_OBJECTS_FREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) bool "Debug objects in freed memory"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) This enables checks whether a k/v free operation frees an area
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) which contains an object which has not been deactivated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) properly. This can make kmalloc/kfree-intensive workloads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) much slower.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) config DEBUG_OBJECTS_TIMERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) bool "Debug timer objects"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) If you say Y here, additional code will be inserted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) timer routines to track the life time of timer objects and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) validate the timer operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) config DEBUG_OBJECTS_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) bool "Debug work objects"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) If you say Y here, additional code will be inserted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) work queue routines to track the life time of work objects and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) validate the work operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) config DEBUG_OBJECTS_RCU_HEAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) bool "Debug RCU callbacks objects"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) Enable this to turn on debugging of RCU list heads (call_rcu() usage).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) config DEBUG_OBJECTS_PERCPU_COUNTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) bool "Debug percpu counter objects"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) If you say Y here, additional code will be inserted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) percpu counter routines to track the life time of percpu counter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) objects and validate the percpu counter operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) config DEBUG_OBJECTS_ENABLE_DEFAULT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) int "debug_objects bootup default value (0-1)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) range 0 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) default "1"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) depends on DEBUG_OBJECTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) Debug objects boot parameter default value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) config DEBUG_SLAB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) bool "Debug slab memory allocations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) depends on DEBUG_KERNEL && SLAB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) Say Y here to have the kernel do limited verification on memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) allocation as well as poisoning memory on free to catch use of freed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) memory. This can make kmalloc/kfree-intensive workloads much slower.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) config SLUB_DEBUG_ON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) bool "SLUB debugging on by default"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) depends on SLUB && SLUB_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) Boot with debugging on by default. SLUB boots by default with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) the runtime debug capabilities switched off. Enabling this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) equivalent to specifying the "slub_debug" parameter on boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) There is no support for more fine grained debug control like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) possible with slub_debug=xxx. SLUB debugging may be switched
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) "slub_debug=-".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) config SLUB_STATS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) bool "Enable SLUB performance statistics"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) depends on SLUB && SYSFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) SLUB statistics are useful to debug SLUBs allocation behavior in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) order find ways to optimize the allocator. This should never be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) enabled for production use since keeping statistics slows down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) the allocator by a few percentage points. The slabinfo command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) supports the determination of the most active slabs to figure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) out which slabs are relevant to a particular load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) Try running: slabinfo -DA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) config HAVE_DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) config DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) bool "Kernel memory leak detector"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) select DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) select STACKTRACE if STACKTRACE_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) select KALLSYMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) select CRC32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) Say Y here if you want to enable the memory leak
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) detector. The memory allocation/freeing is traced in a way
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) similar to the Boehm's conservative garbage collector, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) difference being that the orphan objects are not freed but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) only shown in /sys/kernel/debug/kmemleak. Enabling this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) feature will introduce an overhead to memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) allocations. See Documentation/dev-tools/kmemleak.rst for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) of finding leaks due to the slab objects poisoning.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) In order to access the kmemleak file, debugfs needs to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) mounted (usually at /sys/kernel/debug).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) config DEBUG_KMEMLEAK_MEM_POOL_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) int "Kmemleak memory pool size"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) depends on DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) range 200 1000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) default 16000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) Kmemleak must track all the memory allocations to avoid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) reporting false positives. Since memory may be allocated or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) freed before kmemleak is fully initialised, use a static pool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) of metadata objects to track such callbacks. After kmemleak is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) fully initialised, this memory pool acts as an emergency one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) if slab allocations fail.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) config DEBUG_KMEMLEAK_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) tristate "Simple test for the kernel memory leak detector"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) depends on DEBUG_KMEMLEAK && m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) This option enables a module that explicitly leaks memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) config DEBUG_KMEMLEAK_DEFAULT_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) bool "Default kmemleak to off"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) depends on DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) Say Y here to disable kmemleak by default. It can then be enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) on the command line via kmemleak=on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) config DEBUG_KMEMLEAK_AUTO_SCAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) bool "Enable kmemleak auto scan thread on boot up"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) depends on DEBUG_KMEMLEAK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) Depending on the cpu, kmemleak scan may be cpu intensive and can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) stall user tasks at times. This option enables/disables automatic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) kmemleak scan at boot up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) Say N here to disable kmemleak auto scan thread to stop automatic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) scanning. Disabling this option disables automatic reporting of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) memory leaks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) If unsure, say Y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) config DEBUG_STACK_USAGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) bool "Stack utilization instrumentation"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) depends on DEBUG_KERNEL && !IA64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) Enables the display of the minimum amount of free stack which each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) task has ever had available in the sysrq-T and sysrq-P debug output.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) This option will slow down process creation somewhat.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) config SCHED_STACK_END_CHECK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) bool "Detect stack corruption on calls to schedule()"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) This option checks for a stack overrun on calls to schedule().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) If the stack end location is found to be over written always panic as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) the content of the corrupted region can no longer be trusted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) This is to ensure no erroneous behaviour occurs which could result in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) data corruption or a sporadic crash at a later stage once the region
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) is examined. The runtime overhead introduced is minimal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) config ARCH_HAS_DEBUG_VM_PGTABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) An architecture should select this when it can successfully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) build and run DEBUG_VM_PGTABLE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) config DEBUG_VM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) bool "Debug VM"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) Enable this to turn on extended checks in the virtual-memory system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) that may impact performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) config DEBUG_VM_VMACACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) bool "Debug VMA caching"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) depends on DEBUG_VM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) Enable this to turn on VMA caching debug information. Doing so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) can cause significant overhead, so only enable it in non-production
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) environments.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) config DEBUG_VM_RB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) bool "Debug VM red-black trees"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) depends on DEBUG_VM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) Enable VM red-black tree debugging information and extra validations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) config DEBUG_VM_PGFLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) bool "Debug page-flags operations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) depends on DEBUG_VM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) Enables extra validation on page flags operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) config DEBUG_VM_PGTABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) bool "Debug arch page table for semantics compliance"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) depends on MMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) depends on ARCH_HAS_DEBUG_VM_PGTABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) default y if DEBUG_VM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) This option provides a debug method which can be used to test
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) architecture page table helper functions on various platforms in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) verifying if they comply with expected generic MM semantics. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) will help architecture code in making sure that any changes or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) new additions of these helpers still conform to expected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) semantics of the generic MM. Platforms will have to opt in for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) this through ARCH_HAS_DEBUG_VM_PGTABLE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) config ARCH_HAS_DEBUG_VIRTUAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) config DEBUG_VIRTUAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) bool "Debug VM translations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) depends on DEBUG_KERNEL && ARCH_HAS_DEBUG_VIRTUAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) Enable some costly sanity checks in virtual to page code. This can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) catch mistakes with virt_to_page() and friends.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) config DEBUG_NOMMU_REGIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) bool "Debug the global anon/private NOMMU mapping region tree"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) depends on DEBUG_KERNEL && !MMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) This option causes the global tree of anonymous and private mapping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) regions to be regularly checked for invalid topology.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) config DEBUG_MEMORY_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) bool "Debug memory initialisation" if EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) default !EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) Enable this for additional checks during memory initialisation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) The sanity checks verify aspects of the VM such as the memory model
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) and other information provided by the architecture. Verbose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) information will be printed at KERN_DEBUG loglevel depending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) on the mminit_loglevel= command-line option.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820) If unsure, say Y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822) config MEMORY_NOTIFIER_ERROR_INJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) tristate "Memory hotplug notifier error injection module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) This option provides the ability to inject artificial errors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) memory hotplug notifier chain callbacks. It is controlled through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) If the notifier call chain should be failed with some events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) notified, write the error code to "actions/<notifier event>/error".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) Example: Inject memory hotplug offline error (-12 == -ENOMEM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) # cd /sys/kernel/debug/notifier-error-inject/memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) # echo -12 > actions/MEM_GOING_OFFLINE/error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) # echo offline > /sys/devices/system/memory/memoryXXX/state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) bash: echo: write error: Cannot allocate memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) To compile this code as a module, choose M here: the module will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) be called memory-notifier-error-inject.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) config DEBUG_PER_CPU_MAPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) bool "Debug access to per_cpu maps"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) depends on SMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) Say Y to verify that the per_cpu map being accessed has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) been set up. This adds a fair amount of code to kernel memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) and decreases performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) config DEBUG_HIGHMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857) bool "Highmem debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) depends on DEBUG_KERNEL && HIGHMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) This option enables additional error checking for high memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) systems. Disable for production systems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) config HAVE_DEBUG_STACKOVERFLOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) config DEBUG_STACKOVERFLOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) bool "Check for stack overflows"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870) Say Y here if you want to check for overflows of kernel, IRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) and exception stacks (if your architecture uses them). This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) option will show detailed messages if free stack space drops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) below a certain limit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) These kinds of bugs usually occur when call-chains in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) kernel get too deep, especially when interrupts are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) involved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) Use this in cases where you see apparently random memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) corruption, especially if it appears in 'struct thread_info'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) If in doubt, say "N".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) source "lib/Kconfig.kasan"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) source "lib/Kconfig.kfence"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) endmenu # "Memory Debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) config DEBUG_SHIRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) bool "Debug shared IRQ handlers"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) Enable this to generate a spurious interrupt just before a shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) interrupt handler is deregistered (generating one when registering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) is currently disabled). Drivers need to handle this correctly. Some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) don't and need to be caught.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) menu "Debug Oops, Lockups and Hangs"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) config PANIC_ON_OOPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) bool "Panic on Oops"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) Say Y here to enable the kernel to panic when it oopses. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) has the same effect as setting oops=panic on the kernel command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) line.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) This feature is useful to ensure that the kernel does not do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) anything erroneous after an oops which could result in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909) corruption or other issues.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) config PANIC_ON_OOPS_VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) range 0 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) default 0 if !PANIC_ON_OOPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) default 1 if PANIC_ON_OOPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919) config PANIC_TIMEOUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920) int "panic timeout"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921) default 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) Set the timeout value (in seconds) until a reboot occurs when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) the kernel panics. If n = 0, then we wait forever. A timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) value n > 0 will wait n seconds before rebooting, while a timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926) value n < 0 will reboot immediately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) config LOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) config SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) bool "Detect Soft Lockups"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) depends on DEBUG_KERNEL && !S390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) select LOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) Say Y here to enable the kernel to act as a watchdog to detect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937) soft lockups.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) Softlockups are bugs that cause the kernel to loop in kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) mode for more than 20 seconds, without giving other tasks a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) chance to run. The current stack trace is displayed upon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) detection and the system will stay locked up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) config BOOTPARAM_SOFTLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) bool "Panic (Reboot) On Soft Lockups"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) depends on SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) Say Y here to enable the kernel to panic on "soft lockups",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) which are bugs that cause the kernel to loop in kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950) mode for more than 20 seconds (configurable using the watchdog_thresh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951) sysctl), without giving other tasks a chance to run.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) The panic can be used in combination with panic_timeout,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) to cause the system to reboot automatically after a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) lockup has been detected. This feature is useful for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956) high-availability systems that have uptime guarantees and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) where a lockup must be resolved ASAP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961) config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963) depends on SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) range 0 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966) default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) config HARDLOCKUP_DETECTOR_PERF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) select SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) # Enables a timestamp based low pass filter to compensate for perf based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) # hard lockup detection which runs too fast due to turbo modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) config HARDLOCKUP_CHECK_TIMESTAMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) # arch/ can define HAVE_HARDLOCKUP_DETECTOR_ARCH to provide their own hard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) # lockup detector rather than the perf based detector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983) config HAVE_HARDLOCKUP_DETECTOR_OTHER_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985) depends on NO_GKI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) depends on SMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987) depends on !HAVE_HARDLOCKUP_DETECTOR_PERF && !HAVE_HARDLOCKUP_DETECTOR_ARCH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989) config HARDLOCKUP_DETECTOR_OTHER_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) select SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993) config HARDLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994) bool "Detect Hard Lockups"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) depends on DEBUG_KERNEL && !S390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996) depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_ARCH || HAVE_HARDLOCKUP_DETECTOR_OTHER_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997) select LOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998) select HARDLOCKUP_DETECTOR_PERF if HAVE_HARDLOCKUP_DETECTOR_PERF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) select HARDLOCKUP_DETECTOR_OTHER_CPU if HAVE_HARDLOCKUP_DETECTOR_OTHER_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) Say Y here to enable the kernel to act as a watchdog to detect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) hard lockups.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) Hardlockups are bugs that cause the CPU to loop in kernel mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) for more than 10 seconds, without letting other interrupts have a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) chance to run. The current stack trace is displayed upon detection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) and the system will stay locked up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) config BOOTPARAM_HARDLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) bool "Panic (Reboot) On Hard Lockups"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) depends on HARDLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) Say Y here to enable the kernel to panic on "hard lockups",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) which are bugs that cause the kernel to loop in kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) mode with interrupts disabled for more than 10 seconds (configurable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) using the watchdog_thresh sysctl).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) config BOOTPARAM_HARDLOCKUP_PANIC_VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) depends on HARDLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) range 0 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) default 1 if BOOTPARAM_HARDLOCKUP_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) config DETECT_HUNG_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) bool "Detect Hung Tasks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) default SOFTLOCKUP_DETECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) Say Y here to enable the kernel to detect "hung tasks",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) which are bugs that cause the task to be stuck in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) uninterruptible "D" state indefinitely.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) When a hung task is detected, the kernel will print the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) current stack trace (which you should report), but the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) task will stay in uninterruptible state. If lockdep is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) enabled then all held locks will also be reported. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) feature has negligible overhead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) config DEFAULT_HUNG_TASK_TIMEOUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) int "Default timeout for hung task detection (in seconds)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) depends on DETECT_HUNG_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) default 120
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) This option controls the default timeout (in seconds) used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) to determine when a task has become non-responsive and should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) be considered hung.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) It can be adjusted at runtime via the kernel.hung_task_timeout_secs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) sysctl or by writing a value to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) /proc/sys/kernel/hung_task_timeout_secs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) A timeout of 0 disables the check. The default is two minutes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) Keeping the default should be fine in most cases.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) config BOOTPARAM_HUNG_TASK_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) bool "Panic (Reboot) On Hung Tasks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) depends on DETECT_HUNG_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) Say Y here to enable the kernel to panic on "hung tasks",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) which are bugs that cause the kernel to leave a task stuck
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) in uninterruptible "D" state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) The panic can be used in combination with panic_timeout,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) to cause the system to reboot automatically after a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) hung task has been detected. This feature is useful for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) high-availability systems that have uptime guarantees and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) where a hung tasks must be resolved ASAP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) config BOOTPARAM_HUNG_TASK_PANIC_VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) depends on DETECT_HUNG_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) range 0 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) default 0 if !BOOTPARAM_HUNG_TASK_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) default 1 if BOOTPARAM_HUNG_TASK_PANIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) config WQ_WATCHDOG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) bool "Detect Workqueue Stalls"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) Say Y here to enable stall detection on workqueues. If a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) worker pool doesn't make forward progress on a pending work
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) item for over a given amount of time, 30s by default, a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) warning message is printed along with dump of workqueue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) state. This can be configured through kernel parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) "workqueue.watchdog_thresh" and its sysfs counterpart.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) config TEST_LOCKUP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) tristate "Test module to generate lockups"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) This builds the "test_lockup" module that helps to make sure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) that watchdogs and lockup detectors are working properly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) Depending on module parameters it could emulate soft or hard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) lockup, "hung task", or locking arbitrary lock for a long time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) Also it could generate series of lockups with cooling-down periods.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) endmenu # "Debug lockups and hangs"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) menu "Scheduler Debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) config SCHED_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) bool "Collect scheduler debugging info"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) depends on DEBUG_KERNEL && PROC_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) If you say Y here, the /proc/sched_debug file will be provided
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) that can help debug the scheduler. The runtime overhead of this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) option is minimal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) config SCHED_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) config SCHEDSTATS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) bool "Collect scheduler statistics"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) depends on DEBUG_KERNEL && PROC_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) select SCHED_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) If you say Y here, additional code will be inserted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128) scheduler and related routines to collect statistics about
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) scheduler behavior and provide them in /proc/schedstat. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) stats may be useful for both tuning and debugging the scheduler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) If you aren't debugging the scheduler or trying to tune a specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) application, you can say N to avoid the very slight overhead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) this adds.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) config DEBUG_TIMEKEEPING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) bool "Enable extra timekeeping sanity checking"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) This option will enable additional timekeeping sanity checks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) which may be helpful when diagnosing issues where timekeeping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) problems are suspected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) This may include checks in the timekeeping hotpaths, so this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145) option may have a (very small) performance impact to some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) workloads.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) config DEBUG_PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) bool "Debug preemptible kernel"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) If you say Y here then the kernel will use a debug variant of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) commonly used smp_processor_id() function and will print warnings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) if kernel code uses it in a preemption-unsafe way. Also, the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) will detect preemption count underflows.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) menu "Lock Debugging (spinlocks, mutexes, etc...)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) config LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) config PROVE_LOCKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) bool "Lock debugging: prove locking correctness"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) select LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) select DEBUG_SPINLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) select DEBUG_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) select DEBUG_RT_MUTEXES if RT_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) select DEBUG_RWSEMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) select DEBUG_WW_MUTEX_SLOWPATH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) select DEBUG_LOCK_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) select PREEMPT_COUNT if !ARCH_NO_PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) select TRACE_IRQFLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) This feature enables the kernel to prove that all locking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) that occurs in the kernel runtime is mathematically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) correct: that under no circumstance could an arbitrary (and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) not yet triggered) combination of observed locking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) sequences (on an arbitrary number of CPUs, running an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) arbitrary number of tasks and interrupt contexts) cause a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) deadlock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) In short, this feature enables the kernel to report locking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) related deadlocks before they actually occur.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) The proof does not depend on how hard and complex a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) deadlock scenario would be to trigger: how many
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) participant CPUs, tasks and irq-contexts would be needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) for it to trigger. The proof also does not depend on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) timing: if a race and a resulting deadlock is possible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) theoretically (no matter how unlikely the race scenario
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) is), it will be proven so and will immediately be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) reported by the kernel (once the event is observed that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) makes the deadlock theoretically possible).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) If a deadlock is impossible (i.e. the locking rules, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203) observed by the kernel, are mathematically correct), the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) kernel reports nothing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) NOTE: this feature can also be enabled for rwlocks, mutexes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) and rwsems - in which case all dependencies between these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) different locking variants are observed and mapped too, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) the proof of observed correctness is also maintained for an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) arbitrary combination of these separate locking variants.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) For more details, see Documentation/locking/lockdep-design.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) config PROVE_RAW_LOCK_NESTING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) bool "Enable raw_spinlock - spinlock nesting checks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) depends on PROVE_LOCKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) Enable the raw_spinlock vs. spinlock nesting checks which ensure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) that the lock nesting rules for PREEMPT_RT enabled kernels are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) not violated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) NOTE: There are known nesting problems. So if you enable this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) option expect lockdep splats until these problems have been fully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) addressed which is work in progress. This config switch allows to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) identify and analyze these problems. It will be removed and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) check permanentely enabled once the main issues have been fixed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) If unsure, select N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) config LOCK_STAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) bool "Lock usage statistics"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) select LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) select DEBUG_SPINLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) select DEBUG_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) select DEBUG_RT_MUTEXES if RT_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) select DEBUG_LOCK_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) This feature enables tracking lock contention points
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) For more details, see Documentation/locking/lockstat.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) This also enables lock events required by "perf lock",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246) subcommand of perf.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) If you want to use "perf lock", you also need to turn on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) CONFIG_EVENT_TRACING.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) (CONFIG_LOCKDEP defines "acquire" and "release" events.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) config DEBUG_RT_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) bool "RT Mutex debugging, deadlock detection"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) depends on DEBUG_KERNEL && RT_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) This allows rt mutex semantics violations and rt mutex related
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) deadlocks (lockups) to be detected and reported automatically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) config DEBUG_SPINLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261) bool "Spinlock and rw-lock debugging: basic checks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) select UNINLINE_SPIN_UNLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) Say Y here and build SMP to catch missing spinlock initialization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) and certain other kinds of spinlock errors commonly made. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) best used in conjunction with the NMI watchdog so that spinlock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268) deadlocks are also debuggable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) config DEBUG_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) bool "Mutex debugging: basic checks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) This feature allows mutex semantics violations to be detected and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) reported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) config DEBUG_WW_MUTEX_SLOWPATH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) bool "Wait/wound mutex debugging: Slowpath testing"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) select DEBUG_LOCK_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) select DEBUG_SPINLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) select DEBUG_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) This feature enables slowpath testing for w/w mutex users by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) injecting additional -EDEADLK wound/backoff cases. Together with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) will test all possible w/w mutex interface abuse with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) exception of simply not acquiring all the required locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) Note that this feature can introduce significant overhead, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) it really should not be enabled in a production or distro kernel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) even a debug kernel. If you are a driver writer, enable it. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292) you are a distro, do not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) config DEBUG_RWSEMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) bool "RW Semaphore debugging: basic checks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) This debugging feature allows mismatched rw semaphore locks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) and unlocks to be detected and reported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) config DEBUG_LOCK_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) bool "Lock debugging: detect incorrect freeing of live locks"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) select DEBUG_SPINLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) select DEBUG_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) select DEBUG_RT_MUTEXES if RT_MUTEXES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) select LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) This feature will check whether any held lock (spinlock, rwlock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) mutex or rwsem) is incorrectly freed by the kernel, via any of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) vfree(), etc.), whether a live lock is incorrectly reinitialized via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) spin_lock_init()/mutex_init()/etc., or whether there is any lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) held during task exit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) config LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) select STACKTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) select KALLSYMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) select KALLSYMS_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) config LOCKDEP_SMALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) config DEBUG_LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) bool "Lock dependency engine debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) depends on DEBUG_KERNEL && LOCKDEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) If you say Y here, the lock dependency engine will do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) additional runtime checks to debug itself, at the price
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) of more runtime overhead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) config DEBUG_ATOMIC_SLEEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) bool "Sleep inside atomic section checking"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336) select PREEMPT_COUNT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) depends on !ARCH_NO_PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) If you say Y here, various routines which may sleep will become very
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) noisy if they are called inside atomic sections: when a spinlock is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) held, inside an rcu read side critical section, inside preempt disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) sections, inside an interrupt, etc...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) config DEBUG_LOCKING_API_SELFTESTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346) bool "Locking API boot-time self-tests"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349) Say Y here if you want the kernel to run a short self-test during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) bootup. The self-test checks whether common types of locking bugs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) are detected by debugging mechanisms or not. (if you disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) lock debugging then those bugs wont be detected of course.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) The following locking APIs are covered: spinlocks, rwlocks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) mutexes and rwsems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356) config LOCK_TORTURE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) tristate "torture tests for locking"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) select TORTURE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) This option provides a kernel module that runs torture tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362) on kernel locking primitives. The kernel module may be built
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) after the fact on the running kernel to be tested, if desired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) Say Y here if you want kernel locking-primitive torture tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366) to be built into the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) Say M if you want these torture tests to build as a module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) Say N if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) config WW_MUTEX_SELFTEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) tristate "Wait/wound mutex selftests"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) This option provides a kernel module that runs tests on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374) on the struct ww_mutex locking API.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377) with this test harness.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) Say M if you want these self tests to build as a module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380) Say N if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) config SCF_TORTURE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383) tristate "torture tests for smp_call_function*()"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) select TORTURE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387) This option provides a kernel module that runs torture tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) on the smp_call_function() family of primitives. The kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) module may be built after the fact on the running kernel to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390) be tested, if desired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) config CSD_LOCK_WAIT_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) bool "Debugging for csd_lock_wait(), called from smp_call_function*()"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) depends on 64BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) This option enables debug prints when CPUs are slow to respond
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399) to the smp_call_function*() IPI wrappers. These debug prints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) include the IPI handler function currently executing (if any)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) and relevant stack traces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) endmenu # lock debugging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) config TRACE_IRQFLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) depends on TRACE_IRQFLAGS_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) Enables hooks to interrupt enabling and disabling for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410) either tracing or lock debugging.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412) config TRACE_IRQFLAGS_NMI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) depends on TRACE_IRQFLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) depends on TRACE_IRQFLAGS_NMI_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) config STACKTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418) bool "Stack backtrace support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) depends on STACKTRACE_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1420) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1421) This option causes the kernel to create a /proc/pid/stack for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1422) every process, showing its current stack trace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1423) It is also used by various kernel debugging features that require
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1424) stack trace generation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1425)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1426) config WARN_ALL_UNSEEDED_RANDOM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1427) bool "Warn for all uses of unseeded randomness"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1428) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1429) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1430) Some parts of the kernel contain bugs relating to their use of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1431) cryptographically secure random numbers before it's actually possible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1432) to generate those numbers securely. This setting ensures that these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1433) flaws don't go unnoticed, by enabling a message, should this ever
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1434) occur. This will allow people with obscure setups to know when things
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1435) are going wrong, so that they might contact developers about fixing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1436) it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1437)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1438) Unfortunately, on some models of some architectures getting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1439) a fully seeded CRNG is extremely difficult, and so this can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1440) result in dmesg getting spammed for a surprisingly long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1441) time. This is really bad from a security perspective, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1442) so architecture maintainers really need to do what they can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1443) to get the CRNG seeded sooner after the system is booted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1444) However, since users cannot do anything actionable to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1445) address this, by default the kernel will issue only a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1446) warning for the first use of unseeded randomness.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1448) Say Y here if you want to receive warnings for all uses of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1449) unseeded randomness. This will be of use primarily for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1450) those developers interested in improving the security of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1451) Linux kernels running on their architecture (or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1452) subarchitecture).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1453)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1454) config DEBUG_KOBJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1455) bool "kobject debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1456) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1457) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1458) If you say Y here, some extra kobject debugging messages will be sent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1459) to the syslog.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1460)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1461) config DEBUG_KOBJECT_RELEASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1462) bool "kobject release debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1463) depends on DEBUG_OBJECTS_TIMERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1464) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1465) kobjects are reference counted objects. This means that their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1466) last reference count put is not predictable, and the kobject can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1467) live on past the point at which a driver decides to drop it's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1468) initial reference to the kobject gained on allocation. An
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1469) example of this would be a struct device which has just been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1470) unregistered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1471)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1472) However, some buggy drivers assume that after such an operation,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1473) the memory backing the kobject can be immediately freed. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1474) goes completely against the principles of a refcounted object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1475)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1476) If you say Y here, the kernel will delay the release of kobjects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1477) on the last reference count to improve the visibility of this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1478) kind of kobject release bug.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1479)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1480) config HAVE_DEBUG_BUGVERBOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1481) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1482)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1483) menu "Debug kernel data structures"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1485) config DEBUG_LIST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1486) bool "Debug linked list manipulation"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1487) depends on DEBUG_KERNEL || BUG_ON_DATA_CORRUPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1488) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1489) Enable this to turn on extended checks in the linked-list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1490) walking routines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1492) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1493)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1494) config DEBUG_PLIST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1495) bool "Debug priority linked list manipulation"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1496) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1497) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1498) Enable this to turn on extended checks in the priority-ordered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1499) linked-list (plist) walking routines. This checks the entire
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1500) list multiple times during each manipulation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1501)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1502) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1503)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1504) config DEBUG_SG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1505) bool "Debug SG table operations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1506) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1507) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1508) Enable this to turn on checks on scatter-gather tables. This can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1509) help find problems with drivers that do not properly initialize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1510) their sg tables.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1511)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1512) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1514) config DEBUG_NOTIFIERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1515) bool "Debug notifier call chains"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1516) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1517) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1518) Enable this to turn on sanity checking for notifier call chains.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1519) This is most useful for kernel developers to make sure that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1520) modules properly unregister themselves from notifier chains.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1521) This is a relatively cheap check but if you care about maximum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1522) performance, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1524) config BUG_ON_DATA_CORRUPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1525) bool "Trigger a BUG when data corruption is detected"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1526) select DEBUG_LIST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1527) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1528) Select this option if the kernel should BUG when it encounters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1529) data corruption in kernel memory structures when they get checked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1530) for validity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1531)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1532) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1533)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1534) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1535)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1536) config DEBUG_CREDENTIALS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1537) bool "Debug credential management"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1538) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1539) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1540) Enable this to turn on some debug checking for credential
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1541) management. The additional code keeps track of the number of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1542) pointers from task_structs to any given cred struct, and checks to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1543) see that this number never exceeds the usage count of the cred
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1544) struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1546) Furthermore, if SELinux is enabled, this also checks that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1547) security pointer in the cred struct is never seen to be invalid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1548)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1549) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1550)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1551) source "kernel/rcu/Kconfig.debug"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1552)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1553) config DEBUG_WQ_FORCE_RR_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1554) bool "Force round-robin CPU selection for unbound work items"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1555) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1556) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1557) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1558) Workqueue used to implicitly guarantee that work items queued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1559) without explicit CPU specified are put on the local CPU. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1560) guarantee is no longer true and while local CPU is still
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1561) preferred work items may be put on foreign CPUs. Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1562) parameter "workqueue.debug_force_rr_cpu" is added to force
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1563) round-robin CPU selection to flush out usages which depend on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1564) now broken guarantee. This config option enables the debug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1565) feature by default. When enabled, memory and cache locality will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1566) be impacted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1567)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1568) config DEBUG_BLOCK_EXT_DEVT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1569) bool "Force extended block device numbers and spread them"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1570) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1571) depends on BLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1572) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1573) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1574) BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1575) SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1576) YOU ARE DOING. Distros, please enable this and fix whatever
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1577) is broken.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1578)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1579) Conventionally, block device numbers are allocated from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1580) predetermined contiguous area. However, extended block area
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1581) may introduce non-contiguous block device numbers. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1582) option forces most block device numbers to be allocated from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1583) the extended space and spreads them to discover kernel or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1584) userland code paths which assume predetermined contiguous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1585) device number allocation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1586)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1587) Note that turning on this debug option shuffles all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1588) device numbers for all IDE and SCSI devices including libata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1589) ones, so root partition specified using device number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1590) directly (via rdev or root=MAJ:MIN) won't work anymore.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1591) Textual device names (root=/dev/sdXn) will continue to work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1592)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1593) Say N if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1594)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1595) config CPU_HOTPLUG_STATE_CONTROL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1596) bool "Enable CPU hotplug state control"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1597) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1598) depends on HOTPLUG_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1599) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1600) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1601) Allows to write steps between "offline" and "online" to the CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1602) sysfs target file so states can be stepped granular. This is a debug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1603) option for now as the hotplug machinery cannot be stopped and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1604) restarted at arbitrary points yet.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1605)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1606) Say N if your are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1607)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1608) config LATENCYTOP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1609) bool "Latency measuring infrastructure"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1610) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1611) depends on STACKTRACE_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1612) depends on PROC_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1613) depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1614) select KALLSYMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1615) select KALLSYMS_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1616) select STACKTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1617) select SCHEDSTATS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1618) select SCHED_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1619) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1620) Enable this option if you want to use the LatencyTOP tool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1621) to find out which userspace is blocking on what kernel operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1622)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1623) source "kernel/trace/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1624)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1625) config PROVIDE_OHCI1394_DMA_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1626) bool "Remote debugging over FireWire early on boot"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1627) depends on PCI && X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1628) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1629) If you want to debug problems which hang or crash the kernel early
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1630) on boot and the crashing machine has a FireWire port, you can use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1631) this feature to remotely access the memory of the crashed machine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1632) over FireWire. This employs remote DMA as part of the OHCI1394
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1633) specification which is now the standard for FireWire controllers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1634)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1635) With remote DMA, you can monitor the printk buffer remotely using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1636) firescope and access all memory below 4GB using fireproxy from gdb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1637) Even controlling a kernel debugger is possible using remote DMA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1638)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1639) Usage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1640)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1641) If ohci1394_dma=early is used as boot parameter, it will initialize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1642) all OHCI1394 controllers which are found in the PCI config space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1643)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1644) As all changes to the FireWire bus such as enabling and disabling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1645) devices cause a bus reset and thereby disable remote DMA for all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1646) devices, be sure to have the cable plugged and FireWire enabled on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1647) the debugging host before booting the debug target for debugging.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1648)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1649) This code (~1k) is freed after boot. By then, the firewire stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1650) in charge of the OHCI-1394 controllers should be used instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1651)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1652) See Documentation/core-api/debugging-via-ohci1394.rst for more information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1653)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1654) source "samples/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1655)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1656) config ARCH_HAS_DEVMEM_IS_ALLOWED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1657) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1658)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1659) config STRICT_DEVMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1660) bool "Filter access to /dev/mem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1661) depends on MMU && DEVMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1662) depends on ARCH_HAS_DEVMEM_IS_ALLOWED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1663) default y if PPC || X86 || ARM64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1664) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1665) If this option is disabled, you allow userspace (root) access to all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1666) of memory, including kernel and userspace memory. Accidental
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1667) access to this is obviously disastrous, but specific access can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1668) be used by people debugging the kernel. Note that with PAT support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1669) enabled, even in this case there are restrictions on /dev/mem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1670) use due to the cache aliasing requirements.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1671)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1672) If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1673) file only allows userspace access to PCI space and the BIOS code and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1674) data regions. This is sufficient for dosemu and X and all common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1675) users of /dev/mem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1676)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1677) If in doubt, say Y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1678)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1679) config IO_STRICT_DEVMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1680) bool "Filter I/O access to /dev/mem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1681) depends on STRICT_DEVMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1682) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1683) If this option is disabled, you allow userspace (root) access to all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1684) io-memory regardless of whether a driver is actively using that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1685) range. Accidental access to this is obviously disastrous, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1686) specific access can be used by people debugging kernel drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1688) If this option is switched on, the /dev/mem file only allows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1689) userspace access to *idle* io-memory ranges (see /proc/iomem) This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1690) may break traditional users of /dev/mem (dosemu, legacy X, etc...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1691) if the driver using a given range cannot be disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1692)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1693) If in doubt, say Y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1694)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1695) menu "$(SRCARCH) Debugging"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1696)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1697) source "arch/$(SRCARCH)/Kconfig.debug"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1698)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1699) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1700)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1701) menu "Kernel Testing and Coverage"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1702)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1703) source "lib/kunit/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1704)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1705) config NOTIFIER_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1706) tristate "Notifier error injection"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1707) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1708) select DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1709) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1710) This option provides the ability to inject artificial errors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1711) specified notifier chain callbacks. It is useful to test the error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1712) handling of notifier call chain failures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1713)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1714) Say N if unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1715)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1716) config PM_NOTIFIER_ERROR_INJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1717) tristate "PM notifier error injection module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1718) depends on PM && NOTIFIER_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1719) default m if PM_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1720) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1721) This option provides the ability to inject artificial errors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1722) PM notifier chain callbacks. It is controlled through debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1723) interface /sys/kernel/debug/notifier-error-inject/pm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1724)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1725) If the notifier call chain should be failed with some events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1726) notified, write the error code to "actions/<notifier event>/error".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1727)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1728) Example: Inject PM suspend error (-12 = -ENOMEM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1729)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1730) # cd /sys/kernel/debug/notifier-error-inject/pm/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1731) # echo -12 > actions/PM_SUSPEND_PREPARE/error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1732) # echo mem > /sys/power/state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1733) bash: echo: write error: Cannot allocate memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1734)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1735) To compile this code as a module, choose M here: the module will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1736) be called pm-notifier-error-inject.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1737)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1738) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1739)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1740) config OF_RECONFIG_NOTIFIER_ERROR_INJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1741) tristate "OF reconfig notifier error injection module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1742) depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1743) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1744) This option provides the ability to inject artificial errors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1745) OF reconfig notifier chain callbacks. It is controlled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1746) through debugfs interface under
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1747) /sys/kernel/debug/notifier-error-inject/OF-reconfig/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1748)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1749) If the notifier call chain should be failed with some events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1750) notified, write the error code to "actions/<notifier event>/error".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1751)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1752) To compile this code as a module, choose M here: the module will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1753) be called of-reconfig-notifier-error-inject.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1754)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1755) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1756)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1757) config NETDEV_NOTIFIER_ERROR_INJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1758) tristate "Netdev notifier error injection module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1759) depends on NET && NOTIFIER_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1760) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1761) This option provides the ability to inject artificial errors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1762) netdevice notifier chain callbacks. It is controlled through debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1763) interface /sys/kernel/debug/notifier-error-inject/netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1764)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1765) If the notifier call chain should be failed with some events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1766) notified, write the error code to "actions/<notifier event>/error".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1767)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1768) Example: Inject netdevice mtu change error (-22 = -EINVAL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1769)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1770) # cd /sys/kernel/debug/notifier-error-inject/netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1771) # echo -22 > actions/NETDEV_CHANGEMTU/error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1772) # ip link set eth0 mtu 1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1773) RTNETLINK answers: Invalid argument
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1774)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1775) To compile this code as a module, choose M here: the module will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1776) be called netdev-notifier-error-inject.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1777)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1778) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1779)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1780) config FUNCTION_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1781) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1782) depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1783)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1784) config FAULT_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1785) bool "Fault-injection framework"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1786) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1787) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1788) Provide fault-injection framework.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1789) For more details, see Documentation/fault-injection/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1790)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1791) config FAILSLAB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1792) bool "Fault-injection capability for kmalloc"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1793) depends on FAULT_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1794) depends on SLAB || SLUB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1795) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1796) Provide fault-injection capability for kmalloc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1797)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1798) config FAIL_PAGE_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1799) bool "Fault-injection capability for alloc_pages()"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1800) depends on FAULT_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1801) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1802) Provide fault-injection capability for alloc_pages().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1803)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1804) config FAULT_INJECTION_USERCOPY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1805) bool "Fault injection capability for usercopy functions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1806) depends on FAULT_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1807) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1808) Provides fault-injection capability to inject failures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1809) in usercopy functions (copy_from_user(), get_user(), ...).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1810)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1811) config FAIL_MAKE_REQUEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1812) bool "Fault-injection capability for disk IO"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1813) depends on FAULT_INJECTION && BLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1814) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1815) Provide fault-injection capability for disk IO.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1816)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1817) config FAIL_IO_TIMEOUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1818) bool "Fault-injection capability for faking disk interrupts"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1819) depends on FAULT_INJECTION && BLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1820) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1821) Provide fault-injection capability on end IO handling. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1822) will make the block layer "forget" an interrupt as configured,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1823) thus exercising the error handling.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1824)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1825) Only works with drivers that use the generic timeout handling,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1826) for others it wont do anything.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1827)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1828) config FAIL_FUTEX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1829) bool "Fault-injection capability for futexes"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1830) select DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1831) depends on FAULT_INJECTION && FUTEX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1832) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1833) Provide fault-injection capability for futexes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1834)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1835) config FAULT_INJECTION_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1836) bool "Debugfs entries for fault-injection capabilities"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1837) depends on FAULT_INJECTION && SYSFS && DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1838) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1839) Enable configuration of fault-injection capabilities via debugfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1840)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1841) config FAIL_FUNCTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1842) bool "Fault-injection capability for functions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1843) depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1844) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1845) Provide function-based fault-injection capability.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1846) This will allow you to override a specific function with a return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1847) with given return value. As a result, function caller will see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1848) an error value and have to handle it. This is useful to test the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1849) error handling in various subsystems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1850)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1851) config FAIL_MMC_REQUEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1852) bool "Fault-injection capability for MMC IO"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1853) depends on FAULT_INJECTION_DEBUG_FS && MMC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1854) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1855) Provide fault-injection capability for MMC IO.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1856) This will make the mmc core return data errors. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1857) useful to test the error handling in the mmc block device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1858) and to test how the mmc host driver handles retries from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1859) the block device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1860)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1861) config FAULT_INJECTION_STACKTRACE_FILTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1862) bool "stacktrace filter for fault-injection capabilities"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1863) depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1864) depends on !X86_64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1865) select STACKTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1866) depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1867) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1868) Provide stacktrace filter for fault-injection capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1869)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1870) config ARCH_HAS_KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1871) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1872) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1873) An architecture should select this when it can successfully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1874) build and run with CONFIG_KCOV. This typically requires
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1875) disabling instrumentation for some early boot code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1876)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1877) config CC_HAS_SANCOV_TRACE_PC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1878) def_bool $(cc-option,-fsanitize-coverage=trace-pc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1879)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1880)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1881) config KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1882) bool "Code coverage for fuzzing"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1883) depends on ARCH_HAS_KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1884) depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1885) select DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1886) select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1887) select SKB_EXTENSIONS if NET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1888) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1889) KCOV exposes kernel code coverage information in a form suitable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1890) for coverage-guided fuzzing (randomized testing).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1891)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1892) If RANDOMIZE_BASE is enabled, PC values will not be stable across
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1893) different machines and across reboots. If you need stable PC values,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1894) disable RANDOMIZE_BASE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1895)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1896) For more details, see Documentation/dev-tools/kcov.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1897)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1898) config KCOV_ENABLE_COMPARISONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1899) bool "Enable comparison operands collection by KCOV"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1900) depends on KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1901) depends on $(cc-option,-fsanitize-coverage=trace-cmp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1902) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1903) KCOV also exposes operands of every comparison in the instrumented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1904) code along with operand sizes and PCs of the comparison instructions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1905) These operands can be used by fuzzing engines to improve the quality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1906) of fuzzing coverage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1907)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1908) config KCOV_INSTRUMENT_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1909) bool "Instrument all code by default"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1910) depends on KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1911) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1912) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1913) If you are doing generic system call fuzzing (like e.g. syzkaller),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1914) then you will want to instrument the whole kernel and you should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1915) say y here. If you are doing more targeted fuzzing (like e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1916) filesystem fuzzing with AFL) then you will want to enable coverage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1917) for more specific subsets of files, and should say n here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1918)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1919) config KCOV_IRQ_AREA_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1920) hex "Size of interrupt coverage collection area in words"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1921) depends on KCOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1922) default 0x40000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1923) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1924) KCOV uses preallocated per-cpu areas to collect coverage from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1925) soft interrupts. This specifies the size of those areas in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1926) number of unsigned long words.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1927)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1928) menuconfig RUNTIME_TESTING_MENU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1929) bool "Runtime Testing"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1930) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1931)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1932) if RUNTIME_TESTING_MENU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1933)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1934) config LKDTM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1935) tristate "Linux Kernel Dump Test Tool Module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1936) depends on DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1937) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1938) This module enables testing of the different dumping mechanisms by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1939) inducing system failures at predefined crash points.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1940) If you don't need it: say N
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1941) Choose M here to compile this code as a module. The module will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1942) called lkdtm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1943)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1944) Documentation on how to use the module can be found in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1945) Documentation/fault-injection/provoke-crashes.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1946)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1947) config TEST_LIST_SORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1948) tristate "Linked list sorting test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1949) depends on DEBUG_KERNEL || m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1950) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1951) Enable this to turn on 'list_sort()' function test. This test is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1952) executed only once during system boot (so affects only boot time),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1953) or at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1954)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1955) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1956)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1957) config TEST_MIN_HEAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1958) tristate "Min heap test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1959) depends on DEBUG_KERNEL || m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1960) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1961) Enable this to turn on min heap function tests. This test is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1962) executed only once during system boot (so affects only boot time),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1963) or at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1964)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1965) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1966)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1967) config TEST_SORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1968) tristate "Array-based sort test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1969) depends on DEBUG_KERNEL || m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1970) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1971) This option enables the self-test function of 'sort()' at boot,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1972) or at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1973)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1974) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1975)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1976) config KPROBES_SANITY_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1977) bool "Kprobes sanity tests"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1978) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1979) depends on KPROBES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1980) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1981) This option provides for testing basic kprobes functionality on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1982) boot. Samples of kprobe and kretprobe are inserted and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1983) verified for functionality.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1984)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1985) Say N if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1986)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1987) config BACKTRACE_SELF_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1988) tristate "Self test for the backtrace code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1989) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1990) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1991) This option provides a kernel module that can be used to test
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1992) the kernel stack backtrace code. This option is not useful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1993) for distributions or general kernels, but only for kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1994) developers working on architecture code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1995)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1996) Note that if you want to also test saved backtraces, you will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1997) have to enable STACKTRACE as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1998)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1999) Say N if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2001) config RBTREE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2002) tristate "Red-Black tree test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2003) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2004) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2005) A benchmark measuring the performance of the rbtree library.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2006) Also includes rbtree invariant checks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2007)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2008) config REED_SOLOMON_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2009) tristate "Reed-Solomon library test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2010) depends on DEBUG_KERNEL || m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2011) select REED_SOLOMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2012) select REED_SOLOMON_ENC16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2013) select REED_SOLOMON_DEC16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2014) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2015) This option enables the self-test function of rslib at boot,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2016) or at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2017)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2018) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2019)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2020) config INTERVAL_TREE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2021) tristate "Interval tree test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2022) depends on DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2023) select INTERVAL_TREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2024) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2025) A benchmark measuring the performance of the interval tree library
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2026)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2027) config PERCPU_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2028) tristate "Per cpu operations test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2029) depends on m && DEBUG_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2030) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2031) Enable this option to build test module which validates per-cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2032) operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2033)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2034) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2035)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2036) config ATOMIC64_SELFTEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2037) tristate "Perform an atomic64_t self-test"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2038) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2039) Enable this option to test the atomic64_t functions at boot or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2040) at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2041)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2042) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2043)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2044) config ASYNC_RAID6_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2045) tristate "Self test for hardware accelerated raid6 recovery"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2046) depends on ASYNC_RAID6_RECOV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2047) select ASYNC_MEMCPY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2048) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2049) This is a one-shot self test that permutes through the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2050) recovery of all the possible two disk failure scenarios for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2051) N-disk array. Recovery is performed with the asynchronous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2052) raid6 recovery routines, and will optionally use an offload
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2053) engine if one is available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2054)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2055) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2056)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2057) config TEST_HEXDUMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2058) tristate "Test functions located in the hexdump module at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2059)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2060) config TEST_STRING_HELPERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2061) tristate "Test functions located in the string_helpers module at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2062)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2063) config TEST_STRSCPY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2064) tristate "Test strscpy*() family of functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2065)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2066) config TEST_KSTRTOX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2067) tristate "Test kstrto*() family of functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2068)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2069) config TEST_PRINTF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2070) tristate "Test printf() family of functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2071)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2072) config TEST_BITMAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2073) tristate "Test bitmap_*() family of functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2074) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2075) Enable this option to test the bitmap functions at boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2076)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2077) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2078)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2079) config TEST_UUID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2080) tristate "Test functions located in the uuid module at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2081)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2082) config TEST_XARRAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2083) tristate "Test the XArray code at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2085) config TEST_OVERFLOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2086) tristate "Test check_*_overflow() functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2087)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2088) config TEST_RHASHTABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2089) tristate "Perform selftest on resizable hash table"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2090) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2091) Enable this option to test the rhashtable functions at boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2092)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2093) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2094)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2095) config TEST_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2096) tristate "Perform selftest on hash functions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2097) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2098) Enable this option to test the kernel's integer (<linux/hash.h>),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2099) string (<linux/stringhash.h>), and siphash (<linux/siphash.h>)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2100) hash functions on boot (or module load).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2102) This is intended to help people writing architecture-specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2103) optimized versions. If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2105) config TEST_IDA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2106) tristate "Perform selftest on IDA functions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2108) config TEST_PARMAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2109) tristate "Perform selftest on priority array manager"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2110) depends on PARMAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2111) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2112) Enable this option to test priority array manager on boot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2113) (or module load).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2115) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2117) config TEST_IRQ_TIMINGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2118) bool "IRQ timings selftest"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2119) depends on IRQ_TIMINGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2120) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2121) Enable this option to test the irq timings code on boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2123) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2125) config TEST_LKM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2126) tristate "Test module loading with 'hello world' module"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2127) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2128) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2129) This builds the "test_module" module that emits "Hello, world"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2130) on printk when loaded. It is designed to be used for basic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2131) evaluation of the module loading subsystem (for example when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2132) validating module verification). It lacks any extra dependencies,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2133) and will not normally be loaded by the system unless explicitly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2134) requested by name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2136) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2138) config TEST_BITOPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2139) tristate "Test module for compilation of bitops operations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2140) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2141) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2142) This builds the "test_bitops" module that is much like the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2143) TEST_LKM module except that it does a basic exercise of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2144) set/clear_bit macros and get_count_order/long to make sure there are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2145) no compiler warnings from C=1 sparse checker or -Wextra
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2146) compilations. It has no dependencies and doesn't run or load unless
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2147) explicitly requested by name. for example: modprobe test_bitops.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2149) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2151) config TEST_VMALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2152) tristate "Test module for stress/performance analysis of vmalloc allocator"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2153) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2154) depends on MMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2155) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2156) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2157) This builds the "test_vmalloc" module that should be used for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2158) stress and performance analysis. So, any new change for vmalloc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2159) subsystem can be evaluated from performance and stability point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2160) of view.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2162) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2164) config TEST_USER_COPY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2165) tristate "Test user/kernel boundary protections"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2166) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2167) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2168) This builds the "test_user_copy" module that runs sanity checks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2169) on the copy_to/from_user infrastructure, making sure basic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2170) user/kernel boundary testing is working. If it fails to load,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2171) a regression has been detected in the user/kernel memory boundary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2172) protections.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2174) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2176) config TEST_BPF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2177) tristate "Test BPF filter functionality"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2178) depends on m && NET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2179) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2180) This builds the "test_bpf" module that runs various test vectors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2181) against the BPF interpreter or BPF JIT compiler depending on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2182) current setting. This is in particular useful for BPF JIT compiler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2183) development, but also to run regression tests against changes in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2184) the interpreter code. It also enables test stubs for eBPF maps and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2185) verifier used by user space verifier testsuite.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2187) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2189) config TEST_BLACKHOLE_DEV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2190) tristate "Test blackhole netdev functionality"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2191) depends on m && NET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2192) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2193) This builds the "test_blackhole_dev" module that validates the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2194) data path through this blackhole netdev.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2196) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2198) config FIND_BIT_BENCHMARK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2199) tristate "Test find_bit functions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2200) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2201) This builds the "test_find_bit" module that measure find_*_bit()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2202) functions performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2204) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2206) config TEST_FIRMWARE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2207) tristate "Test firmware loading via userspace interface"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2208) depends on FW_LOADER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2209) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2210) This builds the "test_firmware" module that creates a userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2211) interface for testing firmware loading. This can be used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2212) control the triggering of firmware loading without needing an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2213) actual firmware-using device. The contents can be rechecked by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2214) userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2216) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2218) config TEST_SYSCTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2219) tristate "sysctl test driver"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2220) depends on PROC_SYSCTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2221) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2222) This builds the "test_sysctl" module. This driver enables to test the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2223) proc sysctl interfaces available to drivers safely without affecting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2224) production knobs which might alter system functionality.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2226) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2228) config BITFIELD_KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2229) tristate "KUnit test bitfield functions at runtime"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2230) depends on KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2231) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2232) Enable this option to test the bitfield functions at boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2234) KUnit tests run during boot and output the results to the debug log
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2235) in TAP format (http://testanything.org/). Only useful for kernel devs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2236) running the KUnit test harness, and not intended for inclusion into a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2237) production build.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2239) For more information on KUnit and unit tests in general please refer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2240) to the KUnit documentation in Documentation/dev-tools/kunit/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2242) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2244) config SYSCTL_KUNIT_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2245) tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2246) depends on KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2247) default KUNIT_ALL_TESTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2248) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2249) This builds the proc sysctl unit test, which runs on boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2250) Tests the API contract and implementation correctness of sysctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2251) For more information on KUnit and unit tests in general please refer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2252) to the KUnit documentation in Documentation/dev-tools/kunit/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2254) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2256) config LIST_KUNIT_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2257) tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2258) depends on KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2259) default KUNIT_ALL_TESTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2260) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2261) This builds the linked list KUnit test suite.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2262) It tests that the API and basic functionality of the list_head type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2263) and associated macros.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2265) KUnit tests run during boot and output the results to the debug log
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2266) in TAP format (https://testanything.org/). Only useful for kernel devs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2267) running the KUnit test harness, and not intended for inclusion into a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2268) production build.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2270) For more information on KUnit and unit tests in general please refer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2271) to the KUnit documentation in Documentation/dev-tools/kunit/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2273) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2274)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2275) config LINEAR_RANGES_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2276) tristate "KUnit test for linear_ranges"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2277) depends on KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2278) select LINEAR_RANGES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2279) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2280) This builds the linear_ranges unit test, which runs on boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2281) Tests the linear_ranges logic correctness.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2282) For more information on KUnit and unit tests in general please refer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2283) to the KUnit documentation in Documentation/dev-tools/kunit/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2285) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2287) config BITS_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2288) tristate "KUnit test for bits.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2289) depends on KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2290) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2291) This builds the bits unit test.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2292) Tests the logic of macros defined in bits.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2293) For more information on KUnit and unit tests in general please refer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2294) to the KUnit documentation in Documentation/dev-tools/kunit/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2296) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2298) config TEST_UDELAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2299) tristate "udelay test driver"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2300) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2301) This builds the "udelay_test" module that helps to make sure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2302) that udelay() is working properly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2304) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2306) config TEST_STATIC_KEYS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2307) tristate "Test static keys"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2308) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2309) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2310) Test the static key interfaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2312) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2314) config TEST_KMOD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2315) tristate "kmod stress tester"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2316) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2317) depends on NETDEVICES && NET_CORE && INET # for TUN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2318) depends on BLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2319) select TEST_LKM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2320) select XFS_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2321) select TUN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2322) select BTRFS_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2323) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2324) Test the kernel's module loading mechanism: kmod. kmod implements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2325) support to load modules using the Linux kernel's usermode helper.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2326) This test provides a series of tests against kmod.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2328) Although technically you can either build test_kmod as a module or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2329) into the kernel we disallow building it into the kernel since
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2330) it stress tests request_module() and this will very likely cause
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2331) some issues by taking over precious threads available from other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2332) module load requests, ultimately this could be fatal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2334) To run tests run:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2336) tools/testing/selftests/kmod/kmod.sh --help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2337)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2338) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2340) config TEST_DEBUG_VIRTUAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2341) tristate "Test CONFIG_DEBUG_VIRTUAL feature"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2342) depends on DEBUG_VIRTUAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2343) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2344) Test the kernel's ability to detect incorrect calls to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2345) virt_to_phys() done against the non-linear part of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2346) kernel's virtual address map.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2347)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2348) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2350) config TEST_MEMCAT_P
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2351) tristate "Test memcat_p() helper function"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2352) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2353) Test the memcat_p() helper for correctly merging two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2354) pointer arrays together.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2356) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2357)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2358) config TEST_LIVEPATCH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2359) tristate "Test livepatching"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2360) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2361) depends on DYNAMIC_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2362) depends on LIVEPATCH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2363) depends on m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2364) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2365) Test kernel livepatching features for correctness. The tests will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2366) load test modules that will be livepatched in various scenarios.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2368) To run all the livepatching tests:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2370) make -C tools/testing/selftests TARGETS=livepatch run_tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2372) Alternatively, individual tests may be invoked:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2373)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2374) tools/testing/selftests/livepatch/test-callbacks.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2375) tools/testing/selftests/livepatch/test-livepatch.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2376) tools/testing/selftests/livepatch/test-shadow-vars.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2377)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2378) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2379)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2380) config TEST_OBJAGG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2381) tristate "Perform selftest on object aggreration manager"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2382) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2383) depends on OBJAGG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2384) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2385) Enable this option to test object aggregation manager on boot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2386) (or module load).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2387)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2388)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2389) config TEST_STACKINIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2390) tristate "Test level of stack variable initialization"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2391) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2392) Test if the kernel is zero-initializing stack variables and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2393) padding. Coverage is controlled by compiler flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2394) CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2395) or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2396)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2397) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2399) config TEST_MEMINIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2400) tristate "Test heap/page initialization"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2401) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2402) Test if the kernel is zero-initializing heap and page allocations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2403) This can be useful to test init_on_alloc and init_on_free features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2404)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2405) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2406)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2407) config TEST_HMM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2408) tristate "Test HMM (Heterogeneous Memory Management)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2409) depends on TRANSPARENT_HUGEPAGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2410) depends on DEVICE_PRIVATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2411) select HMM_MIRROR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2412) select MMU_NOTIFIER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2413) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2414) This is a pseudo device driver solely for testing HMM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2415) Say M here if you want to build the HMM test module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2416) Doing so will allow you to run tools/testing/selftest/vm/hmm-tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2417)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2418) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2419)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2420) config TEST_FREE_PAGES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2421) tristate "Test freeing pages"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2422) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2423) Test that a memory leak does not occur due to a race between
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2424) freeing a block of pages and a speculative page reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2425) Loading this module is safe if your kernel has the bug fixed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2426) If the bug is not fixed, it will leak gigabytes of memory and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2427) probably OOM your system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2428)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2429) config TEST_FPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2430) tristate "Test floating point operations in kernel space"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2431) depends on X86 && !KCOV_INSTRUMENT_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2432) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2433) Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2434) which will trigger a sequence of floating point operations. This is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2435) for self-testing floating point control register setting in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2436) kernel_fpu_begin().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2437)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2438) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2439)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2440) endif # RUNTIME_TESTING_MENU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2441)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2442) config MEMTEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2443) bool "Memtest"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2444) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2445) This option adds a kernel parameter 'memtest', which allows memtest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2446) to be set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2447) memtest=0, mean disabled; -- default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2448) memtest=1, mean do 1 test pattern;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2449) ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2450) memtest=17, mean do 17 test patterns.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2451) If you are unsure how to answer this question, answer N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2452)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2453)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2454)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2455) config HYPERV_TESTING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2456) bool "Microsoft Hyper-V driver testing"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2457) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2458) depends on HYPERV && DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2459) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2460) Select this option to enable Hyper-V vmbus testing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2462) endmenu # "Kernel Testing and Coverage"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2463)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2464) source "Documentation/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2465)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2466) endmenu # Kernel hacking