Re: [PATCH v1 00/21] refactor Kconfig to consolidate KEXEC and CRASH options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Eric DeVolder <eric.devolder@xxxxxxxxxx>
- Subject: Re: [PATCH v1 00/21] refactor Kconfig to consolidate KEXEC and CRASH options
- From: Kees Cook <keescook@xxxxxxxxxxxx>
- Date: Tue, 13 Jun 2023 13:21:05 -0700
- Cc: linux@xxxxxxxxxxxxxxx, catalin.marinas@xxxxxxx, will@xxxxxxxxxx, chenhuacai@xxxxxxxxxx, geert@xxxxxxxxxxxxxx, tsbogend@xxxxxxxxxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, deller@xxxxxx, ysato@xxxxxxxxxxxxx, dalias@xxxxxxxx, glaubitz@xxxxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, 86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, kernel@xxxxxxxxxx, mpe@xxxxxxxxxxxxxx, npiggin@xxxxxxxxx, christophe.leroy@xxxxxxxxxx, paul.walmsley@xxxxxxxxxx, palmer@xxxxxxxxxxx, aou@xxxxxxxxxxxxxxxxx, hca@xxxxxxxxxxxxx, gor@xxxxxxxxxxxxx, agordeev@xxxxxxxxxxxxx, borntraeger@xxxxxxxxxxxxx, svens@xxxxxxxxxxxxx, hpa@xxxxxxxxx, paulmck@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, frederic@xxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, ardb@xxxxxxxxxx, samitolvanen@xxxxxxxxxx, juerg.haefliger@xxxxxxxxxxxxx, arnd@xxxxxxxx, rmk+kernel@xxxxxxxxxxxxxxx, linus.walleij@xxxxxxxxxx, sebastian.reichel@xxxxxxxxxxxxx, rppt@xxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, anshuman.khandual@xxxxxxx, ziy@xxxxxxxxxx, masahiroy@xxxxxxxxxx, ndesaulniers@xxxxxxxxxx, mhiramat@xxxxxxxxxx, ojeda@xxxxxxxxxx, thunder.leizhen@xxxxxxxxxx, xin3.li@xxxxxxxxx, tj@xxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, tsi@xxxxxxxxxx, bhe@xxxxxxxxxx, hbathini@xxxxxxxxxxxxx, sourabhjain@xxxxxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx
- In-reply-to: <20230612172805.681179-1-eric.devolder@oracle.com>
- References: <20230612172805.681179-1-eric.devolder@oracle.com>
On Mon, Jun 12, 2023 at 01:27:52PM -0400, Eric DeVolder wrote:
> The Kconfig is refactored to consolidate KEXEC and CRASH options from
> various arch/<arch>/Kconfig files into new file kernel/Kconfig.kexec.
This looks very nice!
> [...]
> - The boolean ARCH_HAS_<option> in effect allows the arch to determine
> when the feature is allowed. Archs which don't have the feature
> simply do not provide the corresponding ARCH_HAS_<option>.
> For each arch, where there previously were KEXEC and/or CRASH
> options, these have been replaced with the corresponding boolean
> ARCH_HAS_<option>, and an appropriate def_bool statement.
>
> For example, if the arch supports KEXEC_FILE, then the
> ARCH_HAS_KEXEC_FILE simply has a 'def_bool y'. This permits the
> KEXEC_FILE option to be available.
>
> If the arch has a 'depends on' statement in its original coding
> of the option, then that expression becomes part of the def_bool
> expression. For example, arm64 had:
>
> config KEXEC
> depends on PM_SLEEP_SMP
>
> and in this solution, this converts to:
>
> config ARCH_HAS_KEXEC
> def_bool PM_SLEEP_SMP
>
>
> - In order to account for the differences in the config coding for
> the three common options, the ARCH_SUPPORTS_<option> is used.
> This options has a 'depends on <option>' statement to couple it
> to the main option, and from there can insert the differences
> from the common option and the arch original coding of that option.
>
> For example, a few archs enable CRYPTO and CRYTPO_SHA256 for
> KEXEC_FILE. These require a ARCH_SUPPORTS_KEXEC_FILE and
> 'select CRYPTO' and 'select CRYPTO_SHA256' statements.
Naming nit: "HAS" and "SUPPORTS" feel very similar, and looking at
existing configs, "ARCH_SUPPORTS_..." is already used for doing this
kind of bare "bool" management. e.g. see ARCH_SUPPORTS_INT128
It looks like you need to split "depends" and "select" so the options
can be chosen separately from the "selectable" configs.
How about naming this ARCH_SELECTS_<option>, since that's what it's
there for?
-Kees
--
Kees Cook
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]