Kconfig: consolidate the "Kernel hacking" menu

Move the source of lib/Kconfig.debug and arch/$(ARCH)/Kconfig.debug to
the top-level Kconfig.  For two architectures that means moving their
arch-specific symbols in that menu into a new arch Kconfig.debug file,
and for a few more creating a dummy file so that we can include it
unconditionally.

Also move the actual 'Kernel hacking' menu to lib/Kconfig.debug, where
it belongs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Christoph Hellwig 2018-07-31 13:39:31 +02:00 committed by Masahiro Yamada
parent 1572497cb0
commit 06ec64b84c
50 changed files with 59 additions and 206 deletions

View File

@ -30,3 +30,5 @@ source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
source "lib/Kconfig.debug"

View File

@ -710,8 +710,6 @@ config SRM_ENV
endmenu endmenu
source "arch/alpha/Kconfig.debug"
# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig # DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
# but we also need it if VGA_HOSE is set # but we also need it if VGA_HOSE is set
config DUMMY_CONSOLE config DUMMY_CONSOLE

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config EARLY_PRINTK config EARLY_PRINTK
bool bool
@ -39,5 +36,3 @@ config MATHEMU
This option is required for IEEE compliant floating point arithmetic This option is required for IEEE compliant floating point arithmetic
on the Alpha. The only time you would ever not say Y is to say M in on the Alpha. The only time you would ever not say Y is to say M in
order to debug the code. Say Y unless you know what you are doing. order to debug the code. Say Y unless you know what you are doing.
endmenu

View File

@ -574,5 +574,4 @@ source "drivers/pci/Kconfig"
endmenu endmenu
source "arch/arc/Kconfig.debug"
source "kernel/power/Kconfig" source "kernel/power/Kconfig"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config 16KSTACKS config 16KSTACKS
bool "Use 16Kb for kernel stacks instead of 8Kb" bool "Use 16Kb for kernel stacks instead of 8Kb"
@ -11,5 +8,3 @@ config 16KSTACKS
This increases the resident kernel footprint and will cause less This increases the resident kernel footprint and will cause less
threads to run on the system and also increase the pressure threads to run on the system and also increase the pressure
on the VM subsystem for higher order allocations. on the VM subsystem for higher order allocations.
endmenu

View File

@ -2191,8 +2191,6 @@ endmenu
source "drivers/firmware/Kconfig" source "drivers/firmware/Kconfig"
source "arch/arm/Kconfig.debug"
if CRYPTO if CRYPTO
source "arch/arm/crypto/Kconfig" source "arch/arm/crypto/Kconfig"
endif endif

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config ARM_PTDUMP_CORE config ARM_PTDUMP_CORE
def_bool n def_bool n
@ -1863,5 +1860,3 @@ config PID_IN_CONTEXTIDR
are planning to use hardware trace tools with this kernel. are planning to use hardware trace tools with this kernel.
source "drivers/hwtracing/coresight/Kconfig" source "drivers/hwtracing/coresight/Kconfig"
endmenu

View File

@ -1321,8 +1321,6 @@ source "drivers/acpi/Kconfig"
source "arch/arm64/kvm/Kconfig" source "arch/arm64/kvm/Kconfig"
source "arch/arm64/Kconfig.debug"
if CRYPTO if CRYPTO
source "arch/arm64/crypto/Kconfig" source "arch/arm64/crypto/Kconfig"
endif endif

View File

@ -1,6 +1,3 @@
menu "Kernel hacking"
source "lib/Kconfig.debug"
config ARM64_PTDUMP_CORE config ARM64_PTDUMP_CORE
def_bool n def_bool n
@ -97,5 +94,3 @@ config ARM64_RELOC_TEST
tristate "Relocation testing module" tristate "Relocation testing module"
source "drivers/hwtracing/coresight/Kconfig" source "drivers/hwtracing/coresight/Kconfig"
endmenu

View File

@ -115,18 +115,3 @@ source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz" source "kernel/Kconfig.hz"
endmenu endmenu
menu "Kernel hacking"
source "lib/Kconfig.debug"
config ACCESS_CHECK
bool "Check the user pointer address"
default y
help
Usually the pointer transfer from user space is checked to see if its
address is in the kernel space.
Say N here to disable that check to improve the performance.
endmenu

10
arch/c6x/Kconfig.debug Normal file
View File

@ -0,0 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
config ACCESS_CHECK
bool "Check the user pointer address"
default y
help
Usually the pointer transfer from user space is checked to see if its
address is in the kernel space.
Say N here to disable that check to improve the performance.

