target: Make TARGET_SERIAL independent of GRUB configuration
[openwrt/staging/jow.git] / config / Config-kernel.in
index 500f72672d1f27a8fb49f5384c9d6390cd368477..4c43190e40df5e9df12f83857bdb41250e700006 100644 (file)
@@ -47,6 +47,7 @@ config KERNEL_MIPS_FP_SUPPORT
 
 config KERNEL_ARM_PMU
        bool
+       default y if TARGET_armsr_armv8
        depends on (arm || aarch64)
 
 config KERNEL_X86_VSYSCALL_EMULATION
@@ -184,16 +185,73 @@ config KERNEL_KASAN_VMALLOC
          will have no effect.
 
 if KERNEL_KASAN
-       config KERNEL_KASAN_GENERIC
-       def_bool y
+choice
+       prompt "KASAN mode"
+       depends on KERNEL_KASAN
+       default KERNEL_KASAN_GENERIC
+       help
+         KASAN has three modes:
+
+         1. Generic KASAN (supported by many architectures, enabled with
+            CONFIG_KASAN_GENERIC, similar to userspace ASan),
+         2. Software Tag-Based KASAN (arm64 only, based on software memory
+            tagging, enabled with CONFIG_KASAN_SW_TAGS, similar to userspace
+            HWASan), and
+         3. Hardware Tag-Based KASAN (arm64 only, based on hardware memory
+            tagging, enabled with CONFIG_KASAN_HW_TAGS).
+
+config KERNEL_KASAN_GENERIC
+       bool "Generic KASAN"
+       select KERNEL_SLUB_DEBUG
+       help
+         Enables Generic KASAN.
+
+         Consumes about 1/8th of available memory at kernel start and adds an
+         overhead of ~50% for dynamic allocations.
+         The performance slowdown is ~x3.
+
+config KERNEL_KASAN_SW_TAGS
+       bool "Software Tag-Based KASAN"
+       depends on aarch64
+       select KERNEL_SLUB_DEBUG
+       help
+         Enables Software Tag-Based KASAN.
+
+         Supported only on arm64 CPUs and relies on Top Byte Ignore.
+
+         Consumes about 1/16th of available memory at kernel start and
+         add an overhead of ~20% for dynamic allocations.
+
+         May potentially introduce problems related to pointer casting and
+         comparison, as it embeds a tag into the top byte of each pointer.
+
+config KERNEL_KASAN_HW_TAGS
+       bool "Hardware Tag-Based KASAN"
+       depends on aarch64
+       select KERNEL_SLUB_DEBUG
+       select KERNEL_ARM64_MTE
+       help
+         Enables Hardware Tag-Based KASAN.
+
+         Supported only on arm64 CPUs starting from ARMv8.5 and relies on
+         Memory Tagging Extension and Top Byte Ignore.
+
+         Consumes about 1/32nd of available memory.
+
+         May potentially introduce problems related to pointer casting and
+         comparison, as it embeds a tag into the top byte of each pointer.
+
+endchoice
+
+       config KERNEL_ARM64_MTE
+               def_bool n
 
-       config KERNEL_KASAN_SW_TAGS
-       def_bool n
 endif
 
 choice
        prompt "Instrumentation type"
        depends on KERNEL_KASAN
+       depends on !KERNEL_KASAN_HW_TAGS
        default KERNEL_KASAN_OUTLINE
 
 config KERNEL_KASAN_OUTLINE
@@ -373,6 +431,16 @@ config KERNEL_DEBUG_INFO_BTF
 
          Required to run BPF CO-RE applications.
 
+config KERNEL_MODULE_ALLOW_BTF_MISMATCH
+       bool "Allow loading modules with non-matching BTF type info"
+       depends on KERNEL_DEBUG_INFO_BTF
+       help
+         For modules whose split BTF does not match vmlinux, load without
+         BTF rather than refusing to load. The default behavior with
+         module BTF enabled is to reject modules with such mismatches;
+         this option will still load module BTF where possible but ignore
+         it when a mismatch is found.
+
 config KERNEL_DEBUG_INFO_REDUCED
        bool "Reduce debugging information"
        default y
@@ -387,12 +455,29 @@ config KERNEL_DEBUG_INFO_REDUCED
          DEBUG_INFO build and compile times are reduced too.
          Only works with newer gcc versions.
 
