.. | .. |
---|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | menu "Kernel hacking" |
---|
2 | 3 | |
---|
3 | 4 | menu "printk and dmesg options" |
---|
.. | .. |
---|
19 | 20 | |
---|
20 | 21 | config PRINTK_TIME_FROM_ARM_ARCH_TIMER |
---|
21 | 22 | bool "Timing from ARM architected timer" |
---|
22 | | - depends on PRINTK_TIME && ARM_ARCH_TIMER |
---|
| 23 | + depends on PRINTK_TIME && ARM_ARCH_TIMER && NO_GKI |
---|
23 | 24 | |
---|
24 | | -config PRINTK_PROCESS |
---|
25 | | - bool "Show process information on printks" |
---|
| 25 | +config PRINTK_CALLER |
---|
| 26 | + bool "Show caller information on printks" |
---|
26 | 27 | depends on PRINTK |
---|
27 | 28 | help |
---|
28 | | - Selecting this option causes process to be |
---|
29 | | - included in printk output. Or add printk.process=1 at boot-time. |
---|
| 29 | + Selecting this option causes printk() to add a caller "thread id" (if |
---|
| 30 | + in task context) or a caller "processor id" (if not in task context) |
---|
| 31 | + to every message. |
---|
| 32 | + |
---|
| 33 | + This option is intended for environments where multiple threads |
---|
| 34 | + concurrently call printk() for many times, for it is difficult to |
---|
| 35 | + interpret without knowing where these lines (or sometimes individual |
---|
| 36 | + line which was divided into multiple lines due to race) came from. |
---|
| 37 | + |
---|
| 38 | + Since toggling after boot makes the code racy, currently there is |
---|
| 39 | + no option to enable/disable at the kernel command line parameter or |
---|
| 40 | + sysfs interface. |
---|
30 | 41 | |
---|
31 | 42 | config CONSOLE_LOGLEVEL_DEFAULT |
---|
32 | 43 | int "Default console loglevel (1-15)" |
---|
.. | .. |
---|
92 | 103 | default n |
---|
93 | 104 | depends on PRINTK |
---|
94 | 105 | depends on (DEBUG_FS || PROC_FS) |
---|
| 106 | + select DYNAMIC_DEBUG_CORE |
---|
95 | 107 | help |
---|
96 | 108 | |
---|
97 | 109 | Compiles debug level messages into the kernel, which would not |
---|
.. | .. |
---|
122 | 134 | lineno : line number of the debug statement |
---|
123 | 135 | module : module that contains the debug statement |
---|
124 | 136 | function : function that contains the debug statement |
---|
125 | | - flags : '=p' means the line is turned 'on' for printing |
---|
126 | | - format : the format used for the debug statement |
---|
| 137 | + flags : '=p' means the line is turned 'on' for printing |
---|
| 138 | + format : the format used for the debug statement |
---|
127 | 139 | |
---|
128 | 140 | From a live system: |
---|
129 | 141 | |
---|
.. | .. |
---|
158 | 170 | See Documentation/admin-guide/dynamic-debug-howto.rst for additional |
---|
159 | 171 | information. |
---|
160 | 172 | |
---|
| 173 | +config DYNAMIC_DEBUG_CORE |
---|
| 174 | + bool "Enable core function of dynamic debug support" |
---|
| 175 | + depends on PRINTK |
---|
| 176 | + depends on (DEBUG_FS || PROC_FS) |
---|
| 177 | + help |
---|
| 178 | + Enable core functional support of dynamic debug. It is useful |
---|
| 179 | + when you want to tie dynamic debug to your kernel modules with |
---|
| 180 | + DYNAMIC_DEBUG_MODULE defined for each of them, especially for |
---|
| 181 | + the case of embedded system where the kernel image size is |
---|
| 182 | + sensitive for people. |
---|
| 183 | + |
---|
| 184 | +config SYMBOLIC_ERRNAME |
---|
| 185 | + bool "Support symbolic error names in printf" |
---|
| 186 | + default y if PRINTK |
---|
| 187 | + help |
---|
| 188 | + If you say Y here, the kernel's printf implementation will |
---|
| 189 | + be able to print symbolic error names such as ENOSPC instead |
---|
| 190 | + of the number 28. It makes the kernel image slightly larger |
---|
| 191 | + (about 3KB), but can make the kernel logs easier to read. |
---|
| 192 | + |
---|
| 193 | +config DEBUG_BUGVERBOSE |
---|
| 194 | + bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT |
---|
| 195 | + depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) |
---|
| 196 | + default y |
---|
| 197 | + help |
---|
| 198 | + Say Y here to make BUG() panics output the file name and line number |
---|
| 199 | + of the BUG call as well as the EIP and oops trace. This aids |
---|
| 200 | + debugging but costs about 70-100K of memory. |
---|
| 201 | + |
---|
161 | 202 | endmenu # "printk and dmesg options" |
---|
162 | 203 | |
---|
163 | 204 | menu "Compile-time checks and compiler options" |
---|
.. | .. |
---|
166 | 207 | bool "Compile the kernel with debug info" |
---|
167 | 208 | depends on DEBUG_KERNEL && !COMPILE_TEST |
---|
168 | 209 | help |
---|
169 | | - If you say Y here the resulting kernel image will include |
---|
| 210 | + If you say Y here the resulting kernel image will include |
---|
170 | 211 | debugging info resulting in a larger kernel image. |
---|
171 | 212 | This adds debug symbols to the kernel and modules (gcc -g), and |
---|
172 | 213 | is needed if you intend to use kernel crashdump or binary object |
---|
.. | .. |
---|
175 | 216 | |
---|
176 | 217 | If unsure, say N. |
---|
177 | 218 | |
---|
| 219 | +if DEBUG_INFO |
---|
| 220 | + |
---|
178 | 221 | config DEBUG_INFO_REDUCED |
---|
179 | 222 | bool "Reduce debugging information" |
---|
180 | | - depends on DEBUG_INFO |
---|
181 | 223 | help |
---|
182 | 224 | If you say Y here gcc is instructed to generate less debugging |
---|
183 | 225 | information for structure types. This means that tools that |
---|
.. | .. |
---|
188 | 230 | DEBUG_INFO build and compile times are reduced too. |
---|
189 | 231 | Only works with newer gcc versions. |
---|
190 | 232 | |
---|
| 233 | +config DEBUG_INFO_COMPRESSED |
---|
| 234 | + bool "Compressed debugging information" |
---|
| 235 | + depends on $(cc-option,-gz=zlib) |
---|
| 236 | + depends on $(ld-option,--compress-debug-sections=zlib) |
---|
| 237 | + help |
---|
| 238 | + Compress the debug information using zlib. Requires GCC 5.0+ or Clang |
---|
| 239 | + 5.0+, binutils 2.26+, and zlib. |
---|
| 240 | + |
---|
| 241 | + Users of dpkg-deb via scripts/package/builddeb may find an increase in |
---|
| 242 | + size of their debug .deb packages with this config set, due to the |
---|
| 243 | + debug info being compressed with zlib, then the object files being |
---|
| 244 | + recompressed with a different compression scheme. But this is still |
---|
| 245 | + preferable to setting $KDEB_COMPRESS to "none" which would be even |
---|
| 246 | + larger. |
---|
| 247 | + |
---|
191 | 248 | config DEBUG_INFO_SPLIT |
---|
192 | 249 | bool "Produce split debuginfo in .dwo files" |
---|
193 | | - depends on DEBUG_INFO |
---|
| 250 | + depends on $(cc-option,-gsplit-dwarf) |
---|
194 | 251 | help |
---|
195 | 252 | Generate debug info into separate .dwo files. This significantly |
---|
196 | 253 | reduces the build directory size for builds with DEBUG_INFO, |
---|
.. | .. |
---|
205 | 262 | |
---|
206 | 263 | config DEBUG_INFO_DWARF4 |
---|
207 | 264 | bool "Generate dwarf4 debuginfo" |
---|
208 | | - depends on DEBUG_INFO |
---|
| 265 | + depends on $(cc-option,-gdwarf-4) |
---|
209 | 266 | help |
---|
210 | 267 | Generate dwarf4 debug info. This requires recent versions |
---|
211 | 268 | of gcc and gdb. It makes the debug information larger. |
---|
212 | 269 | But it significantly improves the success of resolving |
---|
213 | 270 | variables in gdb on optimized code. |
---|
214 | 271 | |
---|
| 272 | +config DEBUG_INFO_BTF |
---|
| 273 | + bool "Generate BTF typeinfo" |
---|
| 274 | + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED |
---|
| 275 | + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST |
---|
| 276 | + help |
---|
| 277 | + Generate deduplicated BTF type information from DWARF debug info. |
---|
| 278 | + Turning this on expects presence of pahole tool, which will convert |
---|
| 279 | + DWARF type info into equivalent deduplicated BTF type info. |
---|
| 280 | + |
---|
215 | 281 | config GDB_SCRIPTS |
---|
216 | 282 | bool "Provide GDB scripts for kernel debugging" |
---|
217 | | - depends on DEBUG_INFO |
---|
218 | 283 | help |
---|
219 | 284 | This creates the required links to GDB helper scripts in the |
---|
220 | 285 | build directory. If you load vmlinux into gdb, the helper |
---|
.. | .. |
---|
222 | 287 | additional functions are available to analyze a Linux kernel |
---|
223 | 288 | instance. See Documentation/dev-tools/gdb-kernel-debugging.rst |
---|
224 | 289 | for further details. |
---|
| 290 | + |
---|
| 291 | +endif # DEBUG_INFO |
---|
225 | 292 | |
---|
226 | 293 | config ENABLE_MUST_CHECK |
---|
227 | 294 | bool "Enable __must_check logic" |
---|
.. | .. |
---|
232 | 299 | attribute warn_unused_result" messages. |
---|
233 | 300 | |
---|
234 | 301 | config FRAME_WARN |
---|
235 | | - int "Warn for stack frames larger than (needs gcc 4.4)" |
---|
| 302 | + int "Warn for stack frames larger than" |
---|
236 | 303 | range 0 8192 |
---|
237 | 304 | default 2048 if GCC_PLUGIN_LATENT_ENTROPY |
---|
238 | | - default 1280 if (!64BIT && PARISC) |
---|
239 | | - default 1024 if (!64BIT && !PARISC) |
---|
| 305 | + default 2048 if PARISC |
---|
| 306 | + default 1536 if (!64BIT && XTENSA) |
---|
| 307 | + default 1280 if KASAN && !64BIT |
---|
| 308 | + default 1024 if !64BIT |
---|
240 | 309 | default 2048 if 64BIT |
---|
241 | 310 | help |
---|
242 | 311 | Tell gcc to warn at build time for stack frames larger than this. |
---|
243 | 312 | Setting this too low will cause a lot of warnings. |
---|
244 | 313 | Setting it to 0 disables the warning. |
---|
245 | | - Requires gcc 4.4 |
---|
246 | 314 | |
---|
247 | 315 | config STRIP_ASM_SYMS |
---|
248 | 316 | bool "Strip assembler-generated symbols during link" |
---|
.. | .. |
---|
253 | 321 | get_wchan() and suchlike. |
---|
254 | 322 | |
---|
255 | 323 | config READABLE_ASM |
---|
256 | | - bool "Generate readable assembler code" |
---|
257 | | - depends on DEBUG_KERNEL |
---|
258 | | - help |
---|
259 | | - Disable some compiler optimizations that tend to generate human unreadable |
---|
260 | | - assembler output. This may make the kernel slightly slower, but it helps |
---|
261 | | - to keep kernel developers who have to stare a lot at assembler listings |
---|
262 | | - sane. |
---|
263 | | - |
---|
264 | | -config UNUSED_SYMBOLS |
---|
265 | | - bool "Enable unused/obsolete exported symbols" |
---|
266 | | - default y if X86 |
---|
| 324 | + bool "Generate readable assembler code" |
---|
| 325 | + depends on DEBUG_KERNEL |
---|
267 | 326 | help |
---|
268 | | - Unused but exported symbols make the kernel needlessly bigger. For |
---|
269 | | - that reason most of these unused exports will soon be removed. This |
---|
270 | | - option is provided temporarily to provide a transition period in case |
---|
271 | | - some external kernel module needs one of these symbols anyway. If you |
---|
272 | | - encounter such a case in your module, consider if you are actually |
---|
273 | | - using the right API. (rationale: since nobody in the kernel is using |
---|
274 | | - this in a module, there is a pretty good chance it's actually the |
---|
275 | | - wrong interface to use). If you really need the symbol, please send a |
---|
276 | | - mail to the linux kernel mailing list mentioning the symbol and why |
---|
277 | | - you really need it, and what the merge plan to the mainline kernel for |
---|
278 | | - your module is. |
---|
| 327 | + Disable some compiler optimizations that tend to generate human unreadable |
---|
| 328 | + assembler output. This may make the kernel slightly slower, but it helps |
---|
| 329 | + to keep kernel developers who have to stare a lot at assembler listings |
---|
| 330 | + sane. |
---|
279 | 331 | |
---|
280 | | -config PAGE_OWNER |
---|
281 | | - bool "Track page owner" |
---|
282 | | - depends on DEBUG_KERNEL && STACKTRACE_SUPPORT |
---|
283 | | - select DEBUG_FS |
---|
284 | | - select STACKTRACE |
---|
285 | | - select STACKDEPOT |
---|
286 | | - select PAGE_EXTENSION |
---|
287 | | - help |
---|
288 | | - This keeps track of what call chain is the owner of a page, may |
---|
289 | | - help to find bare alloc_page(s) leaks. Even if you include this |
---|
290 | | - feature on your build, it is disabled in default. You should pass |
---|
291 | | - "page_owner=on" to boot parameter in order to enable it. Eats |
---|
292 | | - a fair amount of memory if enabled. See tools/vm/page_owner_sort.c |
---|
293 | | - for user-space helper. |
---|
294 | | - |
---|
295 | | - If unsure, say N. |
---|
296 | | - |
---|
297 | | -config DEBUG_FS |
---|
298 | | - bool "Debug Filesystem" |
---|
299 | | - help |
---|
300 | | - debugfs is a virtual file system that kernel developers use to put |
---|
301 | | - debugging files into. Enable this option to be able to read and |
---|
302 | | - write to these files. |
---|
303 | | - |
---|
304 | | - For detailed documentation on the debugfs API, see |
---|
305 | | - Documentation/filesystems/. |
---|
306 | | - |
---|
307 | | - If unsure, say N. |
---|
308 | | - |
---|
309 | | -config HEADERS_CHECK |
---|
310 | | - bool "Run 'make headers_check' when building vmlinux" |
---|
| 332 | +config HEADERS_INSTALL |
---|
| 333 | + bool "Install uapi headers to usr/include" |
---|
311 | 334 | depends on !UML |
---|
312 | 335 | help |
---|
313 | | - This option will extract the user-visible kernel headers whenever |
---|
314 | | - building the kernel, and will run basic sanity checks on them to |
---|
315 | | - ensure that exported files do not attempt to include files which |
---|
316 | | - were not exported, etc. |
---|
317 | | - |
---|
318 | | - If you're making modifications to header files which are |
---|
319 | | - relevant for userspace, say 'Y', and check the headers |
---|
320 | | - exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in |
---|
321 | | - your build tree), to make sure they're suitable. |
---|
| 336 | + This option will install uapi headers (headers exported to user-space) |
---|
| 337 | + into the usr/include directory for use during the kernel build. |
---|
| 338 | + This is unneeded for building the kernel itself, but needed for some |
---|
| 339 | + user-space program samples. It is also needed by some features such |
---|
| 340 | + as uapi header sanity checks. |
---|
322 | 341 | |
---|
323 | 342 | config DEBUG_SECTION_MISMATCH |
---|
324 | 343 | bool "Enable full Section mismatch analysis" |
---|
.. | .. |
---|
333 | 352 | which results in the code/data being placed in specific sections. |
---|
334 | 353 | The section mismatch analysis is always performed after a full |
---|
335 | 354 | kernel build, and enabling this option causes the following |
---|
336 | | - additional steps to occur: |
---|
| 355 | + additional step to occur: |
---|
337 | 356 | - Add the option -fno-inline-functions-called-once to gcc commands. |
---|
338 | 357 | When inlining a function annotated with __init in a non-init |
---|
339 | 358 | function, we would lose the section information and thus |
---|
340 | 359 | the analysis would not catch the illegal reference. |
---|
341 | 360 | This option tells gcc to inline less (but it does result in |
---|
342 | 361 | a larger kernel). |
---|
343 | | - - Run the section mismatch analysis for each module/built-in.a file. |
---|
344 | | - When we run the section mismatch analysis on vmlinux.o, we |
---|
345 | | - lose valuable information about where the mismatch was |
---|
346 | | - introduced. |
---|
347 | | - Running the analysis for each module/built-in.a file |
---|
348 | | - tells where the mismatch happens much closer to the |
---|
349 | | - source. The drawback is that the same mismatch is |
---|
350 | | - reported at least twice. |
---|
351 | | - - Enable verbose reporting from modpost in order to help resolve |
---|
352 | | - the section mismatches that are reported. |
---|
353 | 362 | |
---|
354 | 363 | config SECTION_MISMATCH_WARN_ONLY |
---|
355 | 364 | bool "Make section mismatch errors non-fatal" |
---|
.. | .. |
---|
359 | 368 | section mismatch, instead of just throwing warnings. |
---|
360 | 369 | |
---|
361 | 370 | If unsure, say Y. |
---|
| 371 | + |
---|
| 372 | +config DEBUG_FORCE_FUNCTION_ALIGN_32B |
---|
| 373 | + bool "Force all function address 32B aligned" if EXPERT |
---|
| 374 | + help |
---|
| 375 | + There are cases that a commit from one domain changes the function |
---|
| 376 | + address alignment of other domains, and cause magic performance |
---|
| 377 | + bump (regression or improvement). Enable this option will help to |
---|
| 378 | + verify if the bump is caused by function alignment changes, while |
---|
| 379 | + it will slightly increase the kernel size and affect icache usage. |
---|
| 380 | + |
---|
| 381 | + It is mainly for debug and performance tuning use. |
---|
362 | 382 | |
---|
363 | 383 | # |
---|
364 | 384 | # Select this config option from the architecture Kconfig, if it |
---|
.. | .. |
---|
392 | 412 | For more information, see |
---|
393 | 413 | tools/objtool/Documentation/stack-validation.txt. |
---|
394 | 414 | |
---|
| 415 | +config VMLINUX_VALIDATION |
---|
| 416 | + bool |
---|
| 417 | + depends on STACK_VALIDATION && DEBUG_ENTRY && !PARAVIRT |
---|
| 418 | + default y |
---|
| 419 | + |
---|
395 | 420 | config DEBUG_FORCE_WEAK_PER_CPU |
---|
396 | 421 | bool "Force weak per-cpu definitions" |
---|
397 | 422 | depends on DEBUG_KERNEL |
---|
.. | .. |
---|
408 | 433 | option forces all percpu variables to be defined as weak. |
---|
409 | 434 | |
---|
410 | 435 | endmenu # "Compiler options" |
---|
| 436 | + |
---|
| 437 | +menu "Generic Kernel Debugging Instruments" |
---|
411 | 438 | |
---|
412 | 439 | config MAGIC_SYSRQ |
---|
413 | 440 | bool "Magic SysRq key" |
---|
.. | .. |
---|
442 | 469 | This option allows you to decide whether you want to enable the |
---|
443 | 470 | magic SysRq key. |
---|
444 | 471 | |
---|
| 472 | +config MAGIC_SYSRQ_SERIAL_SEQUENCE |
---|
| 473 | + string "Char sequence that enables magic SysRq over serial" |
---|
| 474 | + depends on MAGIC_SYSRQ_SERIAL |
---|
| 475 | + default "" |
---|
| 476 | + help |
---|
| 477 | + Specifies a sequence of characters that can follow BREAK to enable |
---|
| 478 | + SysRq on a serial console. |
---|
| 479 | + |
---|
| 480 | + If unsure, leave an empty string and the option will not be enabled. |
---|
| 481 | + |
---|
| 482 | +config DEBUG_FS |
---|
| 483 | + bool "Debug Filesystem" |
---|
| 484 | + help |
---|
| 485 | + debugfs is a virtual file system that kernel developers use to put |
---|
| 486 | + debugging files into. Enable this option to be able to read and |
---|
| 487 | + write to these files. |
---|
| 488 | + |
---|
| 489 | + For detailed documentation on the debugfs API, see |
---|
| 490 | + Documentation/filesystems/. |
---|
| 491 | + |
---|
| 492 | + If unsure, say N. |
---|
| 493 | + |
---|
| 494 | +choice |
---|
| 495 | + prompt "Debugfs default access" |
---|
| 496 | + depends on DEBUG_FS |
---|
| 497 | + default DEBUG_FS_ALLOW_ALL |
---|
| 498 | + help |
---|
| 499 | + This selects the default access restrictions for debugfs. |
---|
| 500 | + It can be overridden with kernel command line option |
---|
| 501 | + debugfs=[on,no-mount,off]. The restrictions apply for API access |
---|
| 502 | + and filesystem registration. |
---|
| 503 | + |
---|
| 504 | +config DEBUG_FS_ALLOW_ALL |
---|
| 505 | + bool "Access normal" |
---|
| 506 | + help |
---|
| 507 | + No restrictions apply. Both API and filesystem registration |
---|
| 508 | + is on. This is the normal default operation. |
---|
| 509 | + |
---|
| 510 | +config DEBUG_FS_DISALLOW_MOUNT |
---|
| 511 | + bool "Do not register debugfs as filesystem" |
---|
| 512 | + help |
---|
| 513 | + The API is open but filesystem is not loaded. Clients can still do |
---|
| 514 | + their work and read with debug tools that do not need |
---|
| 515 | + debugfs filesystem. |
---|
| 516 | + |
---|
| 517 | +config DEBUG_FS_ALLOW_NONE |
---|
| 518 | + bool "No access" |
---|
| 519 | + help |
---|
| 520 | + Access is off. Clients get -PERM when trying to create nodes in |
---|
| 521 | + debugfs tree and debugfs is not registered as a filesystem. |
---|
| 522 | + Client can then back-off or continue without debugfs access. |
---|
| 523 | + |
---|
| 524 | +endchoice |
---|
| 525 | + |
---|
| 526 | +source "lib/Kconfig.kgdb" |
---|
| 527 | +source "lib/Kconfig.ubsan" |
---|
| 528 | +source "lib/Kconfig.kcsan" |
---|
| 529 | + |
---|
| 530 | +endmenu |
---|
| 531 | + |
---|
445 | 532 | config DEBUG_KERNEL |
---|
446 | 533 | bool "Kernel debugging" |
---|
447 | 534 | help |
---|
448 | 535 | Say Y here if you are developing drivers or trying to debug and |
---|
449 | 536 | identify kernel problems. |
---|
450 | 537 | |
---|
| 538 | +config DEBUG_MISC |
---|
| 539 | + bool "Miscellaneous debug code" |
---|
| 540 | + default DEBUG_KERNEL |
---|
| 541 | + depends on DEBUG_KERNEL |
---|
| 542 | + help |
---|
| 543 | + Say Y here if you need to enable miscellaneous debug code that should |
---|
| 544 | + be under a more specific debug option but isn't. |
---|
| 545 | + |
---|
| 546 | + |
---|
451 | 547 | menu "Memory Debugging" |
---|
452 | 548 | |
---|
453 | | -source mm/Kconfig.debug |
---|
| 549 | +source "mm/Kconfig.debug" |
---|
454 | 550 | |
---|
455 | 551 | config DEBUG_OBJECTS |
---|
456 | 552 | bool "Debug object operations" |
---|
.. | .. |
---|
507 | 603 | |
---|
508 | 604 | config DEBUG_OBJECTS_ENABLE_DEFAULT |
---|
509 | 605 | int "debug_objects bootup default value (0-1)" |
---|
510 | | - range 0 1 |
---|
511 | | - default "1" |
---|
512 | | - depends on DEBUG_OBJECTS |
---|
513 | | - help |
---|
514 | | - Debug objects boot parameter default value |
---|
| 606 | + range 0 1 |
---|
| 607 | + default "1" |
---|
| 608 | + depends on DEBUG_OBJECTS |
---|
| 609 | + help |
---|
| 610 | + Debug objects boot parameter default value |
---|
515 | 611 | |
---|
516 | 612 | config DEBUG_SLAB |
---|
517 | 613 | bool "Debug slab memory allocations" |
---|
.. | .. |
---|
520 | 616 | Say Y here to have the kernel do limited verification on memory |
---|
521 | 617 | allocation as well as poisoning memory on free to catch use of freed |
---|
522 | 618 | memory. This can make kmalloc/kfree-intensive workloads much slower. |
---|
523 | | - |
---|
524 | | -config DEBUG_SLAB_LEAK |
---|
525 | | - bool "Memory leak debugging" |
---|
526 | | - depends on DEBUG_SLAB |
---|
527 | 619 | |
---|
528 | 620 | config SLUB_DEBUG_ON |
---|
529 | 621 | bool "SLUB debugging on by default" |
---|
.. | .. |
---|
577 | 669 | In order to access the kmemleak file, debugfs needs to be |
---|
578 | 670 | mounted (usually at /sys/kernel/debug). |
---|
579 | 671 | |
---|
580 | | -config DEBUG_KMEMLEAK_EARLY_LOG_SIZE |
---|
581 | | - int "Maximum kmemleak early log entries" |
---|
| 672 | +config DEBUG_KMEMLEAK_MEM_POOL_SIZE |
---|
| 673 | + int "Kmemleak memory pool size" |
---|
582 | 674 | depends on DEBUG_KMEMLEAK |
---|
583 | | - range 200 40000 |
---|
| 675 | + range 200 1000000 |
---|
584 | 676 | default 16000 |
---|
585 | 677 | help |
---|
586 | 678 | Kmemleak must track all the memory allocations to avoid |
---|
587 | 679 | reporting false positives. Since memory may be allocated or |
---|
588 | | - freed before kmemleak is initialised, an early log buffer is |
---|
589 | | - used to store these actions. If kmemleak reports "early log |
---|
590 | | - buffer exceeded", please increase this value. |
---|
| 680 | + freed before kmemleak is fully initialised, use a static pool |
---|
| 681 | + of metadata objects to track such callbacks. After kmemleak is |
---|
| 682 | + fully initialised, this memory pool acts as an emergency one |
---|
| 683 | + if slab allocations fail. |
---|
591 | 684 | |
---|
592 | 685 | config DEBUG_KMEMLEAK_TEST |
---|
593 | 686 | tristate "Simple test for the kernel memory leak detector" |
---|
.. | .. |
---|
604 | 697 | Say Y here to disable kmemleak by default. It can then be enabled |
---|
605 | 698 | on the command line via kmemleak=on. |
---|
606 | 699 | |
---|
| 700 | +config DEBUG_KMEMLEAK_AUTO_SCAN |
---|
| 701 | + bool "Enable kmemleak auto scan thread on boot up" |
---|
| 702 | + default y |
---|
| 703 | + depends on DEBUG_KMEMLEAK |
---|
| 704 | + help |
---|
| 705 | + Depending on the cpu, kmemleak scan may be cpu intensive and can |
---|
| 706 | + stall user tasks at times. This option enables/disables automatic |
---|
| 707 | + kmemleak scan at boot up. |
---|
| 708 | + |
---|
| 709 | + Say N here to disable kmemleak auto scan thread to stop automatic |
---|
| 710 | + scanning. Disabling this option disables automatic reporting of |
---|
| 711 | + memory leaks. |
---|
| 712 | + |
---|
| 713 | + If unsure, say Y. |
---|
| 714 | + |
---|
607 | 715 | config DEBUG_STACK_USAGE |
---|
608 | 716 | bool "Stack utilization instrumentation" |
---|
609 | 717 | depends on DEBUG_KERNEL && !IA64 |
---|
.. | .. |
---|
613 | 721 | |
---|
614 | 722 | This option will slow down process creation somewhat. |
---|
615 | 723 | |
---|
| 724 | +config SCHED_STACK_END_CHECK |
---|
| 725 | + bool "Detect stack corruption on calls to schedule()" |
---|
| 726 | + depends on DEBUG_KERNEL |
---|
| 727 | + default n |
---|
| 728 | + help |
---|
| 729 | + This option checks for a stack overrun on calls to schedule(). |
---|
| 730 | + If the stack end location is found to be over written always panic as |
---|
| 731 | + the content of the corrupted region can no longer be trusted. |
---|
| 732 | + This is to ensure no erroneous behaviour occurs which could result in |
---|
| 733 | + data corruption or a sporadic crash at a later stage once the region |
---|
| 734 | + is examined. The runtime overhead introduced is minimal. |
---|
| 735 | + |
---|
| 736 | +config ARCH_HAS_DEBUG_VM_PGTABLE |
---|
| 737 | + bool |
---|
| 738 | + help |
---|
| 739 | + An architecture should select this when it can successfully |
---|
| 740 | + build and run DEBUG_VM_PGTABLE. |
---|
| 741 | + |
---|
616 | 742 | config DEBUG_VM |
---|
617 | 743 | bool "Debug VM" |
---|
618 | 744 | depends on DEBUG_KERNEL |
---|
619 | 745 | help |
---|
620 | 746 | Enable this to turn on extended checks in the virtual-memory system |
---|
621 | | - that may impact performance. |
---|
| 747 | + that may impact performance. |
---|
622 | 748 | |
---|
623 | 749 | If unsure, say N. |
---|
624 | 750 | |
---|
.. | .. |
---|
645 | 771 | depends on DEBUG_VM |
---|
646 | 772 | help |
---|
647 | 773 | Enables extra validation on page flags operations. |
---|
| 774 | + |
---|
| 775 | + If unsure, say N. |
---|
| 776 | + |
---|
| 777 | +config DEBUG_VM_PGTABLE |
---|
| 778 | + bool "Debug arch page table for semantics compliance" |
---|
| 779 | + depends on MMU |
---|
| 780 | + depends on ARCH_HAS_DEBUG_VM_PGTABLE |
---|
| 781 | + default y if DEBUG_VM |
---|
| 782 | + help |
---|
| 783 | + This option provides a debug method which can be used to test |
---|
| 784 | + architecture page table helper functions on various platforms in |
---|
| 785 | + verifying if they comply with expected generic MM semantics. This |
---|
| 786 | + will help architecture code in making sure that any changes or |
---|
| 787 | + new additions of these helpers still conform to expected |
---|
| 788 | + semantics of the generic MM. Platforms will have to opt in for |
---|
| 789 | + this through ARCH_HAS_DEBUG_VM_PGTABLE. |
---|
648 | 790 | |
---|
649 | 791 | If unsure, say N. |
---|
650 | 792 | |
---|
.. | .. |
---|
726 | 868 | config DEBUG_STACKOVERFLOW |
---|
727 | 869 | bool "Check for stack overflows" |
---|
728 | 870 | depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW |
---|
729 | | - ---help--- |
---|
| 871 | + help |
---|
730 | 872 | Say Y here if you want to check for overflows of kernel, IRQ |
---|
731 | 873 | and exception stacks (if your architecture uses them). This |
---|
732 | 874 | option will show detailed messages if free stack space drops |
---|
.. | .. |
---|
742 | 884 | If in doubt, say "N". |
---|
743 | 885 | |
---|
744 | 886 | source "lib/Kconfig.kasan" |
---|
| 887 | +source "lib/Kconfig.kfence" |
---|
745 | 888 | |
---|
746 | 889 | endmenu # "Memory Debugging" |
---|
747 | | - |
---|
748 | | -config ARCH_HAS_KCOV |
---|
749 | | - bool |
---|
750 | | - help |
---|
751 | | - An architecture should select this when it can successfully |
---|
752 | | - build and run with CONFIG_KCOV. This typically requires |
---|
753 | | - disabling instrumentation for some early boot code. |
---|
754 | | - |
---|
755 | | -config CC_HAS_SANCOV_TRACE_PC |
---|
756 | | - def_bool $(cc-option,-fsanitize-coverage=trace-pc) |
---|
757 | | - |
---|
758 | | -config KCOV |
---|
759 | | - bool "Code coverage for fuzzing" |
---|
760 | | - depends on ARCH_HAS_KCOV |
---|
761 | | - depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS |
---|
762 | | - select DEBUG_FS |
---|
763 | | - select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC |
---|
764 | | - help |
---|
765 | | - KCOV exposes kernel code coverage information in a form suitable |
---|
766 | | - for coverage-guided fuzzing (randomized testing). |
---|
767 | | - |
---|
768 | | - If RANDOMIZE_BASE is enabled, PC values will not be stable across |
---|
769 | | - different machines and across reboots. If you need stable PC values, |
---|
770 | | - disable RANDOMIZE_BASE. |
---|
771 | | - |
---|
772 | | - For more details, see Documentation/dev-tools/kcov.rst. |
---|
773 | | - |
---|
774 | | -config KCOV_ENABLE_COMPARISONS |
---|
775 | | - bool "Enable comparison operands collection by KCOV" |
---|
776 | | - depends on KCOV |
---|
777 | | - depends on $(cc-option,-fsanitize-coverage=trace-cmp) |
---|
778 | | - help |
---|
779 | | - KCOV also exposes operands of every comparison in the instrumented |
---|
780 | | - code along with operand sizes and PCs of the comparison instructions. |
---|
781 | | - These operands can be used by fuzzing engines to improve the quality |
---|
782 | | - of fuzzing coverage. |
---|
783 | | - |
---|
784 | | -config KCOV_INSTRUMENT_ALL |
---|
785 | | - bool "Instrument all code by default" |
---|
786 | | - depends on KCOV |
---|
787 | | - default y |
---|
788 | | - help |
---|
789 | | - If you are doing generic system call fuzzing (like e.g. syzkaller), |
---|
790 | | - then you will want to instrument the whole kernel and you should |
---|
791 | | - say y here. If you are doing more targeted fuzzing (like e.g. |
---|
792 | | - filesystem fuzzing with AFL) then you will want to enable coverage |
---|
793 | | - for more specific subsets of files, and should say n here. |
---|
794 | 890 | |
---|
795 | 891 | config DEBUG_SHIRQ |
---|
796 | 892 | bool "Debug shared IRQ handlers" |
---|
797 | 893 | depends on DEBUG_KERNEL |
---|
798 | 894 | help |
---|
799 | | - Enable this to generate a spurious interrupt as soon as a shared |
---|
800 | | - interrupt handler is registered, and just before one is deregistered. |
---|
801 | | - Drivers ought to be able to handle interrupts coming in at those |
---|
802 | | - points; some don't and need to be caught. |
---|
| 895 | + Enable this to generate a spurious interrupt just before a shared |
---|
| 896 | + interrupt handler is deregistered (generating one when registering |
---|
| 897 | + is currently disabled). Drivers need to handle this correctly. Some |
---|
| 898 | + don't and need to be caught. |
---|
803 | 899 | |
---|
804 | | -menu "Debug Lockups and Hangs" |
---|
| 900 | +menu "Debug Oops, Lockups and Hangs" |
---|
| 901 | + |
---|
| 902 | +config PANIC_ON_OOPS |
---|
| 903 | + bool "Panic on Oops" |
---|
| 904 | + help |
---|
| 905 | + Say Y here to enable the kernel to panic when it oopses. This |
---|
| 906 | + has the same effect as setting oops=panic on the kernel command |
---|
| 907 | + line. |
---|
| 908 | + |
---|
| 909 | + This feature is useful to ensure that the kernel does not do |
---|
| 910 | + anything erroneous after an oops which could result in data |
---|
| 911 | + corruption or other issues. |
---|
| 912 | + |
---|
| 913 | + Say N if unsure. |
---|
| 914 | + |
---|
| 915 | +config PANIC_ON_OOPS_VALUE |
---|
| 916 | + int |
---|
| 917 | + range 0 1 |
---|
| 918 | + default 0 if !PANIC_ON_OOPS |
---|
| 919 | + default 1 if PANIC_ON_OOPS |
---|
| 920 | + |
---|
| 921 | +config PANIC_TIMEOUT |
---|
| 922 | + int "panic timeout" |
---|
| 923 | + default 0 |
---|
| 924 | + help |
---|
| 925 | + Set the timeout value (in seconds) until a reboot occurs when |
---|
| 926 | + the kernel panics. If n = 0, then we wait forever. A timeout |
---|
| 927 | + value n > 0 will wait n seconds before rebooting, while a timeout |
---|
| 928 | + value n < 0 will reboot immediately. |
---|
805 | 929 | |
---|
806 | 930 | config LOCKUP_DETECTOR |
---|
807 | 931 | bool |
---|
.. | .. |
---|
860 | 984 | # |
---|
861 | 985 | config HAVE_HARDLOCKUP_DETECTOR_OTHER_CPU |
---|
862 | 986 | def_bool y |
---|
| 987 | + depends on NO_GKI |
---|
863 | 988 | depends on SMP |
---|
864 | 989 | depends on !HAVE_HARDLOCKUP_DETECTOR_PERF && !HAVE_HARDLOCKUP_DETECTOR_ARCH |
---|
865 | 990 | |
---|
.. | .. |
---|
966 | 1091 | state. This can be configured through kernel parameter |
---|
967 | 1092 | "workqueue.watchdog_thresh" and its sysfs counterpart. |
---|
968 | 1093 | |
---|
| 1094 | +config TEST_LOCKUP |
---|
| 1095 | + tristate "Test module to generate lockups" |
---|
| 1096 | + depends on m |
---|
| 1097 | + help |
---|
| 1098 | + This builds the "test_lockup" module that helps to make sure |
---|
| 1099 | + that watchdogs and lockup detectors are working properly. |
---|
| 1100 | + |
---|
| 1101 | + Depending on module parameters it could emulate soft or hard |
---|
| 1102 | + lockup, "hung task", or locking arbitrary lock for a long time. |
---|
| 1103 | + Also it could generate series of lockups with cooling-down periods. |
---|
| 1104 | + |
---|
| 1105 | + If unsure, say N. |
---|
| 1106 | + |
---|
969 | 1107 | endmenu # "Debug lockups and hangs" |
---|
970 | 1108 | |
---|
971 | | -config PANIC_ON_OOPS |
---|
972 | | - bool "Panic on Oops" |
---|
973 | | - help |
---|
974 | | - Say Y here to enable the kernel to panic when it oopses. This |
---|
975 | | - has the same effect as setting oops=panic on the kernel command |
---|
976 | | - line. |
---|
977 | | - |
---|
978 | | - This feature is useful to ensure that the kernel does not do |
---|
979 | | - anything erroneous after an oops which could result in data |
---|
980 | | - corruption or other issues. |
---|
981 | | - |
---|
982 | | - Say N if unsure. |
---|
983 | | - |
---|
984 | | -config PANIC_ON_OOPS_VALUE |
---|
985 | | - int |
---|
986 | | - range 0 1 |
---|
987 | | - default 0 if !PANIC_ON_OOPS |
---|
988 | | - default 1 if PANIC_ON_OOPS |
---|
989 | | - |
---|
990 | | -config PANIC_TIMEOUT |
---|
991 | | - int "panic timeout" |
---|
992 | | - default 0 |
---|
993 | | - help |
---|
994 | | - Set the timeout value (in seconds) until a reboot occurs when the |
---|
995 | | - the kernel panics. If n = 0, then we wait forever. A timeout |
---|
996 | | - value n > 0 will wait n seconds before rebooting, while a timeout |
---|
997 | | - value n < 0 will reboot immediately. |
---|
| 1109 | +menu "Scheduler Debugging" |
---|
998 | 1110 | |
---|
999 | 1111 | config SCHED_DEBUG |
---|
1000 | 1112 | bool "Collect scheduler debugging info" |
---|
.. | .. |
---|
1022 | 1134 | application, you can say N to avoid the very slight overhead |
---|
1023 | 1135 | this adds. |
---|
1024 | 1136 | |
---|
1025 | | -config SCHED_STACK_END_CHECK |
---|
1026 | | - bool "Detect stack corruption on calls to schedule()" |
---|
1027 | | - depends on DEBUG_KERNEL |
---|
1028 | | - default n |
---|
1029 | | - help |
---|
1030 | | - This option checks for a stack overrun on calls to schedule(). |
---|
1031 | | - If the stack end location is found to be over written always panic as |
---|
1032 | | - the content of the corrupted region can no longer be trusted. |
---|
1033 | | - This is to ensure no erroneous behaviour occurs which could result in |
---|
1034 | | - data corruption or a sporadic crash at a later stage once the region |
---|
1035 | | - is examined. The runtime overhead introduced is minimal. |
---|
| 1137 | +endmenu |
---|
1036 | 1138 | |
---|
1037 | 1139 | config DEBUG_TIMEKEEPING |
---|
1038 | 1140 | bool "Enable extra timekeeping sanity checking" |
---|
.. | .. |
---|
1049 | 1151 | |
---|
1050 | 1152 | config DEBUG_PREEMPT |
---|
1051 | 1153 | bool "Debug preemptible kernel" |
---|
1052 | | - depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT |
---|
| 1154 | + depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT |
---|
1053 | 1155 | default y |
---|
1054 | 1156 | help |
---|
1055 | 1157 | If you say Y here then the kernel will use a debug variant of the |
---|
.. | .. |
---|
1071 | 1173 | select DEBUG_SPINLOCK |
---|
1072 | 1174 | select DEBUG_MUTEXES |
---|
1073 | 1175 | select DEBUG_RT_MUTEXES if RT_MUTEXES |
---|
1074 | | - select DEBUG_RWSEMS if RWSEM_SPIN_ON_OWNER |
---|
| 1176 | + select DEBUG_RWSEMS |
---|
1075 | 1177 | select DEBUG_WW_MUTEX_SLOWPATH |
---|
1076 | 1178 | select DEBUG_LOCK_ALLOC |
---|
| 1179 | + select PREEMPT_COUNT if !ARCH_NO_PREEMPT |
---|
1077 | 1180 | select TRACE_IRQFLAGS |
---|
1078 | 1181 | default n |
---|
1079 | 1182 | help |
---|
.. | .. |
---|
1108 | 1211 | the proof of observed correctness is also maintained for an |
---|
1109 | 1212 | arbitrary combination of these separate locking variants. |
---|
1110 | 1213 | |
---|
1111 | | - For more details, see Documentation/locking/lockdep-design.txt. |
---|
| 1214 | + For more details, see Documentation/locking/lockdep-design.rst. |
---|
| 1215 | + |
---|
| 1216 | +config PROVE_RAW_LOCK_NESTING |
---|
| 1217 | + bool "Enable raw_spinlock - spinlock nesting checks" |
---|
| 1218 | + depends on PROVE_LOCKING |
---|
| 1219 | + default n |
---|
| 1220 | + help |
---|
| 1221 | + Enable the raw_spinlock vs. spinlock nesting checks which ensure |
---|
| 1222 | + that the lock nesting rules for PREEMPT_RT enabled kernels are |
---|
| 1223 | + not violated. |
---|
| 1224 | + |
---|
| 1225 | + NOTE: There are known nesting problems. So if you enable this |
---|
| 1226 | + option expect lockdep splats until these problems have been fully |
---|
| 1227 | + addressed which is work in progress. This config switch allows to |
---|
| 1228 | + identify and analyze these problems. It will be removed and the |
---|
| 1229 | + check permanentely enabled once the main issues have been fixed. |
---|
| 1230 | + |
---|
| 1231 | + If unsure, select N. |
---|
1112 | 1232 | |
---|
1113 | 1233 | config LOCK_STAT |
---|
1114 | 1234 | bool "Lock usage statistics" |
---|
.. | .. |
---|
1122 | 1242 | help |
---|
1123 | 1243 | This feature enables tracking lock contention points |
---|
1124 | 1244 | |
---|
1125 | | - For more details, see Documentation/locking/lockstat.txt |
---|
| 1245 | + For more details, see Documentation/locking/lockstat.rst |
---|
1126 | 1246 | |
---|
1127 | 1247 | This also enables lock events required by "perf lock", |
---|
1128 | 1248 | subcommand of perf. |
---|
.. | .. |
---|
1175 | 1295 | |
---|
1176 | 1296 | config DEBUG_RWSEMS |
---|
1177 | 1297 | bool "RW Semaphore debugging: basic checks" |
---|
1178 | | - depends on DEBUG_KERNEL && RWSEM_SPIN_ON_OWNER |
---|
| 1298 | + depends on DEBUG_KERNEL |
---|
1179 | 1299 | help |
---|
1180 | | - This debugging feature allows mismatched rw semaphore locks and unlocks |
---|
1181 | | - to be detected and reported. |
---|
| 1300 | + This debugging feature allows mismatched rw semaphore locks |
---|
| 1301 | + and unlocks to be detected and reported. |
---|
1182 | 1302 | |
---|
1183 | 1303 | config DEBUG_LOCK_ALLOC |
---|
1184 | 1304 | bool "Lock debugging: detect incorrect freeing of live locks" |
---|
.. | .. |
---|
1199 | 1319 | bool |
---|
1200 | 1320 | depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT |
---|
1201 | 1321 | select STACKTRACE |
---|
1202 | | - select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !X86 |
---|
1203 | 1322 | select KALLSYMS |
---|
1204 | 1323 | select KALLSYMS_ALL |
---|
1205 | 1324 | |
---|
1206 | 1325 | config LOCKDEP_SMALL |
---|
1207 | 1326 | bool |
---|
| 1327 | + |
---|
| 1328 | +config LOCKDEP_BITS |
---|
| 1329 | + int "Bitsize for MAX_LOCKDEP_ENTRIES" |
---|
| 1330 | + depends on LOCKDEP && !LOCKDEP_SMALL |
---|
| 1331 | + range 10 30 |
---|
| 1332 | + default 15 |
---|
| 1333 | + help |
---|
| 1334 | + Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message. |
---|
| 1335 | + |
---|
| 1336 | +config LOCKDEP_CHAINS_BITS |
---|
| 1337 | + int "Bitsize for MAX_LOCKDEP_CHAINS" |
---|
| 1338 | + depends on LOCKDEP && !LOCKDEP_SMALL |
---|
| 1339 | + range 10 30 |
---|
| 1340 | + default 16 |
---|
| 1341 | + help |
---|
| 1342 | + Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message. |
---|
| 1343 | + |
---|
| 1344 | +config LOCKDEP_STACK_TRACE_BITS |
---|
| 1345 | + int "Bitsize for MAX_STACK_TRACE_ENTRIES" |
---|
| 1346 | + depends on LOCKDEP && !LOCKDEP_SMALL |
---|
| 1347 | + range 10 30 |
---|
| 1348 | + default 19 |
---|
| 1349 | + help |
---|
| 1350 | + Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message. |
---|
| 1351 | + |
---|
| 1352 | +config LOCKDEP_STACK_TRACE_HASH_BITS |
---|
| 1353 | + int "Bitsize for STACK_TRACE_HASH_SIZE" |
---|
| 1354 | + depends on LOCKDEP && !LOCKDEP_SMALL |
---|
| 1355 | + range 10 30 |
---|
| 1356 | + default 14 |
---|
| 1357 | + help |
---|
| 1358 | + Try increasing this value if you need large MAX_STACK_TRACE_ENTRIES. |
---|
| 1359 | + |
---|
| 1360 | +config LOCKDEP_CIRCULAR_QUEUE_BITS |
---|
| 1361 | + int "Bitsize for elements in circular_queue struct" |
---|
| 1362 | + depends on LOCKDEP |
---|
| 1363 | + range 10 30 |
---|
| 1364 | + default 12 |
---|
| 1365 | + help |
---|
| 1366 | + Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure. |
---|
1208 | 1367 | |
---|
1209 | 1368 | config DEBUG_LOCKDEP |
---|
1210 | 1369 | bool "Lock dependency engine debugging" |
---|
.. | .. |
---|
1227 | 1386 | |
---|
1228 | 1387 | config DEBUG_LOCKING_API_SELFTESTS |
---|
1229 | 1388 | bool "Locking API boot-time self-tests" |
---|
1230 | | - depends on DEBUG_KERNEL && !PREEMPT_RT_FULL |
---|
| 1389 | + depends on DEBUG_KERNEL |
---|
1231 | 1390 | help |
---|
1232 | 1391 | Say Y here if you want the kernel to run a short self-test during |
---|
1233 | 1392 | bootup. The self-test checks whether common types of locking bugs |
---|
.. | .. |
---|
1262 | 1421 | Say M if you want these self tests to build as a module. |
---|
1263 | 1422 | Say N if you are unsure. |
---|
1264 | 1423 | |
---|
| 1424 | +config SCF_TORTURE_TEST |
---|
| 1425 | + tristate "torture tests for smp_call_function*()" |
---|
| 1426 | + depends on DEBUG_KERNEL |
---|
| 1427 | + select TORTURE_TEST |
---|
| 1428 | + help |
---|
| 1429 | + This option provides a kernel module that runs torture tests |
---|
| 1430 | + on the smp_call_function() family of primitives. The kernel |
---|
| 1431 | + module may be built after the fact on the running kernel to |
---|
| 1432 | + be tested, if desired. |
---|
| 1433 | + |
---|
| 1434 | +config CSD_LOCK_WAIT_DEBUG |
---|
| 1435 | + bool "Debugging for csd_lock_wait(), called from smp_call_function*()" |
---|
| 1436 | + depends on DEBUG_KERNEL |
---|
| 1437 | + depends on 64BIT |
---|
| 1438 | + default n |
---|
| 1439 | + help |
---|
| 1440 | + This option enables debug prints when CPUs are slow to respond |
---|
| 1441 | + to the smp_call_function*() IPI wrappers. These debug prints |
---|
| 1442 | + include the IPI handler function currently executing (if any) |
---|
| 1443 | + and relevant stack traces. |
---|
| 1444 | + |
---|
1265 | 1445 | endmenu # lock debugging |
---|
1266 | 1446 | |
---|
1267 | 1447 | config TRACE_IRQFLAGS |
---|
| 1448 | + depends on TRACE_IRQFLAGS_SUPPORT |
---|
1268 | 1449 | bool |
---|
1269 | 1450 | help |
---|
1270 | 1451 | Enables hooks to interrupt enabling and disabling for |
---|
1271 | 1452 | either tracing or lock debugging. |
---|
| 1453 | + |
---|
| 1454 | +config TRACE_IRQFLAGS_NMI |
---|
| 1455 | + def_bool y |
---|
| 1456 | + depends on TRACE_IRQFLAGS |
---|
| 1457 | + depends on TRACE_IRQFLAGS_NMI_SUPPORT |
---|
1272 | 1458 | |
---|
1273 | 1459 | config STACKTRACE |
---|
1274 | 1460 | bool "Stack backtrace support" |
---|
.. | .. |
---|
1298 | 1484 | so architecture maintainers really need to do what they can |
---|
1299 | 1485 | to get the CRNG seeded sooner after the system is booted. |
---|
1300 | 1486 | However, since users cannot do anything actionable to |
---|
1301 | | - address this, by default the kernel will issue only a single |
---|
1302 | | - warning for the first use of unseeded randomness. |
---|
| 1487 | + address this, by default this option is disabled. |
---|
1303 | 1488 | |
---|
1304 | 1489 | Say Y here if you want to receive warnings for all uses of |
---|
1305 | 1490 | unseeded randomness. This will be of use primarily for |
---|
.. | .. |
---|
1312 | 1497 | depends on DEBUG_KERNEL |
---|
1313 | 1498 | help |
---|
1314 | 1499 | If you say Y here, some extra kobject debugging messages will be sent |
---|
1315 | | - to the syslog. |
---|
| 1500 | + to the syslog. |
---|
1316 | 1501 | |
---|
1317 | 1502 | config DEBUG_KOBJECT_RELEASE |
---|
1318 | 1503 | bool "kobject release debugging" |
---|
.. | .. |
---|
1336 | 1521 | config HAVE_DEBUG_BUGVERBOSE |
---|
1337 | 1522 | bool |
---|
1338 | 1523 | |
---|
1339 | | -config DEBUG_BUGVERBOSE |
---|
1340 | | - bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT |
---|
1341 | | - depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) |
---|
1342 | | - default y |
---|
1343 | | - help |
---|
1344 | | - Say Y here to make BUG() panics output the file name and line number |
---|
1345 | | - of the BUG call as well as the EIP and oops trace. This aids |
---|
1346 | | - debugging but costs about 70-100K of memory. |
---|
| 1524 | +menu "Debug kernel data structures" |
---|
1347 | 1525 | |
---|
1348 | 1526 | config DEBUG_LIST |
---|
1349 | 1527 | bool "Debug linked list manipulation" |
---|
.. | .. |
---|
1354 | 1532 | |
---|
1355 | 1533 | If unsure, say N. |
---|
1356 | 1534 | |
---|
1357 | | -config DEBUG_PI_LIST |
---|
| 1535 | +config DEBUG_PLIST |
---|
1358 | 1536 | bool "Debug priority linked list manipulation" |
---|
1359 | 1537 | depends on DEBUG_KERNEL |
---|
1360 | 1538 | help |
---|
.. | .. |
---|
1383 | 1561 | modules properly unregister themselves from notifier chains. |
---|
1384 | 1562 | This is a relatively cheap check but if you care about maximum |
---|
1385 | 1563 | performance, say N. |
---|
| 1564 | + |
---|
| 1565 | +config BUG_ON_DATA_CORRUPTION |
---|
| 1566 | + bool "Trigger a BUG when data corruption is detected" |
---|
| 1567 | + select DEBUG_LIST |
---|
| 1568 | + help |
---|
| 1569 | + Select this option if the kernel should BUG when it encounters |
---|
| 1570 | + data corruption in kernel memory structures when they get checked |
---|
| 1571 | + for validity. |
---|
| 1572 | + |
---|
| 1573 | + If unsure, say N. |
---|
| 1574 | + |
---|
| 1575 | +endmenu |
---|
1386 | 1576 | |
---|
1387 | 1577 | config DEBUG_CREDENTIALS |
---|
1388 | 1578 | bool "Debug credential management" |
---|
.. | .. |
---|
1417 | 1607 | be impacted. |
---|
1418 | 1608 | |
---|
1419 | 1609 | config DEBUG_BLOCK_EXT_DEVT |
---|
1420 | | - bool "Force extended block device numbers and spread them" |
---|
| 1610 | + bool "Force extended block device numbers and spread them" |
---|
1421 | 1611 | depends on DEBUG_KERNEL |
---|
1422 | 1612 | depends on BLOCK |
---|
1423 | 1613 | default n |
---|
.. | .. |
---|
1455 | 1645 | restarted at arbitrary points yet. |
---|
1456 | 1646 | |
---|
1457 | 1647 | Say N if your are unsure. |
---|
| 1648 | + |
---|
| 1649 | +config LATENCYTOP |
---|
| 1650 | + bool "Latency measuring infrastructure" |
---|
| 1651 | + depends on DEBUG_KERNEL |
---|
| 1652 | + depends on STACKTRACE_SUPPORT |
---|
| 1653 | + depends on PROC_FS |
---|
| 1654 | + depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 |
---|
| 1655 | + select KALLSYMS |
---|
| 1656 | + select KALLSYMS_ALL |
---|
| 1657 | + select STACKTRACE |
---|
| 1658 | + select SCHEDSTATS |
---|
| 1659 | + select SCHED_DEBUG |
---|
| 1660 | + help |
---|
| 1661 | + Enable this option if you want to use the LatencyTOP tool |
---|
| 1662 | + to find out which userspace is blocking on what kernel operations. |
---|
| 1663 | + |
---|
| 1664 | +source "kernel/trace/Kconfig" |
---|
| 1665 | + |
---|
| 1666 | +config PROVIDE_OHCI1394_DMA_INIT |
---|
| 1667 | + bool "Remote debugging over FireWire early on boot" |
---|
| 1668 | + depends on PCI && X86 |
---|
| 1669 | + help |
---|
| 1670 | + If you want to debug problems which hang or crash the kernel early |
---|
| 1671 | + on boot and the crashing machine has a FireWire port, you can use |
---|
| 1672 | + this feature to remotely access the memory of the crashed machine |
---|
| 1673 | + over FireWire. This employs remote DMA as part of the OHCI1394 |
---|
| 1674 | + specification which is now the standard for FireWire controllers. |
---|
| 1675 | + |
---|
| 1676 | + With remote DMA, you can monitor the printk buffer remotely using |
---|
| 1677 | + firescope and access all memory below 4GB using fireproxy from gdb. |
---|
| 1678 | + Even controlling a kernel debugger is possible using remote DMA. |
---|
| 1679 | + |
---|
| 1680 | + Usage: |
---|
| 1681 | + |
---|
| 1682 | + If ohci1394_dma=early is used as boot parameter, it will initialize |
---|
| 1683 | + all OHCI1394 controllers which are found in the PCI config space. |
---|
| 1684 | + |
---|
| 1685 | + As all changes to the FireWire bus such as enabling and disabling |
---|
| 1686 | + devices cause a bus reset and thereby disable remote DMA for all |
---|
| 1687 | + devices, be sure to have the cable plugged and FireWire enabled on |
---|
| 1688 | + the debugging host before booting the debug target for debugging. |
---|
| 1689 | + |
---|
| 1690 | + This code (~1k) is freed after boot. By then, the firewire stack |
---|
| 1691 | + in charge of the OHCI-1394 controllers should be used instead. |
---|
| 1692 | + |
---|
| 1693 | + See Documentation/core-api/debugging-via-ohci1394.rst for more information. |
---|
| 1694 | + |
---|
| 1695 | +source "samples/Kconfig" |
---|
| 1696 | + |
---|
| 1697 | +config ARCH_HAS_DEVMEM_IS_ALLOWED |
---|
| 1698 | + bool |
---|
| 1699 | + |
---|
| 1700 | +config STRICT_DEVMEM |
---|
| 1701 | + bool "Filter access to /dev/mem" |
---|
| 1702 | + depends on MMU && DEVMEM |
---|
| 1703 | + depends on ARCH_HAS_DEVMEM_IS_ALLOWED |
---|
| 1704 | + default y if PPC || X86 || ARM64 |
---|
| 1705 | + help |
---|
| 1706 | + If this option is disabled, you allow userspace (root) access to all |
---|
| 1707 | + of memory, including kernel and userspace memory. Accidental |
---|
| 1708 | + access to this is obviously disastrous, but specific access can |
---|
| 1709 | + be used by people debugging the kernel. Note that with PAT support |
---|
| 1710 | + enabled, even in this case there are restrictions on /dev/mem |
---|
| 1711 | + use due to the cache aliasing requirements. |
---|
| 1712 | + |
---|
| 1713 | + If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem |
---|
| 1714 | + file only allows userspace access to PCI space and the BIOS code and |
---|
| 1715 | + data regions. This is sufficient for dosemu and X and all common |
---|
| 1716 | + users of /dev/mem. |
---|
| 1717 | + |
---|
| 1718 | + If in doubt, say Y. |
---|
| 1719 | + |
---|
| 1720 | +config IO_STRICT_DEVMEM |
---|
| 1721 | + bool "Filter I/O access to /dev/mem" |
---|
| 1722 | + depends on STRICT_DEVMEM |
---|
| 1723 | + help |
---|
| 1724 | + If this option is disabled, you allow userspace (root) access to all |
---|
| 1725 | + io-memory regardless of whether a driver is actively using that |
---|
| 1726 | + range. Accidental access to this is obviously disastrous, but |
---|
| 1727 | + specific access can be used by people debugging kernel drivers. |
---|
| 1728 | + |
---|
| 1729 | + If this option is switched on, the /dev/mem file only allows |
---|
| 1730 | + userspace access to *idle* io-memory ranges (see /proc/iomem) This |
---|
| 1731 | + may break traditional users of /dev/mem (dosemu, legacy X, etc...) |
---|
| 1732 | + if the driver using a given range cannot be disabled. |
---|
| 1733 | + |
---|
| 1734 | + If in doubt, say Y. |
---|
| 1735 | + |
---|
| 1736 | +menu "$(SRCARCH) Debugging" |
---|
| 1737 | + |
---|
| 1738 | +source "arch/$(SRCARCH)/Kconfig.debug" |
---|
| 1739 | + |
---|
| 1740 | +endmenu |
---|
| 1741 | + |
---|
| 1742 | +menu "Kernel Testing and Coverage" |
---|
| 1743 | + |
---|
| 1744 | +source "lib/kunit/Kconfig" |
---|
1458 | 1745 | |
---|
1459 | 1746 | config NOTIFIER_ERROR_INJECTION |
---|
1460 | 1747 | tristate "Notifier error injection" |
---|
.. | .. |
---|
1532 | 1819 | If unsure, say N. |
---|
1533 | 1820 | |
---|
1534 | 1821 | config FUNCTION_ERROR_INJECTION |
---|
1535 | | - def_bool y |
---|
| 1822 | + bool "Fault-injections of functions" |
---|
1536 | 1823 | depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES |
---|
| 1824 | + help |
---|
| 1825 | + Add fault injections into various functions that are annotated with |
---|
| 1826 | + ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return |
---|
| 1827 | + value of theses functions. This is useful to test error paths of code. |
---|
| 1828 | + |
---|
| 1829 | + If unsure, say N |
---|
1537 | 1830 | |
---|
1538 | 1831 | config FAULT_INJECTION |
---|
1539 | 1832 | bool "Fault-injection framework" |
---|
.. | .. |
---|
1550 | 1843 | Provide fault-injection capability for kmalloc. |
---|
1551 | 1844 | |
---|
1552 | 1845 | config FAIL_PAGE_ALLOC |
---|
1553 | | - bool "Fault-injection capabilitiy for alloc_pages()" |
---|
| 1846 | + bool "Fault-injection capability for alloc_pages()" |
---|
1554 | 1847 | depends on FAULT_INJECTION |
---|
1555 | 1848 | help |
---|
1556 | 1849 | Provide fault-injection capability for alloc_pages(). |
---|
| 1850 | + |
---|
| 1851 | +config FAULT_INJECTION_USERCOPY |
---|
| 1852 | + bool "Fault injection capability for usercopy functions" |
---|
| 1853 | + depends on FAULT_INJECTION |
---|
| 1854 | + help |
---|
| 1855 | + Provides fault-injection capability to inject failures |
---|
| 1856 | + in usercopy functions (copy_from_user(), get_user(), ...). |
---|
1557 | 1857 | |
---|
1558 | 1858 | config FAIL_MAKE_REQUEST |
---|
1559 | 1859 | bool "Fault-injection capability for disk IO" |
---|
.. | .. |
---|
1610 | 1910 | depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT |
---|
1611 | 1911 | depends on !X86_64 |
---|
1612 | 1912 | select STACKTRACE |
---|
1613 | | - select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 |
---|
| 1913 | + depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 |
---|
1614 | 1914 | help |
---|
1615 | 1915 | Provide stacktrace filter for fault-injection capabilities |
---|
1616 | 1916 | |
---|
1617 | | -config LATENCYTOP |
---|
1618 | | - bool "Latency measuring infrastructure" |
---|
1619 | | - depends on DEBUG_KERNEL |
---|
1620 | | - depends on STACKTRACE_SUPPORT |
---|
1621 | | - depends on PROC_FS |
---|
1622 | | - select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 |
---|
1623 | | - select KALLSYMS |
---|
1624 | | - select KALLSYMS_ALL |
---|
1625 | | - select STACKTRACE |
---|
1626 | | - select SCHEDSTATS |
---|
1627 | | - select SCHED_DEBUG |
---|
| 1917 | +config ARCH_HAS_KCOV |
---|
| 1918 | + bool |
---|
1628 | 1919 | help |
---|
1629 | | - Enable this option if you want to use the LatencyTOP tool |
---|
1630 | | - to find out which userspace is blocking on what kernel operations. |
---|
| 1920 | + An architecture should select this when it can successfully |
---|
| 1921 | + build and run with CONFIG_KCOV. This typically requires |
---|
| 1922 | + disabling instrumentation for some early boot code. |
---|
1631 | 1923 | |
---|
1632 | | -source kernel/trace/Kconfig |
---|
| 1924 | +config CC_HAS_SANCOV_TRACE_PC |
---|
| 1925 | + def_bool $(cc-option,-fsanitize-coverage=trace-pc) |
---|
1633 | 1926 | |
---|
1634 | | -config PROVIDE_OHCI1394_DMA_INIT |
---|
1635 | | - bool "Remote debugging over FireWire early on boot" |
---|
1636 | | - depends on PCI && X86 |
---|
| 1927 | + |
---|
| 1928 | +config KCOV |
---|
| 1929 | + bool "Code coverage for fuzzing" |
---|
| 1930 | + depends on ARCH_HAS_KCOV |
---|
| 1931 | + depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS |
---|
| 1932 | + select DEBUG_FS |
---|
| 1933 | + select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC |
---|
| 1934 | + select SKB_EXTENSIONS if NET |
---|
1637 | 1935 | help |
---|
1638 | | - If you want to debug problems which hang or crash the kernel early |
---|
1639 | | - on boot and the crashing machine has a FireWire port, you can use |
---|
1640 | | - this feature to remotely access the memory of the crashed machine |
---|
1641 | | - over FireWire. This employs remote DMA as part of the OHCI1394 |
---|
1642 | | - specification which is now the standard for FireWire controllers. |
---|
| 1936 | + KCOV exposes kernel code coverage information in a form suitable |
---|
| 1937 | + for coverage-guided fuzzing (randomized testing). |
---|
1643 | 1938 | |
---|
1644 | | - With remote DMA, you can monitor the printk buffer remotely using |
---|
1645 | | - firescope and access all memory below 4GB using fireproxy from gdb. |
---|
1646 | | - Even controlling a kernel debugger is possible using remote DMA. |
---|
| 1939 | + If RANDOMIZE_BASE is enabled, PC values will not be stable across |
---|
| 1940 | + different machines and across reboots. If you need stable PC values, |
---|
| 1941 | + disable RANDOMIZE_BASE. |
---|
1647 | 1942 | |
---|
1648 | | - Usage: |
---|
| 1943 | + For more details, see Documentation/dev-tools/kcov.rst. |
---|
1649 | 1944 | |
---|
1650 | | - If ohci1394_dma=early is used as boot parameter, it will initialize |
---|
1651 | | - all OHCI1394 controllers which are found in the PCI config space. |
---|
1652 | | - |
---|
1653 | | - As all changes to the FireWire bus such as enabling and disabling |
---|
1654 | | - devices cause a bus reset and thereby disable remote DMA for all |
---|
1655 | | - devices, be sure to have the cable plugged and FireWire enabled on |
---|
1656 | | - the debugging host before booting the debug target for debugging. |
---|
1657 | | - |
---|
1658 | | - This code (~1k) is freed after boot. By then, the firewire stack |
---|
1659 | | - in charge of the OHCI-1394 controllers should be used instead. |
---|
1660 | | - |
---|
1661 | | - See Documentation/debugging-via-ohci1394.txt for more information. |
---|
1662 | | - |
---|
1663 | | -config DMA_API_DEBUG |
---|
1664 | | - bool "Enable debugging of DMA-API usage" |
---|
1665 | | - select NEED_DMA_MAP_STATE |
---|
| 1945 | +config KCOV_ENABLE_COMPARISONS |
---|
| 1946 | + bool "Enable comparison operands collection by KCOV" |
---|
| 1947 | + depends on KCOV |
---|
| 1948 | + depends on $(cc-option,-fsanitize-coverage=trace-cmp) |
---|
1666 | 1949 | help |
---|
1667 | | - Enable this option to debug the use of the DMA API by device drivers. |
---|
1668 | | - With this option you will be able to detect common bugs in device |
---|
1669 | | - drivers like double-freeing of DMA mappings or freeing mappings that |
---|
1670 | | - were never allocated. |
---|
| 1950 | + KCOV also exposes operands of every comparison in the instrumented |
---|
| 1951 | + code along with operand sizes and PCs of the comparison instructions. |
---|
| 1952 | + These operands can be used by fuzzing engines to improve the quality |
---|
| 1953 | + of fuzzing coverage. |
---|
1671 | 1954 | |
---|
1672 | | - This also attempts to catch cases where a page owned by DMA is |
---|
1673 | | - accessed by the cpu in a way that could cause data corruption. For |
---|
1674 | | - example, this enables cow_user_page() to check that the source page is |
---|
1675 | | - not undergoing DMA. |
---|
1676 | | - |
---|
1677 | | - This option causes a performance degradation. Use only if you want to |
---|
1678 | | - debug device drivers and dma interactions. |
---|
1679 | | - |
---|
1680 | | - If unsure, say N. |
---|
1681 | | - |
---|
1682 | | -config DMA_API_DEBUG_SG |
---|
1683 | | - bool "Debug DMA scatter-gather usage" |
---|
| 1955 | +config KCOV_INSTRUMENT_ALL |
---|
| 1956 | + bool "Instrument all code by default" |
---|
| 1957 | + depends on KCOV |
---|
1684 | 1958 | default y |
---|
1685 | | - depends on DMA_API_DEBUG |
---|
1686 | 1959 | help |
---|
1687 | | - Perform extra checking that callers of dma_map_sg() have respected the |
---|
1688 | | - appropriate segment length/boundary limits for the given device when |
---|
1689 | | - preparing DMA scatterlists. |
---|
| 1960 | + If you are doing generic system call fuzzing (like e.g. syzkaller), |
---|
| 1961 | + then you will want to instrument the whole kernel and you should |
---|
| 1962 | + say y here. If you are doing more targeted fuzzing (like e.g. |
---|
| 1963 | + filesystem fuzzing with AFL) then you will want to enable coverage |
---|
| 1964 | + for more specific subsets of files, and should say n here. |
---|
1690 | 1965 | |
---|
1691 | | - This is particularly likely to have been overlooked in cases where the |
---|
1692 | | - dma_map_sg() API is used for general bulk mapping of pages rather than |
---|
1693 | | - preparing literal scatter-gather descriptors, where there is a risk of |
---|
1694 | | - unexpected behaviour from DMA API implementations if the scatterlist |
---|
1695 | | - is technically out-of-spec. |
---|
1696 | | - |
---|
1697 | | - If unsure, say N. |
---|
| 1966 | +config KCOV_IRQ_AREA_SIZE |
---|
| 1967 | + hex "Size of interrupt coverage collection area in words" |
---|
| 1968 | + depends on KCOV |
---|
| 1969 | + default 0x40000 |
---|
| 1970 | + help |
---|
| 1971 | + KCOV uses preallocated per-cpu areas to collect coverage from |
---|
| 1972 | + soft interrupts. This specifies the size of those areas in the |
---|
| 1973 | + number of unsigned long words. |
---|
1698 | 1974 | |
---|
1699 | 1975 | menuconfig RUNTIME_TESTING_MENU |
---|
1700 | 1976 | bool "Runtime Testing" |
---|
.. | .. |
---|
1705 | 1981 | config LKDTM |
---|
1706 | 1982 | tristate "Linux Kernel Dump Test Tool Module" |
---|
1707 | 1983 | depends on DEBUG_FS |
---|
1708 | | - depends on BLOCK |
---|
1709 | 1984 | help |
---|
1710 | 1985 | This module enables testing of the different dumping mechanisms by |
---|
1711 | 1986 | inducing system failures at predefined crash points. |
---|
.. | .. |
---|
1714 | 1989 | called lkdtm. |
---|
1715 | 1990 | |
---|
1716 | 1991 | Documentation on how to use the module can be found in |
---|
1717 | | - Documentation/fault-injection/provoke-crashes.txt |
---|
| 1992 | + Documentation/fault-injection/provoke-crashes.rst |
---|
1718 | 1993 | |
---|
1719 | 1994 | config TEST_LIST_SORT |
---|
1720 | 1995 | tristate "Linked list sorting test" |
---|
1721 | 1996 | depends on DEBUG_KERNEL || m |
---|
1722 | 1997 | help |
---|
1723 | 1998 | Enable this to turn on 'list_sort()' function test. This test is |
---|
| 1999 | + executed only once during system boot (so affects only boot time), |
---|
| 2000 | + or at module load time. |
---|
| 2001 | + |
---|
| 2002 | + If unsure, say N. |
---|
| 2003 | + |
---|
| 2004 | +config TEST_MIN_HEAP |
---|
| 2005 | + tristate "Min heap test" |
---|
| 2006 | + depends on DEBUG_KERNEL || m |
---|
| 2007 | + help |
---|
| 2008 | + Enable this to turn on min heap function tests. This test is |
---|
1724 | 2009 | executed only once during system boot (so affects only boot time), |
---|
1725 | 2010 | or at module load time. |
---|
1726 | 2011 | |
---|
.. | .. |
---|
1767 | 2052 | A benchmark measuring the performance of the rbtree library. |
---|
1768 | 2053 | Also includes rbtree invariant checks. |
---|
1769 | 2054 | |
---|
| 2055 | +config REED_SOLOMON_TEST |
---|
| 2056 | + tristate "Reed-Solomon library test" |
---|
| 2057 | + depends on DEBUG_KERNEL || m |
---|
| 2058 | + select REED_SOLOMON |
---|
| 2059 | + select REED_SOLOMON_ENC16 |
---|
| 2060 | + select REED_SOLOMON_DEC16 |
---|
| 2061 | + help |
---|
| 2062 | + This option enables the self-test function of rslib at boot, |
---|
| 2063 | + or at module load time. |
---|
| 2064 | + |
---|
| 2065 | + If unsure, say N. |
---|
| 2066 | + |
---|
1770 | 2067 | config INTERVAL_TREE_TEST |
---|
1771 | 2068 | tristate "Interval tree test" |
---|
1772 | 2069 | depends on DEBUG_KERNEL |
---|
.. | .. |
---|
1795 | 2092 | tristate "Self test for hardware accelerated raid6 recovery" |
---|
1796 | 2093 | depends on ASYNC_RAID6_RECOV |
---|
1797 | 2094 | select ASYNC_MEMCPY |
---|
1798 | | - ---help--- |
---|
| 2095 | + help |
---|
1799 | 2096 | This is a one-shot self test that permutes through the |
---|
1800 | 2097 | recovery of all the possible two disk failure scenarios for a |
---|
1801 | 2098 | N-disk array. Recovery is performed with the asynchronous |
---|
.. | .. |
---|
1810 | 2107 | config TEST_STRING_HELPERS |
---|
1811 | 2108 | tristate "Test functions located in the string_helpers module at runtime" |
---|
1812 | 2109 | |
---|
| 2110 | +config TEST_STRSCPY |
---|
| 2111 | + tristate "Test strscpy*() family of functions at runtime" |
---|
| 2112 | + |
---|
1813 | 2113 | config TEST_KSTRTOX |
---|
1814 | 2114 | tristate "Test kstrto*() family of functions at runtime" |
---|
1815 | 2115 | |
---|
.. | .. |
---|
1823 | 2123 | |
---|
1824 | 2124 | If unsure, say N. |
---|
1825 | 2125 | |
---|
1826 | | -config TEST_BITFIELD |
---|
1827 | | - tristate "Test bitfield functions at runtime" |
---|
1828 | | - help |
---|
1829 | | - Enable this option to test the bitfield functions at boot. |
---|
1830 | | - |
---|
1831 | | - If unsure, say N. |
---|
1832 | | - |
---|
1833 | 2126 | config TEST_UUID |
---|
1834 | 2127 | tristate "Test functions located in the uuid module at runtime" |
---|
| 2128 | + |
---|
| 2129 | +config TEST_XARRAY |
---|
| 2130 | + tristate "Test the XArray code at runtime" |
---|
1835 | 2131 | |
---|
1836 | 2132 | config TEST_OVERFLOW |
---|
1837 | 2133 | tristate "Test check_*_overflow() functions at runtime" |
---|
.. | .. |
---|
1865 | 2161 | |
---|
1866 | 2162 | If unsure, say N. |
---|
1867 | 2163 | |
---|
| 2164 | +config TEST_IRQ_TIMINGS |
---|
| 2165 | + bool "IRQ timings selftest" |
---|
| 2166 | + depends on IRQ_TIMINGS |
---|
| 2167 | + help |
---|
| 2168 | + Enable this option to test the irq timings code on boot. |
---|
| 2169 | + |
---|
| 2170 | + If unsure, say N. |
---|
| 2171 | + |
---|
1868 | 2172 | config TEST_LKM |
---|
1869 | 2173 | tristate "Test module loading with 'hello world' module" |
---|
1870 | 2174 | depends on m |
---|
.. | .. |
---|
1875 | 2179 | validating module verification). It lacks any extra dependencies, |
---|
1876 | 2180 | and will not normally be loaded by the system unless explicitly |
---|
1877 | 2181 | requested by name. |
---|
| 2182 | + |
---|
| 2183 | + If unsure, say N. |
---|
| 2184 | + |
---|
| 2185 | +config TEST_BITOPS |
---|
| 2186 | + tristate "Test module for compilation of bitops operations" |
---|
| 2187 | + depends on m |
---|
| 2188 | + help |
---|
| 2189 | + This builds the "test_bitops" module that is much like the |
---|
| 2190 | + TEST_LKM module except that it does a basic exercise of the |
---|
| 2191 | + set/clear_bit macros and get_count_order/long to make sure there are |
---|
| 2192 | + no compiler warnings from C=1 sparse checker or -Wextra |
---|
| 2193 | + compilations. It has no dependencies and doesn't run or load unless |
---|
| 2194 | + explicitly requested by name. for example: modprobe test_bitops. |
---|
| 2195 | + |
---|
| 2196 | + If unsure, say N. |
---|
| 2197 | + |
---|
| 2198 | +config TEST_VMALLOC |
---|
| 2199 | + tristate "Test module for stress/performance analysis of vmalloc allocator" |
---|
| 2200 | + default n |
---|
| 2201 | + depends on MMU |
---|
| 2202 | + depends on m |
---|
| 2203 | + help |
---|
| 2204 | + This builds the "test_vmalloc" module that should be used for |
---|
| 2205 | + stress and performance analysis. So, any new change for vmalloc |
---|
| 2206 | + subsystem can be evaluated from performance and stability point |
---|
| 2207 | + of view. |
---|
1878 | 2208 | |
---|
1879 | 2209 | If unsure, say N. |
---|
1880 | 2210 | |
---|
.. | .. |
---|
1900 | 2230 | development, but also to run regression tests against changes in |
---|
1901 | 2231 | the interpreter code. It also enables test stubs for eBPF maps and |
---|
1902 | 2232 | verifier used by user space verifier testsuite. |
---|
| 2233 | + |
---|
| 2234 | + If unsure, say N. |
---|
| 2235 | + |
---|
| 2236 | +config TEST_BLACKHOLE_DEV |
---|
| 2237 | + tristate "Test blackhole netdev functionality" |
---|
| 2238 | + depends on m && NET |
---|
| 2239 | + help |
---|
| 2240 | + This builds the "test_blackhole_dev" module that validates the |
---|
| 2241 | + data path through this blackhole netdev. |
---|
1903 | 2242 | |
---|
1904 | 2243 | If unsure, say N. |
---|
1905 | 2244 | |
---|
.. | .. |
---|
1933 | 2272 | |
---|
1934 | 2273 | If unsure, say N. |
---|
1935 | 2274 | |
---|
| 2275 | +config BITFIELD_KUNIT |
---|
| 2276 | + tristate "KUnit test bitfield functions at runtime" |
---|
| 2277 | + depends on KUNIT |
---|
| 2278 | + help |
---|
| 2279 | + Enable this option to test the bitfield functions at boot. |
---|
| 2280 | + |
---|
| 2281 | + KUnit tests run during boot and output the results to the debug log |
---|
| 2282 | + in TAP format (http://testanything.org/). Only useful for kernel devs |
---|
| 2283 | + running the KUnit test harness, and not intended for inclusion into a |
---|
| 2284 | + production build. |
---|
| 2285 | + |
---|
| 2286 | + For more information on KUnit and unit tests in general please refer |
---|
| 2287 | + to the KUnit documentation in Documentation/dev-tools/kunit/. |
---|
| 2288 | + |
---|
| 2289 | + If unsure, say N. |
---|
| 2290 | + |
---|
| 2291 | +config SYSCTL_KUNIT_TEST |
---|
| 2292 | + tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS |
---|
| 2293 | + depends on KUNIT |
---|
| 2294 | + default KUNIT_ALL_TESTS |
---|
| 2295 | + help |
---|
| 2296 | + This builds the proc sysctl unit test, which runs on boot. |
---|
| 2297 | + Tests the API contract and implementation correctness of sysctl. |
---|
| 2298 | + For more information on KUnit and unit tests in general please refer |
---|
| 2299 | + to the KUnit documentation in Documentation/dev-tools/kunit/. |
---|
| 2300 | + |
---|
| 2301 | + If unsure, say N. |
---|
| 2302 | + |
---|
| 2303 | +config LIST_KUNIT_TEST |
---|
| 2304 | + tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS |
---|
| 2305 | + depends on KUNIT |
---|
| 2306 | + default KUNIT_ALL_TESTS |
---|
| 2307 | + help |
---|
| 2308 | + This builds the linked list KUnit test suite. |
---|
| 2309 | + It tests that the API and basic functionality of the list_head type |
---|
| 2310 | + and associated macros. |
---|
| 2311 | + |
---|
| 2312 | + KUnit tests run during boot and output the results to the debug log |
---|
| 2313 | + in TAP format (https://testanything.org/). Only useful for kernel devs |
---|
| 2314 | + running the KUnit test harness, and not intended for inclusion into a |
---|
| 2315 | + production build. |
---|
| 2316 | + |
---|
| 2317 | + For more information on KUnit and unit tests in general please refer |
---|
| 2318 | + to the KUnit documentation in Documentation/dev-tools/kunit/. |
---|
| 2319 | + |
---|
| 2320 | + If unsure, say N. |
---|
| 2321 | + |
---|
| 2322 | +config LINEAR_RANGES_TEST |
---|
| 2323 | + tristate "KUnit test for linear_ranges" |
---|
| 2324 | + depends on KUNIT |
---|
| 2325 | + select LINEAR_RANGES |
---|
| 2326 | + help |
---|
| 2327 | + This builds the linear_ranges unit test, which runs on boot. |
---|
| 2328 | + Tests the linear_ranges logic correctness. |
---|
| 2329 | + For more information on KUnit and unit tests in general please refer |
---|
| 2330 | + to the KUnit documentation in Documentation/dev-tools/kunit/. |
---|
| 2331 | + |
---|
| 2332 | + If unsure, say N. |
---|
| 2333 | + |
---|
| 2334 | +config BITS_TEST |
---|
| 2335 | + tristate "KUnit test for bits.h" |
---|
| 2336 | + depends on KUNIT |
---|
| 2337 | + help |
---|
| 2338 | + This builds the bits unit test. |
---|
| 2339 | + Tests the logic of macros defined in bits.h. |
---|
| 2340 | + For more information on KUnit and unit tests in general please refer |
---|
| 2341 | + to the KUnit documentation in Documentation/dev-tools/kunit/. |
---|
| 2342 | + |
---|
| 2343 | + If unsure, say N. |
---|
| 2344 | + |
---|
1936 | 2345 | config TEST_UDELAY |
---|
1937 | 2346 | tristate "udelay test driver" |
---|
1938 | 2347 | help |
---|
.. | .. |
---|
1952 | 2361 | config TEST_KMOD |
---|
1953 | 2362 | tristate "kmod stress tester" |
---|
1954 | 2363 | depends on m |
---|
1955 | | - depends on BLOCK && (64BIT || LBDAF) # for XFS, BTRFS |
---|
1956 | 2364 | depends on NETDEVICES && NET_CORE && INET # for TUN |
---|
1957 | 2365 | depends on BLOCK |
---|
1958 | 2366 | select TEST_LKM |
---|
.. | .. |
---|
1986 | 2394 | |
---|
1987 | 2395 | If unsure, say N. |
---|
1988 | 2396 | |
---|
1989 | | -config TEST_MEMINIT |
---|
1990 | | - tristate "Test heap/page initialization" |
---|
| 2397 | +config TEST_MEMCAT_P |
---|
| 2398 | + tristate "Test memcat_p() helper function" |
---|
1991 | 2399 | help |
---|
1992 | | - Test if the kernel is zero-initializing heap and page allocations. |
---|
1993 | | - This can be useful to test init_on_alloc and init_on_free features. |
---|
| 2400 | + Test the memcat_p() helper for correctly merging two |
---|
| 2401 | + pointer arrays together. |
---|
1994 | 2402 | |
---|
1995 | 2403 | If unsure, say N. |
---|
| 2404 | + |
---|
| 2405 | +config TEST_LIVEPATCH |
---|
| 2406 | + tristate "Test livepatching" |
---|
| 2407 | + default n |
---|
| 2408 | + depends on DYNAMIC_DEBUG |
---|
| 2409 | + depends on LIVEPATCH |
---|
| 2410 | + depends on m |
---|
| 2411 | + help |
---|
| 2412 | + Test kernel livepatching features for correctness. The tests will |
---|
| 2413 | + load test modules that will be livepatched in various scenarios. |
---|
| 2414 | + |
---|
| 2415 | + To run all the livepatching tests: |
---|
| 2416 | + |
---|
| 2417 | + make -C tools/testing/selftests TARGETS=livepatch run_tests |
---|
| 2418 | + |
---|
| 2419 | + Alternatively, individual tests may be invoked: |
---|
| 2420 | + |
---|
| 2421 | + tools/testing/selftests/livepatch/test-callbacks.sh |
---|
| 2422 | + tools/testing/selftests/livepatch/test-livepatch.sh |
---|
| 2423 | + tools/testing/selftests/livepatch/test-shadow-vars.sh |
---|
| 2424 | + |
---|
| 2425 | + If unsure, say N. |
---|
| 2426 | + |
---|
| 2427 | +config TEST_OBJAGG |
---|
| 2428 | + tristate "Perform selftest on object aggreration manager" |
---|
| 2429 | + default n |
---|
| 2430 | + depends on OBJAGG |
---|
| 2431 | + help |
---|
| 2432 | + Enable this option to test object aggregation manager on boot |
---|
| 2433 | + (or module load). |
---|
| 2434 | + |
---|
1996 | 2435 | |
---|
1997 | 2436 | config TEST_STACKINIT |
---|
1998 | 2437 | tristate "Test level of stack variable initialization" |
---|
.. | .. |
---|
2004 | 2443 | |
---|
2005 | 2444 | If unsure, say N. |
---|
2006 | 2445 | |
---|
| 2446 | +config TEST_MEMINIT |
---|
| 2447 | + tristate "Test heap/page initialization" |
---|
| 2448 | + help |
---|
| 2449 | + Test if the kernel is zero-initializing heap and page allocations. |
---|
| 2450 | + This can be useful to test init_on_alloc and init_on_free features. |
---|
| 2451 | + |
---|
| 2452 | + If unsure, say N. |
---|
| 2453 | + |
---|
| 2454 | +config TEST_HMM |
---|
| 2455 | + tristate "Test HMM (Heterogeneous Memory Management)" |
---|
| 2456 | + depends on TRANSPARENT_HUGEPAGE |
---|
| 2457 | + depends on DEVICE_PRIVATE |
---|
| 2458 | + select HMM_MIRROR |
---|
| 2459 | + select MMU_NOTIFIER |
---|
| 2460 | + help |
---|
| 2461 | + This is a pseudo device driver solely for testing HMM. |
---|
| 2462 | + Say M here if you want to build the HMM test module. |
---|
| 2463 | + Doing so will allow you to run tools/testing/selftest/vm/hmm-tests. |
---|
| 2464 | + |
---|
| 2465 | + If unsure, say N. |
---|
| 2466 | + |
---|
| 2467 | +config TEST_FREE_PAGES |
---|
| 2468 | + tristate "Test freeing pages" |
---|
| 2469 | + help |
---|
| 2470 | + Test that a memory leak does not occur due to a race between |
---|
| 2471 | + freeing a block of pages and a speculative page reference. |
---|
| 2472 | + Loading this module is safe if your kernel has the bug fixed. |
---|
| 2473 | + If the bug is not fixed, it will leak gigabytes of memory and |
---|
| 2474 | + probably OOM your system. |
---|
| 2475 | + |
---|
| 2476 | +config TEST_FPU |
---|
| 2477 | + tristate "Test floating point operations in kernel space" |
---|
| 2478 | + depends on X86 && !KCOV_INSTRUMENT_ALL |
---|
| 2479 | + help |
---|
| 2480 | + Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu |
---|
| 2481 | + which will trigger a sequence of floating point operations. This is used |
---|
| 2482 | + for self-testing floating point control register setting in |
---|
| 2483 | + kernel_fpu_begin(). |
---|
| 2484 | + |
---|
| 2485 | + If unsure, say N. |
---|
| 2486 | + |
---|
2007 | 2487 | endif # RUNTIME_TESTING_MENU |
---|
2008 | 2488 | |
---|
2009 | 2489 | config MEMTEST |
---|
2010 | 2490 | bool "Memtest" |
---|
2011 | | - depends on HAVE_MEMBLOCK |
---|
2012 | | - ---help--- |
---|
| 2491 | + help |
---|
2013 | 2492 | This option adds a kernel parameter 'memtest', which allows memtest |
---|
2014 | 2493 | to be set. |
---|
2015 | 2494 | memtest=0, mean disabled; -- default |
---|
.. | .. |
---|
2018 | 2497 | memtest=17, mean do 17 test patterns. |
---|
2019 | 2498 | If you are unsure how to answer this question, answer N. |
---|
2020 | 2499 | |
---|
2021 | | -config BUG_ON_DATA_CORRUPTION |
---|
2022 | | - bool "Trigger a BUG when data corruption is detected" |
---|
2023 | | - select DEBUG_LIST |
---|
| 2500 | + |
---|
| 2501 | + |
---|
| 2502 | +config HYPERV_TESTING |
---|
| 2503 | + bool "Microsoft Hyper-V driver testing" |
---|
| 2504 | + default n |
---|
| 2505 | + depends on HYPERV && DEBUG_FS |
---|
2024 | 2506 | help |
---|
2025 | | - Select this option if the kernel should BUG when it encounters |
---|
2026 | | - data corruption in kernel memory structures when they get checked |
---|
2027 | | - for validity. |
---|
| 2507 | + Select this option to enable Hyper-V vmbus testing. |
---|
2028 | 2508 | |
---|
2029 | | - If unsure, say N. |
---|
| 2509 | +endmenu # "Kernel Testing and Coverage" |
---|
2030 | 2510 | |
---|
2031 | | -source "samples/Kconfig" |
---|
2032 | | - |
---|
2033 | | -source "lib/Kconfig.kgdb" |
---|
2034 | | - |
---|
2035 | | -source "lib/Kconfig.ubsan" |
---|
2036 | | - |
---|
2037 | | -config ARCH_HAS_DEVMEM_IS_ALLOWED |
---|
2038 | | - bool |
---|
2039 | | - |
---|
2040 | | -config STRICT_DEVMEM |
---|
2041 | | - bool "Filter access to /dev/mem" |
---|
2042 | | - depends on MMU && DEVMEM |
---|
2043 | | - depends on ARCH_HAS_DEVMEM_IS_ALLOWED |
---|
2044 | | - default y if PPC || X86 || ARM64 |
---|
2045 | | - ---help--- |
---|
2046 | | - If this option is disabled, you allow userspace (root) access to all |
---|
2047 | | - of memory, including kernel and userspace memory. Accidental |
---|
2048 | | - access to this is obviously disastrous, but specific access can |
---|
2049 | | - be used by people debugging the kernel. Note that with PAT support |
---|
2050 | | - enabled, even in this case there are restrictions on /dev/mem |
---|
2051 | | - use due to the cache aliasing requirements. |
---|
2052 | | - |
---|
2053 | | - If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem |
---|
2054 | | - file only allows userspace access to PCI space and the BIOS code and |
---|
2055 | | - data regions. This is sufficient for dosemu and X and all common |
---|
2056 | | - users of /dev/mem. |
---|
2057 | | - |
---|
2058 | | - If in doubt, say Y. |
---|
2059 | | - |
---|
2060 | | -config IO_STRICT_DEVMEM |
---|
2061 | | - bool "Filter I/O access to /dev/mem" |
---|
2062 | | - depends on STRICT_DEVMEM |
---|
2063 | | - ---help--- |
---|
2064 | | - If this option is disabled, you allow userspace (root) access to all |
---|
2065 | | - io-memory regardless of whether a driver is actively using that |
---|
2066 | | - range. Accidental access to this is obviously disastrous, but |
---|
2067 | | - specific access can be used by people debugging kernel drivers. |
---|
2068 | | - |
---|
2069 | | - If this option is switched on, the /dev/mem file only allows |
---|
2070 | | - userspace access to *idle* io-memory ranges (see /proc/iomem) This |
---|
2071 | | - may break traditional users of /dev/mem (dosemu, legacy X, etc...) |
---|
2072 | | - if the driver using a given range cannot be disabled. |
---|
2073 | | - |
---|
2074 | | - If in doubt, say Y. |
---|
2075 | | - |
---|
2076 | | -source "arch/$(SRCARCH)/Kconfig.debug" |
---|
| 2511 | +source "Documentation/Kconfig" |
---|
2077 | 2512 | |
---|
2078 | 2513 | endmenu # Kernel hacking |
---|