kconfig: Make allnoconfig disable options behind EMBEDDED and EXPERT
Subsystems (3)
PATCH 1/1 kconfig: Make allnoconfig disable options behind EMBEDDED and EXPERT
"make allnoconfig" exists to ease testing of minimal configurations. Documentation/SubmitChecklist includes a note to test with allnoconfig. This helps catch missing dependencies on common-but-not-required functionality, which might otherwise go unnoticed.
However, allnoconfig still leaves many symbols enabled, because they're hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT. For instance, allnoconfig still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't typically get build-tested with those disabled.
To address this, introduce a new Kconfig option "allnoconfig_y", used on symbols which only exist to hide other symbols. Set it on CONFIG_EMBEDDED (which then selects CONFIG_EXPERT). allnoconfig will then disable all the symbols hidden behind those.
--- Documentation/kbuild/kconfig-language.txt | 4 ++++ init/Kconfig | 1 + scripts/kconfig/confdata.c | 5 ++++- scripts/kconfig/expr.h | 3 +++ scripts/kconfig/lkc.h | 1 + scripts/kconfig/menu.c | 3 +++ scripts/kconfig/zconf.gperf | 1 + scripts/kconfig/zconf.hash.c_shipped | 13 ++++++++----- 8 files changed, 25 insertions(+), 6 deletions(-)
Documentation/kbuild/kconfig-language.txt +4 -0
@@ -157,6 +157,10 @@ applicable everywhere (see syntax). to the build environment (if this is desired, it can be done via another symbol). + - "allnoconfig_y" + This declares the symbol as one that should have the value y when + using "allnoconfig". Used for symbols that hide other symbols. + Menu dependencies -----------------
init/Kconfig +1 -0
@@ -1455,6 +1455,7 @@ config PCI_QUIRKS config EMBEDDED bool "Embedded system" + option allnoconfig_y select EXPERT help This option should be enabled if compiling the kernel for
scripts/kconfig/confdata.c +4 -1
@@ -1178,7 +1178,10 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode) sym->def[S_DEF_USER ].tri = mod;break ;case def_no: - sym->def[S_DEF_USER ].tri = no; +if (sym->flags &SYMBOL_ALLNOCONFIG_Y ) + sym->def[S_DEF_USER ].tri = yes; +else + sym->def[S_DEF_USER ].tri = no;break ;case def_random: sym->def[S_DEF_USER ].tri = no;
scripts/kconfig/expr.h +3 -0
@@ -109,6 +109,9 @@ struct symbol {/* choice values need to be set before calculating this symbol value */ #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 +/* Set symbol to y if allnoconfig; used for symbols that hide others */ +#define SYMBOL_ALLNOCONFIG_Y 0x200000 +#define SYMBOL_MAXLENGTH 256#define SYMBOL_HASHSIZE 9973
scripts/kconfig/lkc.h +1 -0
@@ -61,6 +61,7 @@ enum conf_def_mode {#define T_OPT_MODULES 1#define T_OPT_DEFCONFIG_LIST 2#define T_OPT_ENV 3 +#define T_OPT_ALLNOCONFIG_Y 4struct kconf_id {int name;
scripts/kconfig/menu.c +3 -0
@@ -217,6 +217,9 @@ void menu_add_option(int token, char *arg)case T_OPT_ENV :prop_add_env (arg);break ; +case T_OPT_ALLNOCONFIG_Y : + current_entry->sym->flags |=SYMBOL_ALLNOCONFIG_Y ; +break ; } }
scripts/kconfig/zconf.gperf +1 -0
@@ -44,4 +44,5 @@ on, T_ON, TF_PARAM modules, T_OPT_MODULES, TF_OPTION defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION env, T_OPT_ENV, TF_OPTION +allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION %%
scripts/kconfig/zconf.hash.c_shipped +8 -5
@@ -55,10 +55,10 @@ kconf_id_hash (register const char *str, register unsigned int len) 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 25, 25, + 73, 73, 73, 73, 73, 73, 73, 5, 25, 25, 0, 0, 0, 5, 0, 0, 73, 73, 5, 0, 10, 5, 45, 73, 20, 20, 0, 15, 15, 73, - 20, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 20, 5, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
@@ -106,6 +106,7 @@ struct kconf_id_strings_t char kconf_id_strings_str23[sizeof("mainmenu")]; char kconf_id_strings_str25[sizeof("menuconfig")]; char kconf_id_strings_str27[sizeof("modules")]; + char kconf_id_strings_str28[sizeof("allnoconfig_y")]; char kconf_id_strings_str29[sizeof("menu")]; char kconf_id_strings_str31[sizeof("select")]; char kconf_id_strings_str32[sizeof("comment")];
@@ -141,6 +142,7 @@ static const struct kconf_id_strings_t kconf_id_strings_contents = "mainmenu", "menuconfig", "modules", + "allnoconfig_y", "menu", "select", "comment",
@@ -170,7 +172,7 @@ kconf_id_lookup (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 32, + TOTAL_KEYWORDS = 33, MIN_WORD_LENGTH = 2, MAX_WORD_LENGTH = 14, MIN_HASH_VALUE = 2,
@@ -219,7 +221,8 @@ kconf_id_lookup (register const char *str, register unsigned int len) {-1}, #line 44 "scripts/kconfig/zconf.gperf" {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, - {-1}, +#line 47 "scripts/kconfig/zconf.gperf" + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, #line 16 "scripts/kconfig/zconf.gperf" {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, {-1},
@@ -282,5 +285,5 @@ kconf_id_lookup (register const char *str, register unsigned int len) } return 0; } -#line 47 "scripts/kconfig/zconf.gperf" +#line 48 "scripts/kconfig/zconf.gperf"
Signature · 1 line
1.9.0
Quoted 10 lines · Josh Triplett
"make allnoconfig" exists to ease testing of minimal configurations.
Documentation/SubmitChecklistincludes a note to test with allnoconfig. This helps catch missing dependencies on common-but-not-required functionality, which might otherwise go unnoticed.However, allnoconfig still leaves many symbols enabled, because they're hidden behind
CONFIG_EMBEDDEDorCONFIG_EXPERT. For instance, allnoconfig still hasCONFIG_PRINTKandCONFIG_BLOCKenabled, so drivers don't typically get build-tested with those disabled.
Quoted 6 lines
To address this, introduce a new
Kconfigoption "allnoconfig_y", used on symbols which only exist to hide other symbols. Set it onCONFIG_EMBEDDED(which then selectsCONFIG_EXPERT). allnoconfig will then disable all the symbols hidden behind those.Signed-off-by Josh Triplett <[email protected]>
Quoted 166 lines
--- Documentation/kbuild/kconfig-language.txt | 4 ++++ init/Kconfig | 1 + scripts/kconfig/confdata.c | 5 ++++- scripts/kconfig/expr.h | 3 +++ scripts/kconfig/lkc.h | 1 + scripts/kconfig/menu.c | 3 +++ scripts/kconfig/zconf.gperf | 1 + scripts/kconfig/zconf.hash.c_shipped | 13 ++++++++----- 8 files changed, 25 insertions(+), 6 deletions(-)Documentation/kbuild/kconfig-language.txt +4
-0@@ -157,6 +157,10 @@ applicable everywhere (see syntax). to the build environment (if this is desired, it can be done via another symbol). + - "allnoconfig_y" + This declares the symbol as one that should have the value y when + using "allnoconfig". Used for symbols that hide other symbols. + Menu dependencies -----------------init/Kconfig +1
-0@@ -1455,6 +1455,7 @@ config PCI_QUIRKS config EMBEDDED bool "Embedded system" + option allnoconfig_y select EXPERT help This option should be enabled if compiling the kernel forscripts/kconfig/confdata.c +4
-1@@ -1178,7 +1178,10 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode) sym->def[S_DEF_USER ].tri = mod;break ;case def_no: - sym->def[S_DEF_USER ].tri = no; +if (sym->flags &SYMBOL_ALLNOCONFIG_Y ) + sym->def[S_DEF_USER ].tri = yes; +else + sym->def[S_DEF_USER ].tri = no;break ;case def_random: sym->def[S_DEF_USER ].tri = no;scripts/kconfig/expr.h +3
-0@@ -109,6 +109,9 @@ struct symbol {/* choice values need to be set before calculating this symbol value */ #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 +/* Set symbol to y if allnoconfig; used for symbols that hide others */ +#define SYMBOL_ALLNOCONFIG_Y 0x200000 +#define SYMBOL_MAXLENGTH 256#define SYMBOL_HASHSIZE 9973scripts/kconfig/lkc.h +1
-0@@ -61,6 +61,7 @@ enum conf_def_mode {#define T_OPT_MODULES 1#define T_OPT_DEFCONFIG_LIST 2#define T_OPT_ENV 3 +#define T_OPT_ALLNOCONFIG_Y 4struct kconf_id {int name;scripts/kconfig/menu.c +3
-0@@ -217,6 +217,9 @@ void menu_add_option(int token, char *arg)case T_OPT_ENV :prop_add_env (arg);break ; +case T_OPT_ALLNOCONFIG_Y : + current_entry->sym->flags |=SYMBOL_ALLNOCONFIG_Y ; +break ; } }scripts/kconfig/zconf.gperf +1
-0@@ -44,4 +44,5 @@ on, T_ON, TF_PARAM modules, T_OPT_MODULES, TF_OPTION defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION env, T_OPT_ENV, TF_OPTION +allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION %%scripts/kconfig/zconf.hash.c_shipped +8
-5@@ -55,10 +55,10 @@ kconf_id_hash (register const char *str, register unsigned int len) 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 25, 25, + 73, 73, 73, 73, 73, 73, 73, 5, 25, 25, 0, 0, 0, 5, 0, 0, 73, 73, 5, 0, 10, 5, 45, 73, 20, 20, 0, 15, 15, 73, - 20, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 20, 5, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,@@ -106,6 +106,7 @@ struct kconf_id_strings_t char kconf_id_strings_str23[sizeof("mainmenu")]; char kconf_id_strings_str25[sizeof("menuconfig")]; char kconf_id_strings_str27[sizeof("modules")]; + char kconf_id_strings_str28[sizeof("allnoconfig_y")]; char kconf_id_strings_str29[sizeof("menu")]; char kconf_id_strings_str31[sizeof("select")]; char kconf_id_strings_str32[sizeof("comment")];@@ -141,6 +142,7 @@ static const struct kconf_id_strings_t kconf_id_strings_contents = "mainmenu", "menuconfig", "modules", + "allnoconfig_y", "menu", "select", "comment",@@ -170,7 +172,7 @@ kconf_id_lookup (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 32, + TOTAL_KEYWORDS = 33, MIN_WORD_LENGTH = 2, MAX_WORD_LENGTH = 14, MIN_HASH_VALUE = 2,@@ -219,7 +221,8 @@ kconf_id_lookup (register const char *str, register unsigned int len) {-1}, #line 44 "scripts/kconfig/zconf.gperf" {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, - {-1}, +#line 47 "scripts/kconfig/zconf.gperf" + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, #line 16 "scripts/kconfig/zconf.gperf" {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, {-1},@@ -282,5 +285,5 @@ kconf_id_lookup (register const char *str, register unsigned int len) } return 0; } -#line 47 "scripts/kconfig/zconf.gperf" +#line 48 "scripts/kconfig/zconf.gperf"Signature · 1 line
1.9.0
Quoted 10 lines · On Sun, 23 Feb 2014 18:20:26 -0800 Josh Triplett <[email protected]> wrote:
"make allnoconfig" exists to ease testing of minimal configurations.
Documentation/SubmitChecklistincludes a note to test with allnoconfig. This helps catch missing dependencies on common-but-not-required functionality, which might otherwise go unnoticed.However, allnoconfig still leaves many symbols enabled, because they're hidden behind
CONFIG_EMBEDDEDorCONFIG_EXPERT. For instance, allnoconfig still hasCONFIG_PRINTKandCONFIG_BLOCKenabled, so drivers don't typically get build-tested with those disabled.
Quoted 4 lines
To address this, introduce a new
Kconfigoption "allnoconfig_y", used on symbols which only exist to hide other symbols. Set it onCONFIG_EMBEDDED(which then selectsCONFIG_EXPERT). allnoconfig will then disable all the symbols hidden behind those.
Now look what you've done!
kernel/sched/core.c: In function 'pick_next_task':kernel/sched/core.c:2613: warning: control reaches end of non-void function
static inline struct task_struct * pick_next_task(struct rq *rq, struct task_struct *prev)
{
const struct sched_class *class;
struct task_struct *p;
/*
* Optimization: we know that if all tasks are in
* the fair class we can call that function directly:
*/
if (likely(prev->sched_class == &fair_sched_class &&
rq->nr_running == rq->cfs.h_nr_running)) {
p = fair_sched_class.pick_next_task(rq, prev);
if (likely(p))
return p;
}
for_each_class(class) {
p = class->pick_next_task(rq, prev);
if (p)
return p;
}
BUG(); /* the idle class will always have a runnable task */
}akpm3:/usr/src/25> grep CONFIG_BUG .config
# CONFIG_BUG is not set
Quoted 16 lines · Andrew Morton
Quoted 10 lines · On Sun, 23 Feb 2014 18:20:26 -0800 Josh Triplett <[email protected]> wrote:
"make allnoconfig" exists to ease testing of minimal configurations.
Documentation/SubmitChecklistincludes a note to test with allnoconfig. This helps catch missing dependencies on common-but-not-required functionality, which might otherwise go unnoticed.However, allnoconfig still leaves many symbols enabled, because they're hidden behind
CONFIG_EMBEDDEDorCONFIG_EXPERT. For instance, allnoconfig still hasCONFIG_PRINTKandCONFIG_BLOCKenabled, so drivers don't typically get build-tested with those disabled.Quoted 4 lines
To address this, introduce a new
Kconfigoption "allnoconfig_y", used on symbols which only exist to hide other symbols. Set it onCONFIG_EMBEDDED(which then selectsCONFIG_EXPERT). allnoconfig will then disable all the symbols hidden behind those.
Quoted 4 lines
Now look what you've done!
kernel/sched/core.c: In function 'pick_next_task':kernel/sched/core.c:2613: warning: control reaches end of non-void function
Hey, look, now allnoconfig turns off more of the more-rarely-disabled options, and turns up bugs and warnings that most people don't see! Yay! ;)
So, yes, we should go ahead and get BUG() fixed properly, at a minimum by using __builtin_unreachable(). I'll send a patch for that, as a followup to the thread where Arnd mentioned how to do so.
- Josh Triplett