+config KERNEL_FRAME_WARN
+       int
+       range 0 8192
+       default 1280 if KERNEL_KASAN && !ARCH_64BIT
+       default 1024 if !ARCH_64BIT
+       default 2048 if ARCH_64BIT
+       help
+         Tell the compiler to warn at build time for stack frames larger than this.
+         Setting this too low will cause a lot of warnings.
+         Setting it to 0 disables the warning.
+
+# KERNEL_DEBUG_LL symbols must have the default value set as otherwise
+# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected
+# which means that buildroot wont override the DEBUG_LL symbols in target
+# kernel configurations and lead to devices that dont have working console
 config KERNEL_DEBUG_LL_UART_NONE
        bool
+       default n
        depends on arm
 
 config KERNEL_DEBUG_LL
        bool
+       default n
        depends on arm
        select KERNEL_DEBUG_LL_UART_NONE
        help
@@ -455,6 +540,7 @@ config KERNEL_BPF_EVENTS
 config KERNEL_BPF_KPROBE_OVERRIDE
        bool
        depends on KERNEL_KPROBES
+       default n
 
 config KERNEL_AIO
        bool "Compile the kernel with asynchronous IO support"
@@ -462,7 +548,8 @@ config KERNEL_AIO
 
 config KERNEL_IO_URING
        bool "Compile the kernel with io_uring support"
-       default y if !SMALL_FLASH
+       depends on !SMALL_FLASH
+       default y if (x86_64 || aarch64)
 
 config KERNEL_FHANDLE
        bool "Compile the kernel with support for fhandle syscalls"
@@ -534,6 +621,18 @@ config KERNEL_SOFTLOCKUP_DETECTOR
          chance to run.  The current stack trace is displayed upon
          detection and the system will stay locked up.
 
+config KERNEL_HARDLOCKUP_DETECTOR
+       bool "Compile the kernel with detect Hard Lockups"
+       depends on KERNEL_DEBUG_KERNEL
+       help
+         Say Y here to enable the kernel to act as a watchdog to detect
+         hard lockups.
+
+         Hardlockups are bugs that cause the CPU to loop in kernel mode
+         for more than 10 seconds, without letting other interrupts have a
+         chance to run.  The current stack trace is displayed upon detection
+         and the system will stay locked up.
+
 config KERNEL_DETECT_HUNG_TASK
        bool "Compile the kernel with detect Hung Tasks"
        depends on KERNEL_DEBUG_KERNEL
@@ -583,10 +682,23 @@ config KERNEL_PRINTK_TIME
        default y
 
 config KERNEL_SLUB_DEBUG
-       bool
+       bool "Enable SLUB debugging support"
+       help
+         This enables various debugging features:
+           - Accepts "slub_debug" kernel parameter
+           - Provides caches debugging options (e.g. tracing, validating)
+           - Adds /sys/kernel/slab/ attrs for reading amounts of *objects*
+           - Enables /proc/slabinfo support
+           - Prints info when running out of memory
+
+         Enabling this can result in a significant increase of code size.
 
 config KERNEL_SLUB_DEBUG_ON
-       bool
+       depends on KERNEL_SLUB_DEBUG
+       bool "Boot kernel with basic caches debugging enabled"
+       help
+         This enables by default sanity_checks, red_zone, poison and store_user
+         debugging options for all caches.
 
 config KERNEL_SLABINFO
        select KERNEL_SLUB_DEBUG
@@ -1066,6 +1178,12 @@ config KERNEL_NET_L3_MASTER_DEV
          This module provides glue between core networking code and device
          drivers to support L3 master devices like VRF.
 
+config KERNEL_XDP_SOCKETS
+       bool "XDP sockets support"
+       help
+         XDP sockets allows a channel between XDP programs and
+         userspace applications.
+
 config KERNEL_WIRELESS_EXT
        def_bool n
 
@@ -1087,7 +1205,6 @@ config KERNEL_PAGE_POOL
 config KERNEL_PAGE_POOL_STATS
        bool "Page pool stats support"
        depends on KERNEL_PAGE_POOL
-       depends on !LINUX_5_10
 
 #
 # NFS related symbols
@@ -1303,3 +1420,19 @@ config KERNEL_UBIFS_FS_SECURITY
 
 config KERNEL_JFFS2_FS_SECURITY
        bool "JFFS2 Security Labels"
+
+config KERNEL_WERROR
+       bool "Compile the kernel with warnings as errors"
+       default BUILDBOT
+       default y if GCC_USE_VERSION_12
+       help
+         A kernel build should not cause any compiler warnings, and this
+         enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
+         to enforce that rule by default. Certain warnings from other tools
+         such as the linker may be upgraded to errors with this option as
+         well.
+
+         However, if you have a new (or very old) compiler or linker with odd
+         and unusual warnings, or you have some architecture with problems,
+         you may need to disable this config option in order to
+         successfully build the kernel.