From nobody Tue Apr 23 21:43:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VPFwr66Dqz5J7yF; Tue, 23 Apr 2024 21:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VPFwr436Zz4vFM; Tue, 23 Apr 2024 21:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713908604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyerBt/sub8WEl5aRdEXy1wy1oQfOHqkfF+0a9FUuRE=; b=P7G3WDr8+Jm+1OGpir9S3s+L+ByRavxFgZ+7yPCC0MVw42aQChu8skgfoA7q6zbYkSTr1n /pJryYTu3S5o5I6ocO1lhSqCkM56706dlM91c9hPJAcNTbwbZXDPQ/LrPfWm2bODKxuW07 QXdiJjosHX3cGEV1054QTBPF4s0EZCJj+lXBwTcjDaTX2QYGe8I54oRLoR27ntftYsf28G yxHqgJztUXIFuXZeOzP94956qdFfsj4IsCQImqyM/U3oq5tpK7nM5rsUK+BAziVg4ktcie lj/d5osfRZlkkpV+XvzEJ3HLyQPP/rufMEZfzCAJX7hw9MGDPzSzR2s5+NRHHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713908604; a=rsa-sha256; cv=none; b=LDbJ+fsIbFi51/gjKG/kTAMeiGbcaOBgghq/9YaNMn4yiI4XQKOlN4HPxFRxGYXyVo/MGc e410fra7z8Ig0n9M5WbqxSrWXvPT9VXaGuTQ067Toi7Gak84Sc+dwIcXEcwLOzqIBMkkjG A3mx7zHKuHBrQeiU8UBJmrh7Xh7OmE0n21vxrs9doMpLzIhWPCcUAkKo+KRD/znBn8113t l33gcCWb651V+16xbJbtbdXyZXge3VRDOBTKVbd4XDSssgPBv46SkxItpB2mF4eyV/W8+6 aqIfH+34GE8an/YPAknYBMLyQYm3/IogTfRTec9c6bsFDSmDSGPkA/uIWL7w9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713908604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyerBt/sub8WEl5aRdEXy1wy1oQfOHqkfF+0a9FUuRE=; b=vIk0L9sfN8bCv7vNmnfSsLHqRRv4Nb1ZCZNEOMhqnTktKWonP5pshYuJvN0fFCmYELiMXs JyOdDCD7L0Pp5AvblKXON0eQrWMtelrsG7We5yQv0X9VGNOb/UpknZrIM6EfOjM8OWWkef /NPKYlo//20r87pSdYFCIb981hrrD8yo82M9DRJuuzLNsbIwIv9xPmZuDcacgeKGx71RMw ++y0QJUlfPQ0NEUh+n8GUjnf7sTCWD+Vr1mnzyBUFo8ANSMzKBhUyeWFgv+z0S9UnC8k/0 l9TLI3rkvFPYlzIKLZ2BxN3vOMzGSDbW0jeeGKEzNowbm9xBIVrILqbbmLQhiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VPFwr3ccVzpW8; Tue, 23 Apr 2024 21:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43NLhOLv080008; Tue, 23 Apr 2024 21:43:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43NLhOd0080005; Tue, 23 Apr 2024 21:43:24 GMT (envelope-from git) Date: Tue, 23 Apr 2024 21:43:24 GMT Message-Id: <202404232143.43NLhOd0080005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4f8f9d708e6a - main - sys: add conf/std.debug, generic debugging options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f8f9d708e6a4143f3b178bfab10d0a9b75ba2fe Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f8f9d708e6a4143f3b178bfab10d0a9b75ba2fe commit 4f8f9d708e6a4143f3b178bfab10d0a9b75ba2fe Author: Lexi Winter AuthorDate: 2024-04-23 21:11:24 +0000 Commit: Warner Losh CommitDate: 2024-04-23 21:13:31 +0000 sys: add conf/std.debug, generic debugging options The new sys/conf/std.debug contains the list of debugging options enabled by default in -CURRENT, so they don't need to be listed individually in every kernel config. The enabled options are the set of all debug options which were enabled for the GENERIC kernel on any platform. This means some architectures now have debugging options enabled in GENERIC which weren't previously enabled: - amd64: [1] - arm64: [2] - arm: [2]. [3] - i386: [1], [2] - powerpc: [1], [2], [3] - riscv: [2] [1] ALT_BREAK_TO_DEBUGGER is now enabled. [2] BUF_TRACKING, FULL_BUF_TRACKING, and QUEUE_MACRO_DEBUG_TRASH are now enabled. [3] DEADLKRES is now enabled. While here, move the documentation for the (commented out) K*SAN options for amd64 from GENERIC to NOTES. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1124 --- sys/amd64/conf/GENERIC | 20 +------------------- sys/amd64/conf/MINIMAL | 2 ++ sys/amd64/conf/MINIMAL-NODEBUG | 11 +++++++++++ sys/amd64/conf/NOTES | 12 ++++++++++++ sys/arm/conf/std.armv6 | 14 +++----------- sys/arm/conf/std.armv7 | 14 +++----------- sys/arm64/conf/std.arm64 | 11 +---------- sys/conf/std.debug | 17 +++++++++++++++++ sys/i386/conf/GENERIC | 10 +--------- sys/i386/conf/MINIMAL | 2 ++ sys/i386/conf/MINIMAL-NODEBUG | 11 +++++++++++ sys/powerpc/conf/GENERIC | 9 +-------- sys/powerpc/conf/GENERIC64 | 9 +-------- sys/powerpc/conf/GENERIC64LE | 9 +-------- sys/riscv/conf/GENERIC | 11 +---------- 15 files changed, 68 insertions(+), 94 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index f11601891efd..a49a5c006d77 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -94,25 +94,7 @@ options RCTL # Resource limits options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options BUF_TRACKING # Track buffer history -options DDB # Support DDB. -options FULL_BUF_TRACKING # Track more buffer history -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default - -# Kernel Sanitizers -#options COVERAGE # Generic kernel coverage. Used by KCOV -#options KCOV # Kernel Coverage Sanitizer -# Warning: KUBSAN can result in a kernel too large for loader to load -#options KUBSAN # Kernel Undefined Behavior Sanitizer -#options KCSAN # Kernel Concurrency Sanitizer +include ../../conf/std.debug # Kernel dump features. options EKCD # Support for encrypted kernel dumps diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index fb6d75a2ae1a..c413590586e6 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -78,6 +78,8 @@ options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use (turn off in stable branch): +include ../../conf/std.debug # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel diff --git a/sys/amd64/conf/MINIMAL-NODEBUG b/sys/amd64/conf/MINIMAL-NODEBUG new file mode 100644 index 000000000000..35281b2212d9 --- /dev/null +++ b/sys/amd64/conf/MINIMAL-NODEBUG @@ -0,0 +1,11 @@ +# +# MINIMAL-NODEBUG -- Non-debug MINIMAL kernel. +# +# This is the MINIMAL equivalent to GENERIC-NODEBUG. + +#NO_UNIVERSE + +include MINIMAL +include "../../conf/std.nodebug" + +ident MINIMAL-NODEBUG diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index 31db96e6d0e2..a6f12aec7dc8 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -159,3 +159,15 @@ options KSTACK_PAGES=5 # Enable detailed accounting by the PV entry allocator. options PV_STATS + +##################################################################### +# Kernel sanitizers + +#options COVERAGE # Generic kernel coverage. Used by KCOV +#options KCOV # Kernel Coverage Sanitizer +# Warning: KUBSAN can result in a kernel too large for loader to load +#options KUBSAN # Kernel Undefined Behavior Sanitizer +#options KCSAN # Kernel Concurrency Sanitizer +#options KASAN # Kernel Address Sanitizer +#options KCSAN # Kernel Concurrency Sanitizer +#options KMSAN # Kernel Memory Sanitizer diff --git a/sys/arm/conf/std.armv6 b/sys/arm/conf/std.armv6 index b4b83d66809a..9ae37eab90d5 100644 --- a/sys/arm/conf/std.armv6 +++ b/sys/arm/conf/std.armv6 @@ -63,18 +63,10 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. +options USB_DEBUG # Enable usb debug support code + # For full debugger support use (turn off in stable branch): -options DDB # Support DDB -options GDB # Support remote GDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Optional extras, never enabled by default: #options BOOTVERBOSE diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index 80b4e898bfdc..72f22efd0c28 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -63,18 +63,10 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. +options USB_DEBUG # Enable usb debug support code + # For full debugger support use (turn off in stable branch): -options DDB # Support DDB -options GDB # Support remote GDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options USB_DEBUG # Enable usb debug support code -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Optional extras, never enabled by default: #options BOOTVERBOSE diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 1b6b0e8b1812..cb3c591947fc 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -73,16 +73,7 @@ options PERTHREAD_SSP # Per-thread SSP canary options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Kernel Sanitizers #options COVERAGE # Generic kernel coverage. Used by KCOV diff --git a/sys/conf/std.debug b/sys/conf/std.debug new file mode 100644 index 000000000000..53789f269b80 --- /dev/null +++ b/sys/conf/std.debug @@ -0,0 +1,17 @@ +# +# std.debug -- Enable debug options for -CURRENT. +# + +options BUF_TRACKING # Track buffer history +options DDB # Support DDB. +options FULL_BUF_TRACKING # Track more buffer history +options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index b5898ed94b81..7bd01d4e60e7 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -88,15 +88,7 @@ options RCTL # Resource limits options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Kernel dump features. options EKCD # Support for encrypted kernel dumps diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index e27bb68e31fe..b29a179d2bdf 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -86,6 +86,8 @@ options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use (turn off in stable branch): +include ../../conf/std.debug # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel diff --git a/sys/i386/conf/MINIMAL-NODEBUG b/sys/i386/conf/MINIMAL-NODEBUG new file mode 100644 index 000000000000..35281b2212d9 --- /dev/null +++ b/sys/i386/conf/MINIMAL-NODEBUG @@ -0,0 +1,11 @@ +# +# MINIMAL-NODEBUG -- Non-debug MINIMAL kernel. +# +# This is the MINIMAL equivalent to GENERIC-NODEBUG. + +#NO_UNIVERSE + +include MINIMAL +include "../../conf/std.nodebug" + +ident MINIMAL-NODEBUG diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index 47c84956facd..bb7865301fcb 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -91,14 +91,7 @@ options RCTL # Resource limits options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Kernel dump features. options EKCD # Support for encrypted kernel dumps diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 9d2de9c8095b..b077cf3f2feb 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -101,14 +101,7 @@ options RCTL # Resource limits options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Kernel dump features. options EKCD # Support for encrypted kernel dumps diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 6ca1a01e5969..f090cd47ecf8 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -97,14 +97,7 @@ options RCTL # Resource limits options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +include ../../conf/std.debug # Kernel dump features. options EKCD # Support for encrypted kernel dumps diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index ca71f7423cfa..52edc01b5c89 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -156,17 +156,8 @@ device spigen options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence +include "std.debug" # options EARLY_PRINTF=sbi -options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps