From: Kees Cook <keescook@chromium.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
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"
Date: Fri, 25 Aug 2023 11:33:44 -0700 [thread overview]
Message-ID: <202308251123.D87F05DC@keescook> (raw)
In-Reply-To: <87a5ufvefl.fsf@mail.lhotse>
On Fri, Aug 25, 2023 at 04:11:58PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> 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
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
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"
Date: Fri, 25 Aug 2023 11:33:44 -0700 [thread overview]
Message-ID: <202308251123.D87F05DC@keescook> (raw)
In-Reply-To: <87a5ufvefl.fsf@mail.lhotse>
On Fri, Aug 25, 2023 at 04:11:58PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> 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-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-s390@vger.kernel.org, linux-kbuild@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org, linux-riscv@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] kbuild: Show Kconfig fragments in "help"
Date: Fri, 25 Aug 2023 11:33:44 -0700 [thread overview]
Message-ID: <202308251123.D87F05DC@keescook> (raw)
In-Reply-To: <87a5ufvefl.fsf@mail.lhotse>
On Fri, Aug 25, 2023 at 04:11:58PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> 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
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
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"
Date: Fri, 25 Aug 2023 11:33:44 -0700 [thread overview]
Message-ID: <202308251123.D87F05DC@keescook> (raw)
In-Reply-To: <87a5ufvefl.fsf@mail.lhotse>
On Fri, Aug 25, 2023 at 04:11:58PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> 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
next prev parent reply other threads:[~2023-08-25 18:34 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 22:36 [PATCH] kbuild: Show Kconfig fragments in "help" Kees Cook
2023-08-24 22:36 ` Kees Cook
2023-08-24 22:36 ` Kees Cook
2023-08-24 22:36 ` Kees Cook
2023-08-25 0:04 ` Randy Dunlap
2023-08-25 0:04 ` Randy Dunlap
2023-08-25 0:04 ` Randy Dunlap
2023-08-25 0:04 ` Randy Dunlap
2023-08-25 18:20 ` Kees Cook
2023-08-25 18:20 ` Kees Cook
2023-08-25 18:20 ` Kees Cook
2023-08-25 18:20 ` Kees Cook
2023-08-25 19:11 ` Randy Dunlap
2023-08-25 19:11 ` Randy Dunlap
2023-08-25 19:11 ` Randy Dunlap
2023-08-25 19:11 ` Randy Dunlap
2023-08-25 4:56 ` Christophe Leroy
2023-08-25 4:56 ` Christophe Leroy
2023-08-25 4:56 ` Christophe Leroy
2023-08-25 18:21 ` Kees Cook
2023-08-25 18:21 ` Kees Cook
2023-08-25 18:21 ` Kees Cook
2023-08-25 18:21 ` Kees Cook
2023-08-25 5:44 ` Nicolas Schier
2023-08-25 5:44 ` Nicolas Schier
2023-08-25 5:44 ` Nicolas Schier
2023-08-25 5:44 ` Nicolas Schier
2023-08-25 18:23 ` Kees Cook
2023-08-25 18:23 ` Kees Cook
2023-08-25 18:23 ` Kees Cook
2023-08-25 18:23 ` Kees Cook
2023-08-25 6:11 ` Michael Ellerman
2023-08-25 6:11 ` Michael Ellerman
2023-08-25 6:11 ` Michael Ellerman
2023-08-25 6:11 ` Michael Ellerman
2023-08-25 18:33 ` Kees Cook [this message]
2023-08-25 18:33 ` Kees Cook
2023-08-25 18:33 ` Kees Cook
2023-08-25 18:33 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308251123.D87F05DC@keescook \
--to=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=masahiroy@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.