View File

@ -55,9 +55,3 @@ menu "Kernel Features"
source "kernel/Kconfig.preempt" source "kernel/Kconfig.preempt"
endmenu endmenu
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu

1
arch/h8300/Kconfig.debug Normal file
View File

@ -0,0 +1 @@
# dummy file, do not delete

View File

@ -149,7 +149,3 @@ endchoice
source "kernel/Kconfig.hz" source "kernel/Kconfig.hz"
endmenu endmenu
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu

View File

@ -0,0 +1 @@
# dummy file, do not delete

View File

@ -576,5 +576,3 @@ config MSPEC
If you have an ia64 and you want to enable memory special If you have an ia64 and you want to enable memory special
operations support (formerly known as fetchop), say Y here, operations support (formerly known as fetchop), say Y here,
otherwise say N. otherwise say N.
source "arch/ia64/Kconfig.debug"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
choice choice
prompt "Physical memory granularity" prompt "Physical memory granularity"
@ -56,5 +53,3 @@ config IA64_DEBUG_IRQ
Selecting this option turns on bug checking for the IA-64 irq_save Selecting this option turns on bug checking for the IA-64 irq_save
and restore instructions. It's useful for tracking down spinlock and restore instructions. It's useful for tracking down spinlock
problems, but slow! If you're unsure, select N. problems, but slow! If you're unsure, select N.
endmenu

View File

@ -147,5 +147,3 @@ endmenu
endif endif
source "arch/m68k/Kconfig.devices" source "arch/m68k/Kconfig.devices"
source "arch/m68k/Kconfig.debug"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config BOOTPARAM config BOOTPARAM
bool 'Compiled-in Kernel Boot Parameter' bool 'Compiled-in Kernel Boot Parameter'
@ -51,5 +48,3 @@ config BDM_DISABLE
Disable the ColdFire CPU's BDM signals. Disable the ColdFire CPU's BDM signals.
endif endif
endmenu

View File

@ -285,5 +285,3 @@ config PCI_XILINX
source "drivers/pci/Kconfig" source "drivers/pci/Kconfig"
endmenu endmenu
source "arch/microblaze/Kconfig.debug"

View File

@ -1,11 +1,5 @@
# For a description of the syntax of this configuration file, # For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt. # see Documentation/kbuild/kconfig-language.txt.
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
source "lib/Kconfig.debug"
endmenu

View File

@ -3195,6 +3195,4 @@ endmenu
source "drivers/firmware/Kconfig" source "drivers/firmware/Kconfig"
source "arch/mips/Kconfig.debug"
source "arch/mips/kvm/Kconfig" source "arch/mips/kvm/Kconfig"

View File

@ -1,12 +1,9 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
bool bool
default y default y
source "lib/Kconfig.debug"
config EARLY_PRINTK config EARLY_PRINTK
bool "Early printk" if EXPERT bool "Early printk" if EXPERT
depends on SYS_HAS_EARLY_PRINTK depends on SYS_HAS_EARLY_PRINTK
@ -155,5 +152,3 @@ config MIPS_CPS_NS16550_SHIFT
adjacent ns16550 registers in the system. adjacent ns16550 registers in the system.
endif # MIPS_CPS_NS16550_BOOL endif # MIPS_CPS_NS16550_BOOL
endmenu

View File

@ -91,7 +91,3 @@ menu "Kernel Features"
source "kernel/Kconfig.preempt" source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz" source "kernel/Kconfig.hz"
endmenu endmenu
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu

1
arch/nds32/Kconfig.debug Normal file
View File

@ -0,0 +1 @@
# dummy file, do not delete

View File

@ -187,5 +187,3 @@ config NIOS2_IO_REGION_BASE
default "0xe0000000" default "0xe0000000"
endmenu endmenu
source "arch/nios2/Kconfig.debug"

View File

@ -1,11 +1,8 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
source "lib/Kconfig.debug"
config DEBUG_STACK_USAGE config DEBUG_STACK_USAGE
bool "Enable stack utilization instrumentation" bool "Enable stack utilization instrumentation"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
@ -24,5 +21,3 @@ config EARLY_PRINTK
This is useful for kernel debugging when your machine crashes very This is useful for kernel debugging when your machine crashes very
early before the console code is initialized. early before the console code is initialized.
You should normally say N here, unless you want to debug such a crash. You should normally say N here, unless you want to debug such a crash.
endmenu

View File

@ -201,9 +201,3 @@ config OPENRISC_ESR_EXCEPTION_BUG_CHECK
endmenu endmenu
endmenu endmenu
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu

