From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAE0BC3DA6F for ; Fri, 25 Aug 2023 18:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NRkRm4H6tlgQnD9UOF6DTKeeNqCO/5RSAD9tcJhDajk=; b=r1xqefCojMwxO/ 6oAi88gyYxh0jT0BbvatHE7J+cERdVo0NMKtnSBEyydE93KmGDePoM5iCFPkZfIH3Wr8iNoqvXjGm VREznZMXqjswB2Vjyrg01Txr5n6JTiTVyXCQ2foWC21o8ad6SgOJV/+saYu5sfvvGm4czaBknE9B1 pZeRkpJRDg4dHGRII7037OZwcfIgm/RBQ+D4bnfbGPEnkquzVkLeUFViDN0o8eyG8N27W4KtzEO9X PXeQ23MhZ/9pnYJZHXJADdID6xEVoiUeD3BHiE5XJRSeJZfTo+mZiWrFx+pwM0tkjMkg/QR07XZTb e5btgCQBsJfdx7ivCjqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZbd2-005sQ7-2g; Fri, 25 Aug 2023 18:33:52 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qZbcy-005sOg-2M for linux-arm-kernel@lists.infradead.org; Fri, 25 Aug 2023 18:33:50 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-68a42d06d02so1042302b3a.0 for ; Fri, 25 Aug 2023 11:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692988426; x=1693593226; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8lUGjqed5vBEF61//Ts3J+LsbHjaPbzQsfTJT+JEbFA=; b=fs2vsxHkz2wP7TObW5d0DadYscN9gIp3iQDmbXDJFZ9TXLBpCjfEgbr249m+hpnt0H N8eHUiqtK7UcSX0JDYTqI1A6bnyDPDj8c4Ou7YGA0GVwgInqr0iTvOzvDiJxGlCaQxLN RIAxlHY6RydO0bYtLOKbnqDYX0Yp0fkHde1d8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692988426; x=1693593226; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8lUGjqed5vBEF61//Ts3J+LsbHjaPbzQsfTJT+JEbFA=; b=H496Vc9WkQiAjFIS9g/9RruIFi/dskmI4mtqVSxn7aHt8oBLF1PQGiN9Y8Fs7t0G13 /WMgvlJlSM7PjlzO/qoY0bI2BgL2m+K1sH5hjDXMlsN9vZyjBGxCv+M0CPoxaaXwGn3r 2tWAbFSsC2b39z6hcgTf+gVOb2iBGB8qVvv8HPfn4PDEhRfs9qZODSx0wwOpmdF460lE Nce7Xc/m3+cUfbHpD+SI4lkH33gEmb1MXUqH1wRrYhZvskgLWGHripc+/f03oeXOEpon CrzIFkghwBpqQN5lbzRTjMi5vYDjsWw/P7x2sFZH0vShZMoEPQ3WUDxlWIJcNzGIPMTp y+6g== X-Gm-Message-State: AOJu0Yzd0f3g1HUw0g1DkJWzKFDC8xfgt3wpnmHaoH1fT+M/Z4FkxFRV px9CYEa7F80SrRqhBBKNTOGUcA== X-Google-Smtp-Source: AGHT+IGDxoqIqcJZyjYGVuOgm8M01AX2FlPXYmdv5h9gJHh0STQ7ADq/UhT1DHG724uSr8yjfQvnWw== X-Received: by 2002:a05:6a00:23c6:b0:68a:406f:8a11 with SMTP id g6-20020a056a0023c600b0068a406f8a11mr18065379pfc.15.1692988425770; Fri, 25 Aug 2023 11:33:45 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id u14-20020aa7838e000000b0065980654baasm1891186pfm.130.2023.08.25.11.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 11:33:45 -0700 (PDT) Date: Fri, 25 Aug 2023 11:33:44 -0700 From: Kees Cook To: Michael Ellerman Cc: Masahiro Yamada , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] kbuild: Show Kconfig fragments in "help" Message-ID: <202308251123.D87F05DC@keescook> References: <20230824223606.never.762-kees@kernel.org> <87a5ufvefl.fsf@mail.lhotse> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87a5ufvefl.fsf@mail.lhotse> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230825_113348_786845_AB0D9B8E X-CRM114-Status: GOOD ( 30.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 25, 2023 at 04:11:58PM +1000, Michael Ellerman wrote: > Kees Cook writes: > > Doing a "make help" would show only hard-coded Kconfig targets and > > depended on the archhelp target to include ".config" targets. There was > > nothing showing global kernel/configs/ targets. Solve this by walking > > the wildcard list and include them in the output, using the first comment > > line as the help text. > > > > Update all Kconfig fragments to include help text and adjust archhelp > > targets to avoid redundancy. > > > > Adds the following section to "help" target output: > > > > Configuration fragment targets (for enabling various Kconfig items): > > debug.config - Debugging for CI systems and finding regressions > > kvm_guest.config - Bootable as a KVM guest > > nopm.config - Disable Power Management > > rust.config - Enable Rust > > tiny-base.config - Minimal options for tiny systems > > tiny.config - Smallest possible kernel image > > x86_debug.config - Debugging options for tip tree testing > > xen.config - Bootable as a Xen guest > > tiny.config - x86-specific options for a small kernel image > > xen.config - x86-specific options for a Xen virtualization guest > > I think we need a way to opt some files out. > > It's a bit ugly on powerpc because there are so many fragments: > > Configuration fragment targets (for enabling various Kconfig items): > debug.config - Debugging for CI systems and finding regressions > kvm_guest.config - Bootable as a KVM guest > nopm.config - Disable Power Management > rust.config - Enable Rust > tiny-base.config - Minimal options for tiny systems > tiny.config - Smallest possible kernel image > x86_debug.config - Debugging options for tip tree testing > xen.config - Bootable as a Xen guest > 32-bit.config - Build a 32-bit image > 64-bit.config - Build a 64-bit image > 85xx-32bit.config - Build a 32-bit 85xx image > 85xx-64bit.config - Build a 64-bit 85xx image > 85xx-hw.config - Base hardware support for 86xx > 85xx-smp.config - Enable SMP on 85xx > 86xx-hw.config - Base hardware support for 86xx > 86xx-smp.config - Enable SMP on 86xx > altivec.config - Enable Altivec support > be.config - Enable Big Endian mode > book3s_32.config - Base support for Book3s > corenet_base.config - Base support for corenet > debug.config - Enable PowerPC specific debug options > disable-werror.config - Disable -Werror > dpaa.config - Base suppot for DPPA > fsl-emb-nonhw.config - Non-hardware options common to 85xx and corenet > guest.config - PowerPC specific virtualization guest options > kvm_guest.config - Bootable as a KVM guest > le.config - Enable Little Endian mode > mpc85xx_base.config - Base mpc85xxx support > mpc86xx_base.config - Base mpc85xxx support > ppc64le.config - Enable ppc64le mode > security.config - Common security options for PowerPC builds > > And some of those are not intended for use with "make foo.config", > they're used internally for generating our "normal" defconfigs and they > don't necessarily work on their own. > > Also I'd like to add more fragments in future, to the point where nearly > all our configs are generated by them. > > Can we have some way to differentiate fragments that are intended to be > used with "make foo.config" vs just being used internally to generate > other configs. > > The obvious thing would be to use a different suffix, eg. "foo.fragment" > for internal use fragments. That would require changing > merge_into_defconfig and merge_into_defconfig_override to not assume the > .config suffix, and update the users in arm, arm64 and powerpc. > > The other option would be to ignore .config files starting with eg. "_". > > + @$(foreach c, $(filter-out $(call configfiles,_*.config),$(call configfiles,*.config)), \ > + printf " %-20s - %s\\n" \ > + $(shell basename $(c)) \ > + "$(subst # ,,$(shell grep -m1 '^# ' $(c)))";) > > Not sure which is preferable. Yeah, I wasn't too happy about some of these results. There seems to be three cases a fragment: - user-visible make target - used internally - arch-specific settings for a user-visible make target (redundant) Only the first should be visible. The trouble is that some user-visible targets are arch-specific. I think I like your idea of having both .config and .fragment... I'll give that a try and see how it looks. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel