init: Do not select DEBUG_KERNEL by default
PATCH v2 1/1 init: Do not select DEBUG_KERNEL by default
We can't seem to have a kernel with CONFIG_EXPERT set but CONFIG_DEBUG_KERNEL unset these days.
While some of the features under the CONFIG_EXPERT require CONFIG_DEBUG_KERNEL, it doesn't apply for all features.
It looks like CONFIG_KALLSYMS_ALL is the only feature that requires CONFIG_DEBUG_KERNEL.
Select CONFIG_EXPERT when CONFIG_DEBUG is chosen but you can still choose CONFIG_EXPERT without CONFIG_DEBUG.
--- init/Kconfig | 2 -- lib/Kconfig.debug | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
init/Kconfig +0 -2
@@ -1206,8 +1206,6 @@ config BPF menuconfig EXPERT bool "Configure standard kernel features (expert users)" - # Unhide debug options, to make the on-by-default options visible - select DEBUG_KERNEL help This option allows certain base kernel options and settings to be disabled or tweaked. This is for specialized
lib/Kconfig.debug +1 -0
@@ -434,6 +434,7 @@ config MAGIC_SYSRQ_SERIAL config DEBUG_KERNEL bool "Kernel debugging" + default EXPERT help Say Y here if you are developing drivers or trying to debug and identify kernel problems.
Signature · 1 line
2.21.0
Quoted 11 lines · Sinan Kaya
We can't seem to have a kernel with
CONFIG_EXPERTset butCONFIG_DEBUG_KERNELunset these days.While some of the features under the
CONFIG_EXPERTrequireCONFIG_DEBUG_KERNEL, it doesn't apply for all features.It looks like
CONFIG_KALLSYMS_ALLis the only feature that requiresCONFIG_DEBUG_KERNEL.Select
CONFIG_EXPERTwhenCONFIG_DEBUGis chosen but you can
Typo: CONFIG_DEBUG_KERNEL
Quoted 1 line
still choose
CONFIG_EXPERTwithoutCONFIG_DEBUG.
same.
Quoted 2 lines
Signed-off-by Sinan Kaya <[email protected]>
But with those fixed, looks good to me. Adding Josh (and others) to CC since he originally added the linkage to EXPERT in commit f505c553dbe2.
-Kees
Quoted 33 lines
--- init/Kconfig | 2 -- lib/Kconfig.debug | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)init/Kconfig +0
-2@@ -1206,8 +1206,6 @@ config BPF menuconfig EXPERT bool "Configure standard kernel features (expert users)" - # Unhide debug options, to make the on-by-default options visible - select DEBUG_KERNEL help This option allows certain base kernel options and settings to be disabled or tweaked. This is for specializedlib/Kconfig.debug +1
-1@@ -434,6 +434,7 @@ config MAGIC_SYSRQ_SERIAL config DEBUG_KERNEL bool "Kernel debugging" + default EXPERT help Say Y here if you are developing drivers or trying to debug and identify kernel problems. --2.21.0
Signature · 1 line
Kees Cook
Quoted 17 lines · Kees Cook
Quoted 11 lines · Sinan Kaya
We can't seem to have a kernel with
CONFIG_EXPERTset butCONFIG_DEBUG_KERNELunset these days.While some of the features under the
CONFIG_EXPERTrequireCONFIG_DEBUG_KERNEL, it doesn't apply for all features.It looks like
CONFIG_KALLSYMS_ALLis the only feature that requiresCONFIG_DEBUG_KERNEL.Select
CONFIG_EXPERTwhenCONFIG_DEBUGis chosen but you canTypo:
CONFIG_DEBUG_KERNELQuoted 1 line
still choose
CONFIG_EXPERTwithoutCONFIG_DEBUG.
Quoted 8 lines
same.
Quoted 2 lines
Signed-off-by Sinan Kaya <[email protected]>But with those fixed, looks good to me. Adding Josh (and others) to CC since he originally added the linkage to EXPERT in commit
f505c553dbe2.
CONFIG_DEBUG_KERNEL shouldn't affect code generation in any way; it should only make more options appear in kconfig. I originally added this to ensure that features you might want to *disable* aren't hidden, as part of the tinification effort.
What specific problem does having CONFIG_DEBUG_KERNEL enabled cause for you? I'd still prefer to have a single switch for "don't hide things I might want to disable", rather than several.
This would also need checking to make sure it doesn't grow tinyconfig.
Quoted 24 lines · Josh Triplett
Quoted 22 lines · Kees Cook
Quoted 11 lines · Sinan Kaya
We can't seem to have a kernel with
CONFIG_EXPERTset butCONFIG_DEBUG_KERNELunset these days.While some of the features under the
CONFIG_EXPERTrequireCONFIG_DEBUG_KERNEL, it doesn't apply for all features.It looks like
CONFIG_KALLSYMS_ALLis the only feature that requiresCONFIG_DEBUG_KERNEL.Select
CONFIG_EXPERTwhenCONFIG_DEBUGis chosen but you canTypo:
CONFIG_DEBUG_KERNELQuoted 1 line
still choose
CONFIG_EXPERTwithoutCONFIG_DEBUG.same.
Quoted 2 lines
Signed-off-by Sinan Kaya <[email protected]>
Quoted 7 lines
Quoted 3 lines
But with those fixed, looks good to me. Adding Josh (and others) to CC since he originally added the linkage to EXPERT in commit
f505c553dbe2.
CONFIG_DEBUG_KERNELshouldn't affect code generation in any way; it should only make more options appear in kconfig. I originally added this to ensure that features you might want to *disable* aren't hidden, as part of the tinification effort.What specific problem does having
CONFIG_DEBUG_KERNELenabled cause for you? I'd still prefer to have a single switch for "don't hide things I might want to disable", rather than several.
See earlier in the thread: code generation depends on CONFIG_DEBUG_KERNEL now unfortunately.
Signature · 1 line
Kees Cook
Quoted 37 lines · Kees Cook
Quoted 2 lines · Josh Triplett
On April 10, 2019 3:58:55 PM PDT, Kees Cook <[email protected]>
Quoted 15 lines · wrote:
Quoted 15 lines · Sinan Kaya
Quoted 11 lines
We can't seem to have a kernel with
CONFIG_EXPERTset butCONFIG_DEBUG_KERNELunset these days.While some of the features under the
CONFIG_EXPERTrequireCONFIG_DEBUG_KERNEL, it doesn't apply for all features.It looks like
CONFIG_KALLSYMS_ALLis the only feature that requiresCONFIG_DEBUG_KERNEL.Select
CONFIG_EXPERTwhenCONFIG_DEBUGis chosen but you canTypo:
CONFIG_DEBUG_KERNELQuoted 8 lines
Quoted 8 lines
Quoted 1 line
still choose
CONFIG_EXPERTwithoutCONFIG_DEBUG.same.
Quoted 2 lines
Signed-off-by Sinan Kaya <[email protected]>But with those fixed, looks good to me. Adding Josh (and others) to
CC
Quoted 4 lines
Quoted 2 lines
since he originally added the linkage to EXPERT in commit
f505c553dbe2.
CONFIG_DEBUG_KERNELshouldn't affect code generation in any way; itshould only make more options appear in kconfig. I originally added this to ensure that features you might want to *disable* aren't hidden, as part of the tinification effort.
Quoted 1 line
Quoted 6 lines
Quoted 1 line
What specific problem does having
CONFIG_DEBUG_KERNELenabled causefor you? I'd still prefer to have a single switch for "don't hide things I might want to disable", rather than several.
See earlier in the thread: code generation depends on
CONFIG_DEBUG_KERNELnow unfortunately.
Then let's fix *that*, and get checkpatch to help enforce it in the future. EXPERT doesn't affect code generation, and neither should this.
Quoted 1 line · Josh Triplett
Then let's fix*that*, and get checkpatch to help enforce it in the future. EXPERT doesn't affect code generation, and neither should this.
I think we have to do both. We need to go after the users as well as solve the immediate problem per this patch.
As Mathieu identified, CONFIG_DEBUG_KERNEL is being used all over the place and getting subsystem owners to remove let alone add a check to checkpatch is just going to take time.
Please let us know if you are OK with this plan.
Quoted 11 lines · Sinan Kaya
Quoted 1 line · Josh Triplett
Then let's fix*that*, and get checkpatch to help enforce it in the future. EXPERT doesn't affect code generation, and neither should this.
I think we have to do both. We need to go after the users as well as solve the immediate problem per this patch.
As Mathieu identified,
CONFIG_DEBUG_KERNELis being used all over the place and getting subsystem owners to remove let alone add a check to checkpatch is just going to take time.Please let us know if you are OK with this plan.
I'm not OK with this plan. Turning on EXPERT should make the options under DEBUG_KERNEL visible; it's a bug that DEBUG_KERNEL affects code generation as well.
Proposed alternative plan: let's add a new symbol, something like DEBUG_MISC ("Miscellaneous debug code that should be under a more specific debug option but isn't"), make it depend on DEBUG_KERNEL and be "default DEBUG_KERNEL" but allow itself to be turned off, and then mechanically change the small handful of "#ifdef CONFIG_DEBUG_KERNEL" to "#ifdef CONFIG_DEBUG_MISC".
Does that sound like an appropriately rapid solution for this bug?
Quoted 18 lines · Josh Triplett
Quoted 11 lines · Sinan Kaya
Quoted 1 line · Josh Triplett
Then let's fix*that*, and get checkpatch to help enforce it in the future. EXPERT doesn't affect code generation, and neither should this.
I think we have to do both. We need to go after the users as well as solve the immediate problem per this patch.
As Mathieu identified,
CONFIG_DEBUG_KERNELis being used all over the place and getting subsystem owners to remove let alone add a check to checkpatch is just going to take time.Please let us know if you are OK with this plan.
I'm not OK with this plan. Turning on EXPERT should make the options under
DEBUG_KERNELvisible; it's a bug thatDEBUG_KERNELaffects code generation as well.
Quoted 8 lines
Proposed alternative plan: let's add a new symbol, something like
DEBUG_MISC("Miscellaneous debug code that should be under a more specific debug option but isn't"), make it depend onDEBUG_KERNELand be "defaultDEBUG_KERNEL" but allow itself to be turned off, and then mechanically change the small handful of "#ifdefCONFIG_DEBUG_KERNEL" to "#ifdefCONFIG_DEBUG_MISC".Does that sound like an appropriately rapid solution for this bug?
Sure, that sounds fine to me. Sinan can you take care of that for v4?
Signature · 1 line
Kees Cook
Quoted 9 lines · Kees Cook
Quoted 8 lines
Proposed alternative plan: let's add a new symbol, something like
DEBUG_MISC("Miscellaneous debug code that should be under a more specific debug option but isn't"), make it depend onDEBUG_KERNELand be "defaultDEBUG_KERNEL" but allow itself to be turned off, and then mechanically change the small handful of "#ifdefCONFIG_DEBUG_KERNEL" to "#ifdefCONFIG_DEBUG_MISC".Does that sound like an appropriately rapid solution for this bug?
Sure, that sounds fine to me. Sinan can you take care of that for v4?
Sure, let me work on this.
Quoted 8 lines · Sinan Kaya
Quoted 7 lines · Kees Cook
Quoted 7 lines
Proposed alternative plan: let's add a new symbol, something like
DEBUG_MISC("Miscellaneous debug code that should be under a more specific debug option but isn't"), make it depend onDEBUG_KERNELand be "defaultDEBUG_KERNEL" but allow itself to be turned off, and then mechanically change the small handful of "#ifdefCONFIG_DEBUG_KERNEL" to "#ifdefCONFIG_DEBUG_MISC".
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
Does that sound like an appropriately rapid solution for this bug?
Sure, that sounds fine to me. Sinan can you take care of that for v4?
Sure, let me work on this.
Thank you both! I really appreciate that.
Quoted 38 lines · Josh Triplett
Quoted 37 lines · Kees Cook
Quoted 2 lines · Josh Triplett
On April 10, 2019 3:58:55 PM PDT, Kees Cook <[email protected]>
Quoted 15 lines · wrote:
Quoted 15 lines · Sinan Kaya
Quoted 11 lines
We can't seem to have a kernel with
CONFIG_EXPERTset butCONFIG_DEBUG_KERNELunset these days.While some of the features under the
CONFIG_EXPERTrequireCONFIG_DEBUG_KERNEL, it doesn't apply for all features.It looks like
CONFIG_KALLSYMS_ALLis the only feature that requiresCONFIG_DEBUG_KERNEL.Select
CONFIG_EXPERTwhenCONFIG_DEBUGis chosen but you canTypo:
CONFIG_DEBUG_KERNELQuoted 8 lines
Quoted 8 lines
Quoted 1 line
still choose
CONFIG_EXPERTwithoutCONFIG_DEBUG.same.
Quoted 2 lines
Signed-off-by Sinan Kaya <[email protected]>But with those fixed, looks good to me. Adding Josh (and others) to
CC
Quoted 4 lines
Quoted 2 lines
since he originally added the linkage to EXPERT in commit
f505c553dbe2.
CONFIG_DEBUG_KERNELshouldn't affect code generation in any way; itshould only make more options appear in kconfig. I originally added this to ensure that features you might want to *disable* aren't hidden, as part of the tinification effort.
Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
What specific problem does having
CONFIG_DEBUG_KERNELenabled causefor you? I'd still prefer to have a single switch for "don't hide things I might want to disable", rather than several.
See earlier in the thread: code generation depends on
CONFIG_DEBUG_KERNELnow unfortunately.Then let's fix *that*, and get checkpatch to help enforce it in the future. EXPERT doesn't affect code generation, and neither should this.
checkpatch is not an enforcer. It takes maintainers to do that.
Signature · 1 line
~Randy