efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec
Ard Biesheuvel
maintainerPATCH 1/1 efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec
CONFIG_EFI_RUNTIME_MAP needs to be enabled in order for kexec to be able to provide the required information about the EFI runtime mappings to the incoming kernel, regardless of whether kexec_load() or kexec_file_load() is being used. Without this information, kexec boot in EFI mode is not possible.
The CONFIG_EFI_RUNTIME_MAP option is currently directly configurable if CONFIG_EXPERT is enabled, so that it can be turned on for debugging purposes even if KEXEC is. However, the upshot of this is that it can also be disabled even when it shouldn't.
So tweak the Kconfig declarations to avoid this situation.
--- arch/x86/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/Kconfig +5 -1
@@ -2027,10 +2027,14 @@ config EFI_MAX_FAKE_MEM Ranges can be set up to this value using comma-separated list. The default value is 8. +config EFI_NEED_RUNTIME_MAP + def_bool y + depends on EFI && KEXEC_CORE + select EFI_RUNTIME_MAP + config EFI_RUNTIME_MAP bool "Export EFI runtime maps to sysfs" if EXPERT depends on EFI - default KEXEC_CORE help Export EFI runtime memory regions to /sys/firmware/efi/runtime-map. That memory map is required by the 2nd kernel to set up EFI virtual
Signature · 1 line
2.39.2
Quoted 11 lines · Ard Biesheuvel
CONFIG_EFI_RUNTIME_MAPneeds to be enabled in order for kexec to be able to provide the required information about the EFI runtime mappings to the incoming kernel, regardless of whetherkexec_load()orkexec_file_load()is being used. Without this information, kexec boot in EFI mode is not possible.The
CONFIG_EFI_RUNTIME_MAPoption is currently directly configurable ifCONFIG_EXPERTis enabled, so that it can be turned on for debugging purposes even if KEXEC is. However, the upshot of this is that it can also be disabled even when it shouldn't.
Quoted 4 lines
So tweak the
Kconfigdeclarations to avoid this situation.Reported-by Kirill A. Shutemov <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>
With the patch 'make oldconfig' updates config to enable EFI_NEED_RUNTIME_MAP.
Thanks.
Quoted 9 lines
--- arch/x86/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)arch/x86/Kconfig +0
-0
arch/x86/Kconfig config EFI_MAX_FAKE_MEM · line 2034
Quoted 8 lines
arch/x86/Kconfig +5
-0@@ -2027,10 +2027,14 @@ config EFI_MAX_FAKE_MEM Ranges can be set up to this value using comma-separated list. The default value is 8. +config EFI_NEED_RUNTIME_MAP + def_bool y + depends on EFI && KEXEC_CORE + select EFI_RUNTIME_MAP +
Just curious, why not extend 'config EFI' with 'select EFI_RUNTIME_MAP if KEXEC_CORE'? It seems functionally equivalent, but more concise.
Quoted 10 lines
arch/x86/Kconfig +0
-1config EFI_RUNTIME_MAP bool "Export EFI runtime maps to sysfs" if EXPERT depends on EFI - default KEXEC_CORE help Export EFI runtime memory regions to /sys/firmware/efi/runtime-map. That memory map is required by the 2nd kernel to set up EFI virtualSignature · 1 line
2.39.2
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Ard Biesheuvel
maintainerQuoted 36 lines · Kirill A . Shutemov
Quoted 11 lines · Ard Biesheuvel
CONFIG_EFI_RUNTIME_MAPneeds to be enabled in order for kexec to be able to provide the required information about the EFI runtime mappings to the incoming kernel, regardless of whetherkexec_load()orkexec_file_load()is being used. Without this information, kexec boot in EFI mode is not possible.The
CONFIG_EFI_RUNTIME_MAPoption is currently directly configurable ifCONFIG_EXPERTis enabled, so that it can be turned on for debugging purposes even if KEXEC is. However, the upshot of this is that it can also be disabled even when it shouldn't.Quoted 4 lines
So tweak the
Kconfigdeclarations to avoid this situation.Reported-by Kirill A. Shutemov <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>With the patch 'make oldconfig' updates config to enable
EFI_NEED_RUNTIME_MAP.Tested-by Kirill A. Shutemov <[email protected]>Thanks.
Quoted 12 lines
--- arch/x86/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)arch/x86/Kconfig +0
-0@@ -2027,10 +2027,14 @@ config EFI_MAX_FAKE_MEM Ranges can be set up to this value using comma-separated list. The default value is 8.
Quoted 9 lines
arch/x86/Kconfig config EFI_MAX_FAKE_MEM · line 2034
Quoted 5 lines
arch/x86/Kconfig +5
-0+config EFI_NEED_RUNTIME_MAP + def_bool y + depends on EFI && KEXEC_CORE + select EFI_RUNTIME_MAP +Just curious, why not extend 'config EFI' with 'select
EFI_RUNTIME_MAPifKEXEC_CORE'? It seems functionally equivalent, but more concise.
Yeah, agreed - I didn't realize every arch has its own 'config EFI' definition.
Quoted 13 lines
Quoted 10 lines
arch/x86/Kconfig +0
-2config EFI_RUNTIME_MAP bool "Export EFI runtime maps to sysfs" if EXPERT depends on EFI - default KEXEC_CORE help Export EFI runtime memory regions to /sys/firmware/efi/runtime-map. That memory map is required by the 2nd kernel to set up EFI virtual --2.39.2
--
Kiryl Shutsemau / Kirill A. Shutemov