Skip to contentSkip to conversation

efi/x86: Ensure that EFI_RUNTIME_MAP is enabled for kexec

PATCH In review Ard Biesheuvel 2 participants 3 messages Aug 2, 2023

Subsystems (2)
lore
Share & tools
lore

Ard Biesheuvel

author maintainer
#0 lore raw

PATCH v2 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.

---
v2: use simpler conditional 'select EFI_RUNTIME_MAP' in CONFIG_EFI

 arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig +1 -1
index 7422db4097701c96..bfbf53b49fee95a3 100644
@@ -1955,6 +1955,7 @@ config EFI
 	select UCS2_STRING
 	select EFI_RUNTIME_WRAPPERS
 	select ARCH_USE_MEMREMAP_PROT
+	select EFI_RUNTIME_MAP if KEXEC_CORE
 	help
 	  This enables the kernel to use EFI runtime services that are
 	  available (such as the EFI variable services).
@@ -2030,7 +2031,6 @@ config EFI_MAX_FAKE_MEM
 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
Tested-by on v2 1/1
#1 lore raw
Quoted 9 lines · Ard Biesheuvel

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

s/is/isn't/ ?

Quoted 6 lines

also be disabled even when it shouldn't.

So tweak the Kconfig declarations to avoid this situation.

Signature · 1 line
  Kiryl Shutsemau / Kirill A. Shutemov
author maintainer
#2 lore raw
Quoted 8 lines · Kirill A . Shutemov
Quoted 6 lines · Ard Biesheuvel

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.

Quoted 6 lines
Quoted 3 lines

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

s/is/isn't/ ?

indeed, will fix.