]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
consolidate per-arch stack overflow debugging options
authorDave Hansen <dave@linux.vnet.ibm.com>
Mon, 1 Jul 2013 20:04:42 +0000 (13:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 4 Jul 2013 18:25:39 +0000 (11:25 -0700)
Original posting:

http://lkml.kernel.org/r/20121214184202.F54094D9@kernel.stglabs.ibm.com

Several architectures have similar stack debugging config options.
They all pretty much do the same thing, some with slightly
differing help text.

This patch changes the architectures to instead enable a Kconfig
boolean, and then use that boolean in the generic Kconfig.debug
to present the actual menu option.  This removes a bunch of
duplication and adds consistency across arches.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com> [for tile]
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
24 files changed:
arch/arc/Kconfig
arch/arc/Kconfig.debug
arch/blackfin/Kconfig
arch/blackfin/Kconfig.debug
arch/frv/Kconfig
arch/frv/Kconfig.debug
arch/m32r/Kconfig
arch/m32r/Kconfig.debug
arch/metag/Kconfig
arch/metag/Kconfig.debug
arch/mips/Kconfig
arch/mips/Kconfig.debug
arch/mn10300/Kconfig
arch/mn10300/Kconfig.debug
arch/openrisc/Kconfig
arch/parisc/Kconfig
arch/parisc/Kconfig.debug
arch/powerpc/Kconfig
arch/powerpc/Kconfig.debug
arch/tile/Kconfig
arch/tile/Kconfig.debug
arch/x86/Kconfig
arch/x86/Kconfig.debug
lib/Kconfig.debug

index 5917099470eaf74d259051b4f7451683cc52901a..cff2aad310418e3ac7ce7b1d88b3808cc64f01cd 100644 (file)
@@ -34,6 +34,7 @@ config ARC
        select OF
        select OF_EARLY_FLATTREE
        select PERF_USE_VMALLOC
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
index 962c6099659edc01a7ed417705084846c0a11e9a..a7fc0da25650ef8920e5cfc9f25d417a36081617 100644 (file)
@@ -15,13 +15,6 @@ config EARLY_PRINTK
          with klogd/syslogd or the X server. You should normally N here,
          unless you want to debug such a crash.
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config 16KSTACKS
        bool "Use 16Kb for kernel stacks instead of 8Kb"
        help
index a117652b5feaac84e4bb880bb8b1b4772c8b6f5a..82707a77aa73e1b34c0ac79df038d45f81f1a263 100644 (file)
@@ -41,6 +41,7 @@ config BLACKFIN
        select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_RELA
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config GENERIC_CSUM
        def_bool y
index 79594694ee90a4bb24d63e893bc879f89284d6fa..f3337ee03621d5f79a31af217bbd4bdf99dee79b 100644 (file)
@@ -2,13 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config DEBUG_VERBOSE
        bool "Verbose fault messages"
        default y
index 2ce731f9aa4d522abfc7d2fbcfff33483a2b2154..4b6628ea381e45be866e571683b38cf1d45a5177 100644 (file)
@@ -14,6 +14,7 @@ config FRV
        select ARCH_WANT_IPC_PARSE_VERSION
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config ZONE_DMA
        bool
index 211f01bc4caa8f88db015cb4be8578e38ee7b6ec..98c99a3ed2be6b7233f872a44536896aa51bca6d 100644 (file)
@@ -2,10 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-
 config GDBSTUB
        bool "Remote GDB kernel debugging"
        depends on DEBUG_KERNEL
index bcd17b20657128ef42c2f68f0dd07880467f1c2c..29a7ef4e448b06d2ae8bd9aa0aa1a2fa5f901802 100644 (file)
@@ -16,6 +16,7 @@ config M32R
        select GENERIC_ATOMIC64
        select ARCH_USES_GETTIMEOFFSET
        select MODULES_USE_ELF_RELA
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config SBUS
        bool
index bb1afc1a31ccb8de1f748949b79c1d6c962a5c35..6c612b7691b09816508f7aa0f34391ec1bc6d335 100644 (file)
@@ -2,13 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config DEBUG_PAGEALLOC
        bool "Debug page memory allocations"
        depends on DEBUG_KERNEL && BROKEN
index dcd94406030e3e9cebd2a15a01260c389d2d24a8..cfd831c2982424fb305671993ce5bd99cfcb1453 100644 (file)
@@ -30,6 +30,7 @@ config METAG
        select OF
        select OF_EARLY_FLATTREE
        select SPARSE_IRQ
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config STACKTRACE_SUPPORT
        def_bool y
index e45bbf6a7a5dbd2389bac7e205962e2599e00af0..cb5c9286054021273f5945880d038e7cd380cc28 100644 (file)
@@ -6,13 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config 4KSTACKS
        bool "Use 4Kb for kernel stacks instead of 8Kb"
        depends on DEBUG_KERNEL
index 7a58ab933b206a397c56b65f6a608fc4f9a1d8eb..7aae1ef096ea8b010effadef602472738003f5a3 100644 (file)
@@ -42,6 +42,7 @@ config MIPS
        select MODULES_USE_ELF_REL if MODULES
        select MODULES_USE_ELF_RELA if MODULES && 64BIT
        select CLONE_BACKWARDS
+       select HAVE_DEBUG_STACKOVERFLOW
 
 menu "Machine selection"
 
index 5a43aa0798caa7da84f48af3513f02160bd61997..37871f0de15eca8c817f38b6dcdbb2b3b9c056b4 100644 (file)
@@ -67,15 +67,6 @@ config CMDLINE_OVERRIDE
 
          Normally, you will choose 'N' here.
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit(2GB on MIPS). The debugging option
-         provides another way to check stack overflow happened on kernel mode
-         stack usually caused by nested interruption.
-
 config SMTC_IDLE_HOOK_DEBUG
        bool "Enable additional debug checks before going into CPU idle loop"
        depends on DEBUG_KERNEL && MIPS_MT_SMTC
index 428da175d0734abab132fbbbad57154b05530b1d..70e4f663ebd2818d6532bd14cf71c0893867f3b1 100644 (file)
@@ -13,6 +13,7 @@ config MN10300
        select MODULES_USE_ELF_RELA
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config AM33_2
        def_bool n
index bdbfd444a9ff9cf5569baa685a906e5f8800801d..94efb3ed223f2552a8989ad1fe2eb1efe38011cf 100644 (file)
@@ -2,10 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-
 config DEBUG_DECOMPRESS_KERNEL
        bool "Using serial port during decompressing kernel"
        depends on DEBUG_KERNEL
index 1072bfd18c5083034aabb20116c21f144f88b55e..99dbab1c59ac2ef78d4f4566da9c47b3e3a6350f 100644 (file)
@@ -22,6 +22,7 @@ config OPENRISC
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select MODULES_USE_ELF_RELA
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config MMU
        def_bool y
@@ -128,16 +129,6 @@ config CMDLINE
 
 menu "Debugging options"
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for kernel stack overflow"
-       default y
-       help
-         Make extra checks for space available on stack in some
-          critical functions. This will cause kernel to run a bit slower,
-         but will catch most of kernel stack overruns and exit gracefully.
-
-         Say Y if you are unsure.
-
 config JUMP_UPON_UNHANDLED_EXCEPTION
        bool "Try to die gracefully"
        default y
index 6507dabdd5ddc1a758e68f7476eb197fac9ec7b3..ffcd557f8cfd3a27621d72b6a74551e5576030e3 100644 (file)
@@ -27,6 +27,7 @@ config PARISC
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS
        select TTY # Needed for pdc_cons.c
+       select HAVE_DEBUG_STACKOVERFLOW
 
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
index 08a332f6ee874d814df7a97615dd44821add3c13..bc989e522a045c17ca4514478b7cb5ef9d77fc4d 100644 (file)
@@ -13,14 +13,3 @@ config DEBUG_RODATA
          If in doubt, say "N".
 
 endmenu
-
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       default y
-       depends on DEBUG_KERNEL
-       ---help---
-         Say Y here if you want to check the overflows of kernel, IRQ
-         and exception stacks. This option will cause messages of the
-         stacks in detail when free stack space drops below a certain
-         limit.
-         If in doubt, say "N".
index c33e3ad2c8fd52c9e0c31dfc272faf3d34902f37..a4f5959ed9b01fc7966dd4a984150a60225f3a69 100644 (file)
@@ -138,6 +138,7 @@ config PPC
        select ARCH_USE_BUILTIN_BSWAP
        select OLD_SIGSUSPEND
        select OLD_SIGACTION if PPC32
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config EARLY_PRINTK
        bool
index 863d877e0b5f7444f31239a2412bdec68165abea..a4914f373958dca16cfd563cabad978c28491a7a 100644 (file)
@@ -28,13 +28,6 @@ config PRINT_STACK_DEPTH
          too small and stack traces cause important information to
          scroll off the screen.
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config HCALL_STATS
        bool "Hypervisor call instrumentation"
        depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
index 3aa37669ff8c655ba1c44a9b2b3e8e8375c5d16e..24565a7ffe6d2fa1de2e9bc164b926e66fe6019f 100644 (file)
@@ -25,6 +25,7 @@ config TILE
        select HAVE_ARCH_TRACEHOOK
        select HAVE_SYSCALL_TRACEPOINTS
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+       select HAVE_DEBUG_STACKOVERFLOW
 
 # FIXME: investigate whether we need/want these options.
 #      select HAVE_IOREMAP_PROT
index ddbfc3322d7f461e693614405ac5ce2aee930148..9165ea979e85dcf2aa057ae23a780ec70c7eda97 100644 (file)
@@ -14,13 +14,6 @@ config EARLY_PRINTK
          with klogd/syslogd. You should normally N here,
          unless you want to debug such a crash.
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       help
-         This option will cause messages to be printed if free stack space
-         drops below a certain limit.
-
 config DEBUG_EXTRA_FLAGS
        string "Additional compiler arguments when building with '-g'"
        depends on DEBUG_INFO
index fe120da25625b23ef52c74b479bf715f265261b4..22f30337a18ea2273fd9513145922cc9b42ba15f 100644 (file)
@@ -121,6 +121,7 @@ config X86
        select OLD_SIGACTION if X86_32
        select COMPAT_OLD_SIGACTION if IA32_EMULATION
        select RTC_LIB
+       select HAVE_DEBUG_STACKOVERFLOW
 
 config INSTRUCTION_DECODER
        def_bool y
index c198b7e13e7bba5be02fdd04db10681bdda97337..c1665a8989da03c4651a0870db29c6812be5108b 100644 (file)
@@ -59,16 +59,6 @@ config EARLY_PRINTK_DBGP
          with klogd/syslogd or the X server. You should normally N here,
          unless you want to debug such a crash. You need usb debug device.
 
-config DEBUG_STACKOVERFLOW
-       bool "Check for stack overflows"
-       depends on DEBUG_KERNEL
-       ---help---
-         Say Y here if you want to check the overflows of kernel, IRQ
-         and exception stacks. This option will cause messages of the
-         stacks in detail when free stack space drops below a certain
-         limit.
-         If in doubt, say "N".
-
 config X86_PTDUMP
        bool "Export kernel pagetable layout to userspace via debugfs"
        depends on DEBUG_KERNEL
index 566cf2bc08eaac44813dd9a1d1ac0d816a072237..cc443bc6edfc83f7d85b56a904a7093b27e55598 100644 (file)
@@ -1475,6 +1475,27 @@ config ASYNC_RAID6_TEST
 
          If unsure, say N.
 
+config HAVE_DEBUG_STACKOVERFLOW
+       bool
+
+config DEBUG_STACKOVERFLOW
+       bool "Check for stack overflows"
+       depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
+       ---help---
+         Say Y here if you want to check for overflows of kernel, IRQ
+         and exception stacks (if your archicture uses them). This
+         option will show detailed messages if free stack space drops
+         below a certain limit.
+
+         These kinds of bugs usually occur when call-chains in the
+         kernel get too deep, especially when interrupts are
+         involved.
+
+         Use this in cases where you see apparently random memory
+         corruption, especially if it appears in 'struct thread_info'
+
+         If in doubt, say "N".
+
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"