From: Eric DeVolder <hidden> Date: 2023-06-19 14:59:32
The Kconfig is refactored to consolidate KEXEC and CRASH options from
various arch/<arch>/Kconfig files into new file kernel/Kconfig.kexec.
The Kconfig.kexec is now a submenu titled "Kexec and crash features"
located under "General Setup".
The following options are impacted:
- KEXEC
- KEXEC_FILE
- KEXEC_SIG
- KEXEC_SIG_FORCE
- KEXEC_BZIMAGE_VERIFY_SIG
- KEXEC_JUMP
- CRASH_DUMP
Over time, these options have been copied between Kconfig files and
are very similar to one another, but with slight differences.
The following architectures are impacted by the refactor (because of
use of one or more KEXEC/CRASH options):
- arm
- arm64
- ia64
- loongarch
- m68k
- mips
- parisc
- powerpc
- riscv
- s390
- sh
- x86
More information:
In the patch series "crash: Kernel handling of CPU and memory hot
un/plug"
https://lore.kernel.org/lkml/20230503224145.7405-1-eric.devolder@oracle.com/
the new kernel feature introduces the config option CRASH_HOTPLUG.
In reviewing, Thomas Gleixner requested that the new config option
not be placed in x86 Kconfig. Rather the option needs a generic/common
home. To Thomas' point, the KEXEC and CRASH options have largely been
duplicated in the various arch/<arch>/Kconfig files, with minor
differences. This kind of proliferation is to be avoid/stopped.
https://lore.kernel.org/lkml/875y91yv63.ffs@tglx/
To that end, I have refactored the arch Kconfigs so as to consolidate
the various KEXEC and CRASH options. Generally speaking, this work has
the following themes:
- KEXEC and CRASH options are moved into new file kernel/Kconfig.kexec
- These items from arch/Kconfig:
CRASH_CORE KEXEC_CORE KEXEC_ELF HAVE_IMA_KEXEC
- These items from arch/x86/Kconfig form the common options:
KEXEC KEXEC_FILE KEXEC_SIG KEXEC_SIG_FORCE
KEXEC_BZIMAGE_VERIFY_SIG KEXEC_JUMP CRASH_DUMP
- The crash hotplug series appends CRASH_HOTPLUG to Kconfig.kexec
NOTE: PHYSICAL_START could be argued to be included in this series.
- The Kconfig.kexec is now a submenu titled "Kexec and crash features"
- The Kconfig.kexec is now listed in "General Setup" submenu from
init/Kconfig
- To control the main common options, new options ARCH_SUPPORTS_KEXEC,
ARCH_SUPPORTS_KEXEC_FILE and ARCH_SUPPORTS_CRASH_DUMP are introduced.
NOTE: The existing ARCH_HAS_KEXEC_PURGATORY remains unchanged.
- To account for the slight differences, new options ARCH_SELECTS_KEXEC,
ARCH_SELECTS_KEXEC_FILE and ARCH_SELECTS_CRASH_DUMP are used to
elicit the same side effects as the original arch/<arch>/Kconfig
files for KEXEC and CRASH options.
An example, 'make menuconfig' illustrating the submenu:
> General setup > Kexec and crash features
[*] Enable kexec system call
[*] Enable kexec file based system call
[*] Verify kernel signature during kexec_file_load() syscall
[ ] Require a valid signature in kexec_file_load() syscall
[ ] Enable bzImage signature verification support
[*] kexec jump
[*] kernel crash dumps
[*] Update the crash elfcorehdr on system configuration changes
The three main options are KEXEC, KEXEC_FILE and CRASH_DUMP. In the
process of consolidating these options, I encountered slight differences
in the coding of these options in several of the architectures. As a
result, I settled on the following solution:
- Each of three main options has a 'depends on ARCH_SUPPORTS_<option>'
statement: ARCH_SUPPORTS_KEXEC, ARCH_SUPPORTS_KEXEC_FILE,
ARCH_SUPPORTS_CRASH_DUMP.
For example, the KEXEC_FILE option has a 'depends on
ARCH_SUPPORTS_KEXEC_FILE' statement.
- The boolean ARCH_SUPPORTS_<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_SUPPORTS_<option>.
For each arch, where there previously were KEXEC and/or CRASH
options, these have been replaced with the corresponding boolean
ARCH_SUPPORTS_<option>, and an appropriate def_bool statement.
For example, if the arch supports KEXEC_FILE, then the
ARCH_SUPPORTS_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_SUPPORTS_KEXEC
def_bool PM_SLEEP_SMP
- In order to account for the differences in the config coding for
the three common options, the ARCH_SELECTS_<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_SELECTS_KEXEC_FILE and
'select CRYPTO' and 'select CRYPTO_SHA256' statements.
Illustrating the option relationships:
For KEXEC:
ARCH_SUPPORTS_KEXEC <- KEXEC <- ARCH_SELECTS_KEXEC
KEXEC # in Kconfig.kexec
ARCH_SUPPORTS_KEXEC # in arch/<arch>/Kconfig, as needed
ARCH_SELECTS_KEXEC # in arch/<arch>/Kconfig, as needed
For KEXEC_FILE:
ARCH_SUPPORTS_KEXEC_FILE <- KEXEC_FILE <- ARCH_SELECTS_KEXEC_FILE
KEXEC_FILE # in Kconfig.kexec
ARCH_SUPPORTS_KEXEC_FILE # in arch/<arch>/Kconfig, as needed
ARCH_SELECTS_KEXEC_FILE # in arch/<arch>/Kconfig, as needed
For CRASH:
ARCH_SUPPORTS_CRASH_DUMP <- CRASH_DUMP <- ARCH_SELECTS_CRASH_DUMP
CRASH_DUMP # in Kconfig.kexec
ARCH_SUPPORTS_CRASH_DUMP # in arch/<arch>/Kconfig, as needed
ARCH_SELECTS_CRASH_DUMP # in arch/<arch>/Kconfig, as needed
To summarize, the ARCH_SUPPORTS_<option> permits the <option> to be
enabled, and the ARCH_SELECTS_<option> handles side effects (ie.
select statements).
Examples:
A few examples to show the new strategy in action:
===== x86 (minus the help section) =====
Original:
config KEXEC
bool "kexec system call"
select KEXEC_CORE
config KEXEC_FILE
bool "kexec file based system call"
select KEXEC_CORE
select HAVE_IMA_KEXEC if IMA
depends on X86_64
depends on CRYPTO=y
depends on CRYPTO_SHA256=y
config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE
config KEXEC_SIG
bool "Verify kernel signature during kexec_file_load() syscall"
depends on KEXEC_FILE
config KEXEC_SIG_FORCE
bool "Require a valid signature in kexec_file_load() syscall"
depends on KEXEC_SIG
config KEXEC_BZIMAGE_VERIFY_SIG
bool "Enable bzImage signature verification support"
depends on KEXEC_SIG
depends on SIGNED_PE_FILE_VERIFICATION
select SYSTEM_TRUSTED_KEYRING
config CRASH_DUMP
bool "kernel crash dumps"
depends on X86_64 || (X86_32 && HIGHMEM)
config KEXEC_JUMP
bool "kexec jump"
depends on KEXEC && HIBERNATION
help
becomes...
New:
config ARCH_SUPPORTS_KEXEC
def_bool y
config ARCH_SUPPORTS_KEXEC_FILE
def_bool X86_64 && CRYPTO && CRYPTO_SHA256
config ARCH_SELECTS_KEXEC_FILE
def_bool y
depends on KEXEC_FILE
select HAVE_IMA_KEXEC if IMA
config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE
config ARCH_SUPPORTS_KEXEC_JUMP
def_bool y
config ARCH_SUPPORTS_CRASH_DUMP
def_bool X86_64 || (X86_32 && HIGHMEM)
===== powerpc (minus the help section) =====
Original:
config KEXEC
bool "kexec system call"
depends on PPC_BOOK3S || PPC_E500 || (44x && !SMP)
select KEXEC_CORE
config KEXEC_FILE
bool "kexec file based system call"
select KEXEC_CORE
select HAVE_IMA_KEXEC if IMA
select KEXEC_ELF
depends on PPC64
depends on CRYPTO=y
depends on CRYPTO_SHA256=y
config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE
config CRASH_DUMP
bool "Build a dump capture kernel"
depends on PPC64 || PPC_BOOK3S_32 || PPC_85xx || (44x && !SMP)
select RELOCATABLE if PPC64 || 44x || PPC_85xx
becomes...
New:
config ARCH_SUPPORTS_KEXEC
def_bool PPC_BOOK3S || PPC_E500 || (44x && !SMP)
config ARCH_SUPPORTS_KEXEC_FILE
def_bool PPC64 && CRYPTO=y && CRYPTO_SHA256=y
config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE
config ARCH_SELECTS_KEXEC_FILE
def_bool y
depends on KEXEC_FILE
select KEXEC_ELF
select HAVE_IMA_KEXEC if IMA
config ARCH_SUPPORTS_CRASH_DUMP
def_bool PPC64 || PPC_BOOK3S_32 || PPC_85xx || (44x && !SMP)
config ARCH_SELECTS_CRASH_DUMP
def_bool y
depends on CRASH_DUMP
select RELOCATABLE if PPC64 || 44x || PPC_85xx
Testing Approach and Results
There are 388 config files in the arch/<arch>/configs directories.
For each of these config files, a .config is generated both before and
after this Kconfig series, and checked for equivalence. This approach
allows for a rather rapid check of all architectures and a wide
variety of configs wrt/ KEXEC and CRASH, and avoids requiring
compiling for all architectures and running kernels and run-time
testing.
As such, I developed the following script to compare the before and
after of 'make olddefconfig'. The new symbols introduced by this
series are filtered out, but otherwise the config files are PASS
only if they were equivalent, and FAIL otherwise.
The script performs the test by doing the following:
# Obtain the "golden" .config output for given config file
# Reset test sandbox
git checkout master
git branch -D test_Kconfig
git checkout -B test_Kconfig master
make distclean
# Write out updated config
cp -f <config file> .config
make ARCH=<arch> olddefconfig
# Track each item in .config, LHSB is "golden"
scoreboard .config
# Obtain the "changed" .config output for given config file
# Reset test sandbox
make distclean
# Apply this Kconfig series
git am <this Kconfig series>
# Write out updated config
cp -f <config file> .config
make ARCH=<arch> olddefconfig
# Track each item in .config, RHSB is "changed"
scoreboard .config
# Determine test result
# Filter-out new symbols introduced by this series
# Filter-out symbol=n which not in either scoreboard
# Compare LHSB "golden" and RHSB "changed" scoreboards and issue PASS/FAIL
The script was instrumental during the refactoring of Kconfig as it
continually revealed problems. The end result being that the solution
presented in this series passes all configs as checked by the script.
Regards,
eric
---
v2: 19jun2023
- The ARCH_HAS_ and ARCH_SUPPORTS_ combination was found to be
too similar. Renamed these two new options as such:
ARCH_HAS_<option> ---> ARCH_SUPPORTS_<option>
ARCH_SUPPORTS_<option> ---> ARCH_SELECTS_<option>
Per Kees Cook, Michael Ellerman
NOTE: ARCH_HAS_KEXEC_PURGATORY was left as-is, as that is what
it is prior to this series.
Updated this cover letter to reflect the same.
- Some minor cleaning up of the help sections, per Zhen Lei and
Alexander Gordeev.
- Removed the MODULE_SIG_FORMAT dependency from KEXEC_SIG in
kernel/Kconfig.kexec. Only s390 had it prior to this series.
See also commit message in
"s390/kexec: refactor for kernel/Kconfig.kexec"
- Added to Kconfig.kexec the KEXEC_IMAGE_VERIFY_SIG from arm64,
per Zhen Lei.
- Fixed the powerpc ARCH_SUPPORTS_KEXEC_FILE conversion, per
Michael Ellerman.
v1: 12jun2023
https://lore.kernel.org/lkml/20230612172805.681179-1-eric.devolder@oracle.com/
- Initial
- Based on 6.4.0-rc6
---
Eric DeVolder (13):
kexec: consolidate kexec and crash options into kernel/Kconfig.kexec
x86/kexec: refactor for kernel/Kconfig.kexec
arm/kexec: refactor for kernel/Kconfig.kexec
ia64/kexec: refactor for kernel/Kconfig.kexec
arm64/kexec: refactor for kernel/Kconfig.kexec
loongarch/kexec: refactor for kernel/Kconfig.kexec
m68k/kexec: refactor for kernel/Kconfig.kexec
mips/kexec: refactor for kernel/Kconfig.kexec
parisc/kexec: refactor for kernel/Kconfig.kexec
powerpc/kexec: refactor for kernel/Kconfig.kexec
riscv/kexec: refactor for kernel/Kconfig.kexec
s390/kexec: refactor for kernel/Kconfig.kexec
sh/kexec: refactor for kernel/Kconfig.kexec
arch/Kconfig | 13 -----
arch/arm/Kconfig | 29 ++---------
arch/arm64/Kconfig | 62 +++++------------------
arch/ia64/Kconfig | 28 ++---------
arch/loongarch/Kconfig | 26 +++-------
arch/m68k/Kconfig | 19 +------
arch/mips/Kconfig | 32 ++----------
arch/parisc/Kconfig | 34 +++++--------
arch/powerpc/Kconfig | 55 +++++++--------------
arch/riscv/Kconfig | 48 ++++++------------
arch/s390/Kconfig | 65 +++++++-----------------
arch/sh/Kconfig | 46 +++--------------
arch/x86/Kconfig | 89 +++++----------------------------
init/Kconfig | 2 +
kernel/Kconfig.kexec | 110 +++++++++++++++++++++++++++++++++++++++++
15 files changed, 229 insertions(+), 429 deletions(-)
create mode 100644 kernel/Kconfig.kexec
--
2.31.1
From: Eric DeVolder <hidden> Date: 2023-06-19 14:59:24
The config options for kexec and crash features are consolidated
into new file kernel/Kconfig.kexec. Under the "General Setup" submenu
is a new submenu "Kexec and crash handling" where all the kexec and
crash options that were once in the arch-dependent submenu "Processor
type and features" are now consolidated.
The following options are impacted:
- KEXEC
- KEXEC_FILE
- KEXEC_SIG
- KEXEC_SIG_FORCE
- KEXEC_BZIMAGE_VERIFY_SIG
- KEXEC_JUMP
- CRASH_DUMP
The three main options are KEXEC, KEXEC_FILE and CRASH_DUMP.
Architectures specify support of certain KEXEC and CRASH features with
similarly named new ARCH_SUPPORTS_<option> config options.
Architectures can utilize the new ARCH_SELECTS_<option> config
options to specify additional components when <option> is enabled.
To summarize, the ARCH_SUPPORTS_<option> permits the <option> to be
enabled, and the ARCH_SELECTS_<option> handles side effects (ie.
select statements).
Signed-off-by: Eric DeVolder <redacted>
---
arch/Kconfig | 13 -----
init/Kconfig | 2 +
kernel/Kconfig.kexec | 110 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 112 insertions(+), 13 deletions(-)
create mode 100644 kernel/Kconfig.kexec
From: Eric DeVolder <hidden> Date: 2023-06-19 14:59:30
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/x86/Kconfig | 89 +++++++-----------------------------------------
1 file changed, 13 insertions(+), 76 deletions(-)
@@ -2043,88 +2043,25 @@ config EFI_RUNTIME_MAPsource"kernel/Kconfig.hz"-configKEXEC-bool"kexec system call"-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Thenamecomesfromthesimilaritytotheexecsystemcall.--Itisanongoingprocesstobecertainthehardwareinamachine-isproperlyshutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.Asofthiswritingtheexacthardware-interfaceisstronglyinflux,sonogoodrecommendationcanbe-made.--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-selectHAVE_IMA_KEXECifIMA-depends onX86_64-depends onCRYPTO=y-depends onCRYPTO_SHA256=y-help-Thisisnewversionofkexecsystemcall.Thissystemcallis-filebasedandtakesfiledescriptorsassystemcallargument-forkernelandinitramfsasopposedtolistofsegmentsas-acceptedbyprevioussystemcall.+configARCH_SUPPORTS_KEXEC+def_booly-configARCH_HAS_KEXEC_PURGATORY-def_boolKEXEC_FILE+configARCH_SUPPORTS_KEXEC_FILE+def_boolX86_64&&CRYPTO&&CRYPTO_SHA256-configKEXEC_SIG-bool"Verify kernel signature during kexec_file_load() syscall"+configARCH_SELECTS_KEXEC_FILE+def_boolydepends onKEXEC_FILE-help--Thisoptionmakesthekexec_file_load()syscallcheckforavalid-signatureofthekernelimage.Theimagecanstillbeloadedwithout-avalidsignatureunlessyoualsoenableKEXEC_SIG_FORCE,thoughif-there'sasignaturethatwecancheck,thenitmustbevalid.--Inadditiontothisoption,youneedtoenablesignature-verificationforthecorrespondingkernelimagetypebeing-loadedinorderforthistowork.--configKEXEC_SIG_FORCE-bool"Require a valid signature in kexec_file_load() syscall"-depends onKEXEC_SIG-help-Thisoptionmakeskernelsignatureverificationmandatoryfor-thekexec_file_load()syscall.+selectHAVE_IMA_KEXECifIMA-configKEXEC_BZIMAGE_VERIFY_SIG-bool"Enable bzImage signature verification support"-depends onKEXEC_SIG-depends onSIGNED_PE_FILE_VERIFICATION-selectSYSTEM_TRUSTED_KEYRING-help-EnablebzImagesignatureverificationsupport.+configARCH_HAS_KEXEC_PURGATORY+def_boolKEXEC_FILE-configCRASH_DUMP-bool"kernel crash dumps"-depends onX86_64||(X86_32&&HIGHMEM)-help-Generatecrashdumpafterbeingstartedbykexec.-Thisshouldbenormallyonlysetinspecialcrashdumpkernels-whichareloadedinthemainkernelwithkexec-toolsinto-aspeciallyreservedregionandthenlaterexecutedafter-acrashbykdump/kexec.Thecrashdumpkernelmustbecompiled-toamemoryaddressnotusedbythemainkernelorBIOSusing-PHYSICAL_START,oritmustbebuiltasarelocatableimage-(CONFIG_RELOCATABLE=y).-FormoredetailsseeDocumentation/admin-guide/kdump/kdump.rst+configARCH_SUPPORTS_KEXEC_JUMP+def_booly-configKEXEC_JUMP-bool"kexec jump"-depends onKEXEC&&HIBERNATION-help-Jumpbetweenoriginalkernelandkexecedkernelandinvoke-codeinphysicaladdressmodeviaKEXEC+configARCH_SUPPORTS_CRASH_DUMP+def_boolX86_64||(X86_32&&HIGHMEM)configPHYSICAL_STARThex"Physical address where the kernel is loaded"if(EXPERT||CRASH_DUMP)
+config ARCH_SELECTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
- help
I am a little confused about this ARCH_SELECTS_XX adding. Wondering what
limits us defining the ARCH_SUPPORTS_KEXEC_FILE like below? I have limited
knowledge about Kconfig, please correct me if I am wrong. Thanks in
advance.
+config ARCH_SUPPORTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
depends on X86_64 && CRYPTO && CRYPTO_SHA256
-
- This option makes the kexec_file_load() syscall check for a valid
- signature of the kernel image. The image can still be loaded without
- a valid signature unless you also enable KEXEC_SIG_FORCE, though if
- there's a signature that we can check, then it must be valid.
-
- In addition to this option, you need to enable signature
- verification for the corresponding kernel image type being
- loaded in order for this to work.
-
+config ARCH_SELECTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
- help
I am a little confused about this ARCH_SELECTS_XX adding. Wondering what
limits us defining the ARCH_SUPPORTS_KEXEC_FILE like below? I have limited
knowledge about Kconfig, please correct me if I am wrong. Thanks in
advance.
+config ARCH_SUPPORTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
depends on X86_64 && CRYPTO && CRYPTO_SHA256
For the ARCH_SUPPORTS_ options, I chose to list the dependencies on the def_bool line to show that
it took all those conditions to result in True.
However, as you point out, using a def_bool y and then listing them as 'depends on' works as well.
Probably would have resulted in fewer changes to the Kconfig file.
Either way is ok (the 'depends on KEXEC_FILE' is erroneous in your example).
eric
quoted
-
- This option makes the kexec_file_load() syscall check for a valid
- signature of the kernel image. The image can still be loaded without
- a valid signature unless you also enable KEXEC_SIG_FORCE, though if
- there's a signature that we can check, then it must be valid.
-
- In addition to this option, you need to enable signature
- verification for the corresponding kernel image type being
- loaded in order for this to work.
-
+config ARCH_SELECTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
- help
I am a little confused about this ARCH_SELECTS_XX adding. Wondering what
limits us defining the ARCH_SUPPORTS_KEXEC_FILE like below? I have limited
knowledge about Kconfig, please correct me if I am wrong. Thanks in
advance.
+config ARCH_SUPPORTS_KEXEC_FILE
+ def_bool y
depends on KEXEC_FILE
depends on X86_64 && CRYPTO && CRYPTO_SHA256
For the ARCH_SUPPORTS_ options, I chose to list the dependencies on the
def_bool line to show that it took all those conditions to result in True.
However, as you point out, using a def_bool y and then listing them as 'depends on' works as well.
Probably would have resulted in fewer changes to the Kconfig file.
Either way is ok (the 'depends on KEXEC_FILE' is erroneous in your example).
Got it, thanks. To me, one option with explicit dependencies looks clearer
and straightforward. I need check and investigage why two options are needed,
whether two options are unavoidable. Not sure if other people would get
the same feeling or not. Honestly, it's my first time to see the usage of
XXX_SELECTS_XXX, it took me a while to dig into.
quoted
quoted
-
- This option makes the kexec_file_load() syscall check for a valid
- signature of the kernel image. The image can still be loaded without
- a valid signature unless you also enable KEXEC_SIG_FORCE, though if
- there's a signature that we can check, then it must be valid.
-
- In addition to this option, you need to enable signature
- verification for the corresponding kernel image type being
- loaded in order for this to work.
-
From: Eric DeVolder <hidden> Date: 2023-06-19 14:59:40
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Kconfig | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:10
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/arm64/Kconfig | 62 +++++++++-------------------------------------
1 file changed, 12 insertions(+), 50 deletions(-)
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:15
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/parisc/Kconfig | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
@@ -348,29 +348,17 @@ config NR_CPUSdefault"4"if64BITdefault"16"-configKEXEC-bool"Kexec system call"-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Itisanongoingprocesstobecertainthehardwareinamachine-shutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-selectKEXEC_ELF-help-Thisenablesthekexec_file_load()Systemcall.Thisis-filebasedandtakesfiledescriptorsassystemcallargument-forkernelandinitramfsasopposedtolistofsegmentsas-acceptedbyprevioussystemcall.-endmenu+configARCH_SUPPORTS_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC_FILE+def_booly++configARCH_SELECTS_KEXEC_FILE+def_booly+depends onKEXEC_FILE+selectKEXEC_ELF+source"drivers/parisc/Kconfig"
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:20
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/sh/Kconfig | 46 ++++++++--------------------------------------
1 file changed, 8 insertions(+), 38 deletions(-)
@@ -546,44 +546,14 @@ menu "Kernel features"source"kernel/Kconfig.hz"-configKEXEC-bool"kexec system call (EXPERIMENTAL)"-depends onMMU-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Thenamecomesfromthesimilaritytotheexecsystemcall.--Itisanongoingprocesstobecertainthehardwareinamachine-isproperlyshutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.Asofthiswritingtheexacthardware-interfaceisstronglyinflux,sonogoodrecommendationcanbe-made.--configCRASH_DUMP-bool"kernel crash dumps (EXPERIMENTAL)"-depends onBROKEN_ON_SMP-help-Generatecrashdumpafterbeingstartedbykexec.-Thisshouldbenormallyonlysetinspecialcrashdumpkernels-whichareloadedinthemainkernelwithkexec-toolsinto-aspeciallyreservedregionandthenlaterexecutedafter-acrashbykdump/kexec.Thecrashdumpkernelmustbecompiled-toamemoryaddressnotusedbythemainkernelusing-PHYSICAL_START.--FormoredetailsseeDocumentation/admin-guide/kdump/kdump.rst--configKEXEC_JUMP-bool"kexec jump (EXPERIMENTAL)"-depends onKEXEC&&HIBERNATION-help-Jumpbetweenoriginalkernelandkexecedkernelandinvoke-codeviaKEXEC+configARCH_SUPPORTS_KEXEC+def_boolMMU++configARCH_SUPPORTS_CRASH_DUMP+def_boolBROKEN_ON_SMP++configARCH_SUPPORTS_KEXEC_JUMP+def_boolyconfigPHYSICAL_STARThex"Physical address where the kernel is loaded"if(EXPERT||CRASH_DUMP)
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Date: 2023-06-19 18:22:46
Hi Eric!
On Mon, 2023-06-19 at 10:58 -0400, Eric DeVolder wrote:
quoted hunk
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/sh/Kconfig | 46 ++++++++--------------------------------------
1 file changed, 8 insertions(+), 38 deletions(-)
@@ -546,44 +546,14 @@ menu "Kernel features"source"kernel/Kconfig.hz"-configKEXEC-bool"kexec system call (EXPERIMENTAL)"-depends onMMU-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Thenamecomesfromthesimilaritytotheexecsystemcall.--Itisanongoingprocesstobecertainthehardwareinamachine-isproperlyshutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.Asofthiswritingtheexacthardware-interfaceisstronglyinflux,sonogoodrecommendationcanbe-made.--configCRASH_DUMP-bool"kernel crash dumps (EXPERIMENTAL)"-depends onBROKEN_ON_SMP-help-Generatecrashdumpafterbeingstartedbykexec.-Thisshouldbenormallyonlysetinspecialcrashdumpkernels-whichareloadedinthemainkernelwithkexec-toolsinto-aspeciallyreservedregionandthenlaterexecutedafter-acrashbykdump/kexec.Thecrashdumpkernelmustbecompiled-toamemoryaddressnotusedbythemainkernelusing-PHYSICAL_START.--FormoredetailsseeDocumentation/admin-guide/kdump/kdump.rst--configKEXEC_JUMP-bool"kexec jump (EXPERIMENTAL)"-depends onKEXEC&&HIBERNATION-help-Jumpbetweenoriginalkernelandkexecedkernelandinvoke-codeviaKEXEC+configARCH_SUPPORTS_KEXEC+def_boolMMU++configARCH_SUPPORTS_CRASH_DUMP+def_boolBROKEN_ON_SMP++configARCH_SUPPORTS_KEXEC_JUMP+def_boolyconfigPHYSICAL_STARThex"Physical address where the kernel is loaded"if(EXPERT||CRASH_DUMP)
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:29
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO. This occurs due to any path through KEXEC_SIG
attempting to select CRYPTO is ultimately dependent upon CRYPTO:
CRYPTO
<- ARCH_SUPPORTS_KEXEC_FILE
<- KEXEC_FILE
<- KEXEC_SIG
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
for KEXEC_SIG. In practice, however, MODULE_SIG_FORMAT is still
configured-in as the use of KEXEC_SIG is in step with the use of
SYSTEM_DATA_VERIFICATION, which does select MODULE_SIG_FORMAT.
Not ideal, but results in equivalent .config files for s390.
Signed-off-by: Eric DeVolder <redacted>
---
arch/s390/Kconfig | 65 ++++++++++++++---------------------------------
1 file changed, 19 insertions(+), 46 deletions(-)
@@ -243,6 +243,25 @@ config PGTABLE_LEVELSsource"kernel/livepatch/Kconfig"+configARCH_DEFAULT_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC_FILE+def_boolCRYPTO&&CRYPTO_SHA256&&CRYPTO_SHA256_S390++configARCH_HAS_KEXEC_PURGATORY+def_boolKEXEC_FILE++configARCH_SUPPORTS_CRASH_DUMP+def_booly+help+Referto<file:Documentation/s390/zfcpdump.rst>formoredetailsonthis.+Thisoptionalsoenabless390zfcpdump.+Seealso<file:Documentation/s390/zfcpdump.rst>+menu"Processor type and features"configHAVE_MARCH_Z10_FEATURES
@@ -481,36 +500,6 @@ config SCHED_TOPOLOGYsource"kernel/Kconfig.hz"-configKEXEC-def_booly-selectKEXEC_CORE--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-depends onCRYPTO-depends onCRYPTO_SHA256-depends onCRYPTO_SHA256_S390-help-Enablethekexecfilebasedsystemcall.Incontrasttothenormal-kexecsystemcallthissystemcalltakesfiledescriptorsforthe-kernelandinitramfsasarguments.--configARCH_HAS_KEXEC_PURGATORY-def_booly-depends onKEXEC_FILE--configKEXEC_SIG-bool"Verify kernel signature during kexec_file_load() syscall"-depends onKEXEC_FILE&&MODULE_SIG_FORMAT-help-Thisoptionmakeskernelsignatureverificationmandatoryfor-thekexec_file_load()syscall.--Inadditiontothatoption,youneedtoenablesignature-verificationforthecorrespondingkernelimagetypebeing-loadedinorderforthistowork.-configKERNEL_NOBPdef_boolnprompt"Enable modified branch prediction for the kernel by default"
From: Alexander Gordeev <agordeev@linux.ibm.com> Date: 2023-06-21 05:02:43
On Mon, Jun 19, 2023 at 10:58:00AM -0400, Eric DeVolder wrote:
Hi Eric,
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO. This occurs due to any path through KEXEC_SIG
attempting to select CRYPTO is ultimately dependent upon CRYPTO:
CRYPTO
<- ARCH_SUPPORTS_KEXEC_FILE
<- KEXEC_FILE
<- KEXEC_SIG
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
for KEXEC_SIG. In practice, however, MODULE_SIG_FORMAT is still
configured-in as the use of KEXEC_SIG is in step with the use of
SYSTEM_DATA_VERIFICATION, which does select MODULE_SIG_FORMAT.
No, it is actually the other way around.
Could you please provide the correct explanation?
AFAICT the MODULE_SIG_FORMAT dependency was introduced with commit
c8424e776b09 ("MODSIGN: Export module signature definitions") and
in fact was not necessary, since s390 did/does not use mod_check_sig()
anyway. So the SYSTEM_DATA_VERIFICATION could have left intact.
However, the original SYSTEM_DATA_VERIFICATION seems sane and I do
not understand why other architectures do not have it also? May be
Mimi Zohar (putting on CC) could explain that?
It looks like such dependency actually exists in implicit form
(which you picked from x86):
In addition to this option, you need to enable signature
verification for the corresponding kernel image type being
loaded in order for this to work.
Does it mean that if an architecture did not enable the signature
verification type explicitly the linker could fail - both before
and after you series?
Thanks!
quoted hunk
Not ideal, but results in equivalent .config files for s390.
Signed-off-by: Eric DeVolder <redacted>
---
arch/s390/Kconfig | 65 ++++++++++++++---------------------------------
1 file changed, 19 insertions(+), 46 deletions(-)
@@ -243,6 +243,25 @@ config PGTABLE_LEVELSsource"kernel/livepatch/Kconfig"+configARCH_DEFAULT_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC_FILE+def_boolCRYPTO&&CRYPTO_SHA256&&CRYPTO_SHA256_S390++configARCH_HAS_KEXEC_PURGATORY+def_boolKEXEC_FILE++configARCH_SUPPORTS_CRASH_DUMP+def_booly+help+Referto<file:Documentation/s390/zfcpdump.rst>formoredetailsonthis.+Thisoptionalsoenabless390zfcpdump.+Seealso<file:Documentation/s390/zfcpdump.rst>+menu"Processor type and features"configHAVE_MARCH_Z10_FEATURES
@@ -481,36 +500,6 @@ config SCHED_TOPOLOGYsource"kernel/Kconfig.hz"-configKEXEC-def_booly-selectKEXEC_CORE--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-depends onCRYPTO-depends onCRYPTO_SHA256-depends onCRYPTO_SHA256_S390-help-Enablethekexecfilebasedsystemcall.Incontrasttothenormal-kexecsystemcallthissystemcalltakesfiledescriptorsforthe-kernelandinitramfsasarguments.--configARCH_HAS_KEXEC_PURGATORY-def_booly-depends onKEXEC_FILE--configKEXEC_SIG-bool"Verify kernel signature during kexec_file_load() syscall"-depends onKEXEC_FILE&&MODULE_SIG_FORMAT-help-Thisoptionmakeskernelsignatureverificationmandatoryfor-thekexec_file_load()syscall.--Inadditiontothatoption,youneedtoenablesignature-verificationforthecorrespondingkernelimagetypebeing-loadedinorderforthistowork.-configKERNEL_NOBPdef_boolnprompt"Enable modified branch prediction for the kernel by default"
From: Eric DeVolder <hidden> Date: 2023-06-21 17:11:57
On 6/21/23 00:00, Alexander Gordeev wrote:
On Mon, Jun 19, 2023 at 10:58:00AM -0400, Eric DeVolder wrote:
Hi Eric,
quoted
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO. This occurs due to any path through KEXEC_SIG
attempting to select CRYPTO is ultimately dependent upon CRYPTO:
CRYPTO
<- ARCH_SUPPORTS_KEXEC_FILE
<- KEXEC_FILE
<- KEXEC_SIG
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
for KEXEC_SIG. In practice, however, MODULE_SIG_FORMAT is still
configured-in as the use of KEXEC_SIG is in step with the use of
SYSTEM_DATA_VERIFICATION, which does select MODULE_SIG_FORMAT.
No, it is actually the other way around.
Could you please provide the correct explanation?
AFAICT the MODULE_SIG_FORMAT dependency was introduced with commit
c8424e776b09 ("MODSIGN: Export module signature definitions") and
in fact was not necessary, since s390 did/does not use mod_check_sig()
anyway. So the SYSTEM_DATA_VERIFICATION could have left intact.
Thomas, would the correct explanation be simply indicating that MODULE_SIG_FORMAT isn't needed as it
is not used by s390 (crediting your summary above)?
However, the original SYSTEM_DATA_VERIFICATION seems sane and I do
not understand why other architectures do not have it also? May be
Mimi Zohar (putting on CC) could explain that?
It looks like such dependency actually exists in implicit form
(which you picked from x86):
In addition to this option, you need to enable signature
verification for the corresponding kernel image type being
loaded in order for this to work.
Does it mean that if an architecture did not enable the signature
verification type explicitly the linker could fail - both before
and after you series?
As a quick test I checked x86 and it compiles/links ok if KEXEC_SIG and KEXEC_SIG_FORCE are
configured-in, but KEXEC_BZIMAGE_VERIFY_SIG (used for x86 sig verify) is not. The reason being that
the kexec_image_verify_sig() function checks if the fops.verify_sig is non-NULL before invoking the
verification. If it is NULL, the sig check fails. This would appear to be valid outcome for other
archs as well.
At any rate, I think attempting to determine if other archs need SYSTEM_DATA_VERIFICATION is out of
the scope of this series; I'm targeting just the refactor to be equivalent to what is what prior.
Thanks for looking at this!
eric
Thanks!
quoted
Not ideal, but results in equivalent .config files for s390.
Signed-off-by: Eric DeVolder <redacted>
---
arch/s390/Kconfig | 65 ++++++++++++++---------------------------------
1 file changed, 19 insertions(+), 46 deletions(-)
@@ -243,6 +243,25 @@ config PGTABLE_LEVELSsource"kernel/livepatch/Kconfig"+configARCH_DEFAULT_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC+def_booly++configARCH_SUPPORTS_KEXEC_FILE+def_boolCRYPTO&&CRYPTO_SHA256&&CRYPTO_SHA256_S390++configARCH_HAS_KEXEC_PURGATORY+def_boolKEXEC_FILE++configARCH_SUPPORTS_CRASH_DUMP+def_booly+help+Referto<file:Documentation/s390/zfcpdump.rst>formoredetailsonthis.+Thisoptionalsoenabless390zfcpdump.+Seealso<file:Documentation/s390/zfcpdump.rst>+menu"Processor type and features"configHAVE_MARCH_Z10_FEATURES
@@ -481,36 +500,6 @@ config SCHED_TOPOLOGYsource"kernel/Kconfig.hz"-configKEXEC-def_booly-selectKEXEC_CORE--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-depends onCRYPTO-depends onCRYPTO_SHA256-depends onCRYPTO_SHA256_S390-help-Enablethekexecfilebasedsystemcall.Incontrasttothenormal-kexecsystemcallthissystemcalltakesfiledescriptorsforthe-kernelandinitramfsasarguments.--configARCH_HAS_KEXEC_PURGATORY-def_booly-depends onKEXEC_FILE--configKEXEC_SIG-bool"Verify kernel signature during kexec_file_load() syscall"-depends onKEXEC_FILE&&MODULE_SIG_FORMAT-help-Thisoptionmakeskernelsignatureverificationmandatoryfor-thekexec_file_load()syscall.--Inadditiontothatoption,youneedtoenablesignature-verificationforthecorrespondingkernelimagetypebeing-loadedinorderforthistowork.-configKERNEL_NOBPdef_boolnprompt"Enable modified branch prediction for the kernel by default"
From: Alexander Gordeev <agordeev@linux.ibm.com> Date: 2023-06-22 16:25:46
On Wed, Jun 21, 2023 at 12:10:49PM -0500, Eric DeVolder wrote:
Hi Eric,
...
quoted
quoted
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO. This occurs due to any path through KEXEC_SIG
attempting to select CRYPTO is ultimately dependent upon CRYPTO:
CRYPTO
<- ARCH_SUPPORTS_KEXEC_FILE
<- KEXEC_FILE
<- KEXEC_SIG
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
for KEXEC_SIG. In practice, however, MODULE_SIG_FORMAT is still
configured-in as the use of KEXEC_SIG is in step with the use of
SYSTEM_DATA_VERIFICATION, which does select MODULE_SIG_FORMAT.
No, it is actually the other way around.
Could you please provide the correct explanation?
AFAICT the MODULE_SIG_FORMAT dependency was introduced with commit
c8424e776b09 ("MODSIGN: Export module signature definitions") and
in fact was not necessary, since s390 did/does not use mod_check_sig()
anyway. So the SYSTEM_DATA_VERIFICATION could have left intact.
Thomas, would the correct explanation be simply indicating that
MODULE_SIG_FORMAT isn't needed as it is not used by s390 (crediting your
summary above)?
I guess, you asked me? Anyway, I will try to answer as if I were Thomas :)
MODULE_SIG_FORMAT is needed to select SYSTEM_DATA_VERIFICATION.
But SYSTEM_DATA_VERIFICATION is also selected by FS_VERITY*, so
dropping MODULE_SIG_FORMAT does not hurt.
Thanks!
From: Eric DeVolder <hidden> Date: 2023-06-22 17:53:17
On 6/22/23 11:24, Alexander Gordeev wrote:
On Wed, Jun 21, 2023 at 12:10:49PM -0500, Eric DeVolder wrote:
Hi Eric,
...
quoted
quoted
quoted
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO. This occurs due to any path through KEXEC_SIG
attempting to select CRYPTO is ultimately dependent upon CRYPTO:
CRYPTO
<- ARCH_SUPPORTS_KEXEC_FILE
<- KEXEC_FILE
<- KEXEC_SIG
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
for KEXEC_SIG. In practice, however, MODULE_SIG_FORMAT is still
configured-in as the use of KEXEC_SIG is in step with the use of
SYSTEM_DATA_VERIFICATION, which does select MODULE_SIG_FORMAT.
No, it is actually the other way around.
Could you please provide the correct explanation?
AFAICT the MODULE_SIG_FORMAT dependency was introduced with commit
c8424e776b09 ("MODSIGN: Export module signature definitions") and
in fact was not necessary, since s390 did/does not use mod_check_sig()
anyway. So the SYSTEM_DATA_VERIFICATION could have left intact.
Thomas, would the correct explanation be simply indicating that
MODULE_SIG_FORMAT isn't needed as it is not used by s390 (crediting your
summary above)?
I guess, you asked me? Anyway, I will try to answer as if I were Thomas :)
MODULE_SIG_FORMAT is needed to select SYSTEM_DATA_VERIFICATION.
But SYSTEM_DATA_VERIFICATION is also selected by FS_VERITY*, so
dropping MODULE_SIG_FORMAT does not hurt.
Thanks!
For the commit message for this s390/Kconfig change, are you ok
with the following?
eric
=====
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
NOTE: The original Kconfig has a KEXEC_SIG which depends on
MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT
dependency (using the strategy outlined in this series, and other
techniques) results in 'error: recursive dependency detected'
on CRYPTO.
Per Alexander Gordeev [off-list ref]: "the MODULE_SIG_FORMAT
dependency was introduced with c8424e776b09 ("MODSIGN: Export module
signature definitions") and in fact was not necessary, since s390
did/does not use mod_check_sig() anyway. MODULE_SIG_FORMAT is needed
to select SYSTEM_DATA_VERIFICATION. But SYSTEM_DATA_VERIFICATION is
also selected by FS_VERITY*, so dropping MODULE_SIG_FORMAT does not
hurt."
Therefore, the solution is to drop the MODULE_SIG_FORMAT dependency
from KEXEC_SIG.
On Wed, 2023-06-21 at 07:00 +0200, Alexander Gordeev wrote:
AFAICT the MODULE_SIG_FORMAT dependency was introduced with commit
c8424e776b09 ("MODSIGN: Export module signature definitions") and
in fact was not necessary, since s390 did/does not use mod_check_sig()
anyway. So the SYSTEM_DATA_VERIFICATION could have left intact.
FYI, this patch was included in the patch set to allow IMA to verify
the kexec kernel image appended signature on OpenPOWER.
--
thanks,
Mimi
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:33
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/arm/Kconfig | 29 ++++-------------------------
1 file changed, 4 insertions(+), 25 deletions(-)
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:39
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
Reviewed-by: Sourabh Jain <redacted>
---
arch/powerpc/Kconfig | 55 ++++++++++++++------------------------------
1 file changed, 17 insertions(+), 38 deletions(-)
@@ -588,41 +588,21 @@ config PPC64_SUPPORTS_MEMORY_FAILUREdefault"y"ifPPC_POWERNVselectARCH_SUPPORTS_MEMORY_FAILURE-configKEXEC-bool"kexec system call"-depends onPPC_BOOK3S||PPC_E500||(44x&&!SMP)-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Thenamecomesfromthesimilaritytotheexecsystemcall.--Itisanongoingprocesstobecertainthehardwareinamachine-isproperlyshutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.Asofthiswritingtheexacthardware-interfaceisstronglyinflux,sonogoodrecommendationcanbe-made.--configKEXEC_FILE-bool"kexec file based system call"-selectKEXEC_CORE-selectHAVE_IMA_KEXECifIMA-selectKEXEC_ELF-depends onPPC64-depends onCRYPTO=y-depends onCRYPTO_SHA256=y-help-Thisisanewversionofthekexecsystemcall.Thiscallis-filebasedandtakesinfiledescriptorsassystemcallarguments-forkernelandinitramfsasopposedtoalistofsegmentsasisthe-casefortheolderkexeccall.+configARCH_SUPPORTS_KEXEC+def_boolPPC_BOOK3S||PPC_E500||(44x&&!SMP)++configARCH_SUPPORTS_KEXEC_FILE+def_boolPPC64&&CRYPTO=y&&CRYPTO_SHA256=yconfigARCH_HAS_KEXEC_PURGATORYdef_boolKEXEC_FILE+configARCH_SELECTS_KEXEC_FILE+def_booly+depends onKEXEC_FILE+selectKEXEC_ELF+selectHAVE_IMA_KEXECifIMA+configPPC64_BIG_ENDIAN_ELF_ABI_V2bool"Build big-endian kernel using ELF ABI V2 (EXPERIMENTAL)"depends onPPC64&&CPU_BIG_ENDIAN
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:44
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/ia64/Kconfig | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:48
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/mips/Kconfig | 32 +++++---------------------------
1 file changed, 5 insertions(+), 27 deletions(-)
@@ -2873,33 +2873,11 @@ config HZconfigSCHED_HRTICKdef_boolHIGH_RES_TIMERS-configKEXEC-bool"Kexec system call"-selectKEXEC_CORE-help-kexecisasystemcallthatimplementstheabilitytoshutdownyour-currentkernel,andtostartanotherkernel.Itislikeareboot-butitisindependentofthesystemfirmware.Andlikeareboot-youcanstartanykernelwithit,notjustLinux.--Thenamecomesfromthesimilaritytotheexecsystemcall.--Itisanongoingprocesstobecertainthehardwareinamachine-isproperlyshutdown,sodonotbesurprisedifthiscodedoesnot-initiallyworkforyou.Asofthiswritingtheexacthardware-interfaceisstronglyinflux,sonogoodrecommendationcanbe-made.--configCRASH_DUMP-bool"Kernel crash dumps"-help-Generatecrashdumpafterbeingstartedbykexec.-Thisshouldbenormallyonlysetinspecialcrashdumpkernels-whichareloadedinthemainkernelwithkexec-toolsinto-aspeciallyreservedregionandthenlaterexecutedafter-acrashbykdump/kexec.Thecrashdumpkernelmustbecompiled-toamemoryaddressnotusedbythemainkernelorfirmwareusing-PHYSICAL_START.+configARCH_SUPPORTS_KEXEC+def_booly++configARCH_SUPPORTS_CRASH_DUMP+def_boolyconfigPHYSICAL_STARThex"Physical address where the kernel is loaded"
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Date: 2023-06-20 12:53:09
On Mon, Jun 19, 2023 at 10:57:56AM -0400, Eric DeVolder wrote:
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/mips/Kconfig | 32 +++++---------------------------
1 file changed, 5 insertions(+), 27 deletions(-)
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:52
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/loongarch/Kconfig | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
From: Eric DeVolder <hidden> Date: 2023-06-19 15:00:55
The kexec and crash kernel options are provided in the common
kernel/Kconfig.kexec. Utilize the common options and provide
the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
equivalent set of KEXEC and CRASH options.
Signed-off-by: Eric DeVolder <redacted>
---
arch/riscv/Kconfig | 48 ++++++++++++++--------------------------------
1 file changed, 14 insertions(+), 34 deletions(-)