[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ilbpflsk.fsf@mail.lhotse>
Date: Thu, 15 Jun 2023 13:26:35 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Eric DeVolder <eric.devolder@...cle.com>,
Kees Cook <keescook@...omium.org>
Cc: linux@...linux.org.uk, catalin.marinas@....com, will@...nel.org,
chenhuacai@...nel.org, geert@...ux-m68k.org,
tsbogend@...ha.franken.de, James.Bottomley@...senpartnership.com,
deller@....de, ysato@...rs.sourceforge.jp, dalias@...c.org,
glaubitz@...sik.fu-berlin.de, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-ia64@...r.kernel.org, loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org, kernel@...0n.name, npiggin@...il.com,
christophe.leroy@...roup.eu, paul.walmsley@...ive.com,
palmer@...belt.com, aou@...s.berkeley.edu, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com, svens@...ux.ibm.com, hpa@...or.com,
paulmck@...nel.org, peterz@...radead.org, frederic@...nel.org,
akpm@...ux-foundation.org, ardb@...nel.org,
samitolvanen@...gle.com, juerg.haefliger@...onical.com,
arnd@...db.de, rmk+kernel@...linux.org.uk,
linus.walleij@...aro.org, sebastian.reichel@...labora.com,
rppt@...nel.org, kirill.shutemov@...ux.intel.com,
anshuman.khandual@....com, ziy@...dia.com, masahiroy@...nel.org,
ndesaulniers@...gle.com, mhiramat@...nel.org, ojeda@...nel.org,
thunder.leizhen@...wei.com, xin3.li@...el.com, tj@...nel.org,
gregkh@...uxfoundation.org, tsi@...oix.net, bhe@...hat.com,
hbathini@...ux.ibm.com, sourabhjain@...ux.ibm.com,
boris.ostrovsky@...cle.com, konrad.wilk@...cle.com
Subject: Re: [PATCH v1 00/21] refactor Kconfig to consolidate KEXEC and
CRASH options
Eric DeVolder <eric.devolder@...cle.com> writes:
> On 6/13/23 15:21, Kees Cook wrote:
>> 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!
>>
> Thank you Kees!
>
>>> [...]
>>> - 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?
>>
> I'm OK with this. Let's see if others agree?
Yeah please rename one or both of them. At a glance the difference
between HAS and SUPPORTS is very non-obvious.
I like Kees' suggestion to use ARCH_SUPPORTS and ARCH_SELECTS.
cheers
Powered by blists - more mailing lists