View File

@ -0,0 +1 @@
# dummy file, do not delete

View File

@ -349,8 +349,6 @@ endmenu
source "drivers/parisc/Kconfig" source "drivers/parisc/Kconfig"
source "arch/parisc/Kconfig.debug"
config SECCOMP config SECCOMP
def_bool y def_bool y
prompt "Enable seccomp to safely compute untrusted bytecode" prompt "Enable seccomp to safely compute untrusted bytecode"

View File

@ -1,9 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
endmenu

View File

@ -1194,8 +1194,6 @@ endif
config ARCH_RANDOM config ARCH_RANDOM
def_bool n def_bool n
source "arch/powerpc/Kconfig.debug"
config PPC_LIB_RHEAP config PPC_LIB_RHEAP
bool bool

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config PPC_DISABLE_WERROR config PPC_DISABLE_WERROR
bool "Don't build arch/powerpc code with -Werror" bool "Don't build arch/powerpc code with -Werror"
@ -379,5 +376,3 @@ config PPC_FAST_ENDIAN_SWITCH
depends on DEBUG_KERNEL && PPC_BOOK3S_64 depends on DEBUG_KERNEL && PPC_BOOK3S_64
help help
If you're unsure what this is, say N. If you're unsure what this is, say N.
endmenu

View File

@ -245,48 +245,3 @@ menu "Power management options"
source kernel/power/Kconfig source kernel/power/Kconfig
endmenu endmenu
menu "Kernel hacking"
config CMDLINE_BOOL
bool "Built-in kernel command line"
help
For most platforms, it is firmware or second stage bootloader
that by default specifies the kernel command line options.
However, it might be necessary or advantageous to either override
the default kernel command line or add a few extra options to it.
For such cases, this option allows hardcoding command line options
directly into the kernel.
For that, choose 'Y' here and fill in the extra boot parameters
in CONFIG_CMDLINE.
The built-in options will be concatenated to the default command
line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
command line will be ignored and replaced by the built-in string.
config CMDLINE
string "Built-in kernel command string"
depends on CMDLINE_BOOL
default ""
help
Supply command-line options at build time by entering them here.
config CMDLINE_FORCE
bool "Built-in command line overrides bootloader arguments"
depends on CMDLINE_BOOL
help
Set this option to 'Y' to have the kernel ignore the bootloader
or firmware command line. Instead, the built-in command line
will be used exclusively.
If you don't know what to do here, say N.
config EARLY_PRINTK
def_bool y
source "lib/Kconfig.debug"
config CMDLINE_BOOL
bool
endmenu

37
arch/riscv/Kconfig.debug Normal file
View File

@ -0,0 +1,37 @@
config CMDLINE_BOOL
bool "Built-in kernel command line"
help
For most platforms, it is firmware or second stage bootloader
that by default specifies the kernel command line options.
However, it might be necessary or advantageous to either override
the default kernel command line or add a few extra options to it.
For such cases, this option allows hardcoding command line options
directly into the kernel.
For that, choose 'Y' here and fill in the extra boot parameters
in CONFIG_CMDLINE.
The built-in options will be concatenated to the default command
line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
command line will be ignored and replaced by the built-in string.
config CMDLINE
string "Built-in kernel command string"
depends on CMDLINE_BOOL
default ""
help
Supply command-line options at build time by entering them here.
config CMDLINE_FORCE
bool "Built-in command line overrides bootloader arguments"
depends on CMDLINE_BOOL
help
Set this option to 'Y' to have the kernel ignore the bootloader
or firmware command line. Instead, the built-in command line
will be used exclusively.
If you don't know what to do here, say N.
config EARLY_PRINTK
def_bool y

View File

@ -828,8 +828,6 @@ config HAVE_PNETID
tristate tristate
default (SMC || CCWGROUP) default (SMC || CCWGROUP)
source "arch/s390/Kconfig.debug"
menu "Virtualization" menu "Virtualization"
config PFAULT config PFAULT

View File

@ -1,11 +1,8 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
source "lib/Kconfig.debug"
config S390_PTDUMP config S390_PTDUMP
bool "Export kernel pagetable layout to userspace via debugfs" bool "Export kernel pagetable layout to userspace via debugfs"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
@ -20,5 +17,3 @@ config S390_PTDUMP
config EARLY_PRINTK config EARLY_PRINTK
def_bool y def_bool y
endmenu

View File

@ -885,5 +885,3 @@ source "kernel/power/Kconfig"
source "drivers/cpuidle/Kconfig" source "drivers/cpuidle/Kconfig"
endmenu endmenu
source "arch/sh/Kconfig.debug"

