Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2244601rwb; Sat, 29 Jul 2023 03:02:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+DRkMUk2RFjQO9ptGBF4U7vac0STyy54pRD+Ej/E4HefpS8IGJCASIbVm68UFklAfpcUA X-Received: by 2002:a17:90a:2ca2:b0:267:f9ab:15bb with SMTP id n31-20020a17090a2ca200b00267f9ab15bbmr3713684pjd.14.1690624954797; Sat, 29 Jul 2023 03:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690624954; cv=none; d=google.com; s=arc-20160816; b=Dj9mMYO7AG2kvJHeA3+v07RgvoxkIj5Ef4wMPmT3PrRpamS5S+YxtlIARmqHebP8Z8 PGXU0wicdO4908e3w9sFaeQ/V/MqABnmZIjejav/GOthJrCYoYSg1Vw3xLyIFZlzbXVw lHM63Mjx2azH5zQC/vuc7d8RL7PNUERVq4JPK8ngLRwoSpNNUA8OzSjf66MGV1BqlCNd zMlfMZXNlBkZzu/EIKvwUhlBnwzsnmkO/BoQj8wfuKJLS2bu/d9UmqC4UEe28LBTAzAK DOk3o9No4Ux+deFxcXNscwtX2mdU4KDKVjC1ci9UDqgBwyOjEa5DSPVnmhUZ4yFKd+dF WulQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=ECdxt2HAy22dW69roEfXM8UAM1IbSspw658no0zM+jY=; fh=pi3Um36+fyuzBYjFMS/SX7OfICV7kDLHJHVcPR8n/2g=; b=Fetq61KQUgZMSJti+yBhQn8mLzC2Tm//VyrTmYuMAd/Lcs8w3HFXo+2+PuErm7+jzx hgBK5SCLCC+A7+wjSiw9pTyGlUFi+3n2ohkZPiclxl0MDzVSVmdCDBCtExi9ds3YHUrX KKeacU1nVyRpUWwLhV8Ii0Vr2htKn3205bcnU2mFhck/kYW4dtqGHPwtUxyPcLvGHxPK V4wAT4SFUnmSSflI5PjrcUl/GSMcskbXJqzzdBhvjbP9Tie/QRRBWU00JE6FU/8Xi9aP HTNxIxT7dVHRTPk8ZeX2p3aMpdRao83W+2SwKL5mnSwbSis37nzSI4ikngi03w7dUwLk s17w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fv4-20020a17090b0e8400b0026577f28dbcsi3885588pjb.45.2023.07.29.03.02.22; Sat, 29 Jul 2023 03:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjG2JoE (ORCPT + 99 others); Sat, 29 Jul 2023 05:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231875AbjG2Jn6 (ORCPT ); Sat, 29 Jul 2023 05:43:58 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D6C421E; Sat, 29 Jul 2023 02:43:52 -0700 (PDT) X-QQ-mid: bizesmtp69t1690623820t9fq1ksx Received: from linux-lab-host.localdomain ( [61.141.77.223]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 29 Jul 2023 17:43:39 +0800 (CST) X-QQ-SSF: 01200000000000E0X000000A0000000 X-QQ-FEAT: ZkxZBO9qcf524DNJP6sWoIuH7Engece/jg2w/GVDidzBTt8zNz48mPafsj+gF 0u5KGqbwCfl1qMkMbGSBa5iXRRVcIphnvGtjbgrlU99G5As1TCuU/SDvKC5onBCVpsQOApq 3OfcMckJ9p3x2Ll0vIBN0UP5JUtOLdFltddHn3M4vYNDiW2HsxZCHM+ab7sbf/xE/Ec9v6f D8qXvX5/3O8RH10R9NOVN0AT0UadpgvrtScxGgk8UgqwB7o8/zjXodXtM9I4CZdis5PPvQ+ xvxeW4nMtilLyJY7S/cpGMRfYWL2Y9Yz07pOCovvJwSUo3+tGmcrtsg7h5a8xIo9NSYTFGn qM2ZGgpHkfWS52sWBjNObbzTXDiejuN2H3DhI0A/AN+oXarqM2K8FKg1FIlgskqOK96+PAd X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13123960040625592504 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux@weissschuh.net, thomas@t-8ch.de Subject: Re: [PATCH v1 4/8] selftests/nolibc: add extra config file customize support Date: Sat, 29 Jul 2023 17:43:39 +0800 Message-Id: <20230729094339.9274-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230729074518.GH956@1wt.eu> References: <20230729074518.GH956@1wt.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Zhangjin, > > On Tue, Jul 25, 2023 at 10:30:06PM +0800, Zhangjin Wu wrote: > > Hi, Willy > > > > > On Wed, Jul 19, 2023 at 05:14:07AM +0800, Zhangjin Wu wrote: > > > > The default DEFCONFIG_ may not always work for all architectures, > > > > some architectures require to add extra kernel config options, this adds > > > > a new 'extconfig' target for this requirement. > > > > > > > > It allows to customize extra kernel config options via the common > > > > common.config and the architecture specific .config, at last > > > > trigger 'allnoconfig' to let them take effect with missing config > > > > options as disabled. > > > > > > > > The scripts/kconfig/merge_config.sh tool is used to merge the extra > > > > config files. > > > > > > > > Suggested-by: Thomas Wei?schuh > > > > Link: https://lore.kernel.org/lkml/67eb70d4-c9ff-4afc-bac7-7f36cc2c81bc@t-8ch.de/ > > > > Signed-off-by: Zhangjin Wu > > > > --- > > > > tools/testing/selftests/nolibc/Makefile | 7 +++++++ > > > > 1 file changed, 7 insertions(+) > > > > > > > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > > > > index f42adef87e12..08a5ca5f418b 100644 > > > > --- a/tools/testing/selftests/nolibc/Makefile > > > > +++ b/tools/testing/selftests/nolibc/Makefile > > > > @@ -39,6 +39,9 @@ DEFCONFIG_s390 = defconfig > > > > DEFCONFIG_loongarch = defconfig > > > > DEFCONFIG = $(DEFCONFIG_$(ARCH)) > > > > > > > > +# extra kernel config files under configs/, include common + architecture specific > > > > +EXTCONFIG = common.config $(ARCH).config > > > > + > > > > # optional tests to run (default = all) > > > > TEST = > > > > > > > > @@ -162,6 +165,10 @@ initramfs: nolibc-test > > > > defconfig: > > > > $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare > > > > > > > > +extconfig: > > > > + $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) > > > > + $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig > > > > + > > > > > > Please also mention this entry in the "help" message. > > > Other than that, OK. > > > > > > > Willy, as we discussed in another tinyconfig series, in order to avoid > > add more complexity to users, I plan to drop this standalone 'extconfig' > > target and move the extra config operations to defconfig target like > > this: > > > > defconfig: > > $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare > > $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) > > $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig > > > > This extra config options are really critical to default boot and test, so, it > > should be a 'default' config action as the 'defconfig' target originally mean. > > > > Will test carefully about this change, what's your idea? > > Well, *iff* we need to have per-arch config settings, probably to better > support Qemu, the console output, etc, then indeed we'd rather add them > to all configs indeed. However the example above is bogus. First you > create a default config, then prepare the rest of the kernel , then > merge that config with the extensions (based on the arch and not the > sub-arch BTW) then erase everything to restart from an allnoconfig. > allnoconfig is based on the "$(srctree)/.config" generated by defconfig plus the extra ARCH specific config options, so, it should be additional? Btw, what do you mean? "based on the arch and not the sub-arch BTW", in reality, the ARCH will be changed to XARCH, so, this is sub-arch/variant specific. > Also if you're using merge_config you'll need -Q to disable warning > about overridden options since you're starting from a defconfig which > contains plenty of them. Yeah, we do need this to silence some warnings. > Usually I just do defconfig, append the few > changes, then oldconfig and that's done. I have used olddefconfig (similar to oldconfig but without prompts) before, but allnoconfig is used to mainly to only compile the ones we explicitly enable, with the new additional options as No, which may be more deterministic, it should not touch the old configured ones in .config? I have learned its usage from the merge_config.sh > But merge_config can probably > be fine as well. Also make prepare should be done last, to make sure > that if it depends on anything in the config (e.g. 32 vs 64 bit etc) > it's up to date. > Ok, let's move 'prepare' at the end of all above. And also add the -Q option to silence the potential warnings: defconfig: $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) $(Q)$(srctree)/scripts/kconfig/merge_config.sh -Q -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) prepare We may still need to clear the usage of allnoconfig, In my test, it does work as I explained above. If I really misused it, let's change it back to olddefconfig. Thanks, Zhangjin > Willy