View File

@ -1,11 +1,8 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
source "lib/Kconfig.debug"
config SH_STANDARD_BIOS config SH_STANDARD_BIOS
bool "Use LinuxSH standard BIOS" bool "Use LinuxSH standard BIOS"
depends on SUPERH32 depends on SUPERH32
@ -88,5 +85,3 @@ config MCOUNT
def_bool y def_bool y
depends on SUPERH32 depends on SUPERH32
depends on STACK_DEBUG || FUNCTION_TRACER depends on STACK_DEBUG || FUNCTION_TRACER
endmenu

View File

@ -565,5 +565,3 @@ config SYSVIPC_COMPAT
default y default y
source "drivers/sbus/char/Kconfig" source "drivers/sbus/char/Kconfig"
source "arch/sparc/Kconfig.debug"

View File

@ -1,12 +1,9 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
bool bool
default y default y
source "lib/Kconfig.debug"
config DEBUG_DCFLUSH config DEBUG_DCFLUSH
bool "D-cache flush debugging" bool "D-cache flush debugging"
depends on SPARC64 && DEBUG_KERNEL depends on SPARC64 && DEBUG_KERNEL
@ -21,5 +18,3 @@ config FRAME_POINTER
bool bool
depends on MCOUNT depends on MCOUNT
default y default y
endmenu

View File

@ -187,5 +187,3 @@ config SECCOMP
endmenu endmenu
source "arch/um/drivers/Kconfig" source "arch/um/drivers/Kconfig"
source "arch/um/Kconfig.debug"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config GPROF config GPROF
bool "Enable gprof support" bool "Enable gprof support"
@ -37,5 +34,3 @@ config EARLY_PRINTK
This is useful for kernel debugging when your machine crashes very This is useful for kernel debugging when your machine crashes very
early before the console code is initialized. early before the console code is initialized.
endmenu

View File

@ -222,5 +222,3 @@ endmenu
endif endif
endif endif
source "arch/unicore32/Kconfig.debug"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config EARLY_PRINTK config EARLY_PRINTK
def_bool DEBUG_OCD def_bool DEBUG_OCD
@ -30,5 +27,3 @@ config DEBUG_OCD
help help
Say Y here if you want the debug print routines to direct their Say Y here if you want the debug print routines to direct their
output to the UniCore On-Chip-Debugger channel using CP #1. output to the UniCore On-Chip-Debugger channel using CP #1.
endmenu

View File

@ -2931,6 +2931,4 @@ config HAVE_GENERIC_GUP
source "drivers/firmware/Kconfig" source "drivers/firmware/Kconfig"
source "arch/x86/Kconfig.debug"
source "arch/x86/kvm/Kconfig" source "arch/x86/kvm/Kconfig"

View File

@ -1,11 +1,8 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT config TRACE_IRQFLAGS_SUPPORT
def_bool y def_bool y
source "lib/Kconfig.debug"
config EARLY_PRINTK_USB config EARLY_PRINTK_USB
bool bool
@ -410,5 +407,3 @@ endchoice
config FRAME_POINTER config FRAME_POINTER
depends on !UNWINDER_ORC && !UNWINDER_GUESS depends on !UNWINDER_ORC && !UNWINDER_GUESS
bool bool
endmenu

View File

@ -567,5 +567,3 @@ menu "Power management options"
source "kernel/power/Kconfig" source "kernel/power/Kconfig"
endmenu endmenu
source "arch/xtensa/Kconfig.debug"

View File

@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
menu "Kernel hacking"
source "lib/Kconfig.debug"
config DEBUG_TLB_SANITY config DEBUG_TLB_SANITY
bool "Debug TLB sanity" bool "Debug TLB sanity"
@ -34,5 +31,3 @@ config S32C1I_SELFTEST
It is easy to make wrong hardware configuration, this test should catch it early. It is easy to make wrong hardware configuration, this test should catch it early.
Say 'N' on stable hardware. Say 'N' on stable hardware.
endmenu

View File

@ -1,3 +1,5 @@
menu "Kernel hacking"
menu "printk and dmesg options" menu "printk and dmesg options"
config PRINTK_TIME config PRINTK_TIME
@ -2034,3 +2036,7 @@ config IO_STRICT_DEVMEM
if the driver using a given range cannot be disabled. if the driver using a given range cannot be disabled.
If in doubt, say Y. If in doubt, say Y.
source "arch/$(SRCARCH)/Kconfig.debug"
endmenu # Kernel hacking