]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/efi: Apply EFI Memory Attributes after kexec
authorNicolas Saenz Julienne <nsaenz@amazon.com>
Tue, 12 Nov 2024 18:52:17 +0000 (18:52 +0000)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 15 Nov 2024 16:40:00 +0000 (17:40 +0100)
Kexec bypasses EFI's switch to virtual mode. In exchange, it has its own
routine, kexec_enter_virtual_mode(), which replays the mappings made by
the original kernel. Unfortunately, that function fails to reinstate
EFI's memory attributes, which would've otherwise been set after
entering virtual mode. Remediate this by calling
efi_runtime_update_mappings() within kexec's routine.

Signed-off-by: Nicolas Saenz Julienne <nsaenz@amazon.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/platform/efi/efi.c

index 375ebd78296ad57b05ed287ebfcefd9f0e26c471..a7ff189421c3d8c7ed0b6ad5d5d90fa9700de7b6 100644 (file)
@@ -765,6 +765,7 @@ static void __init kexec_enter_virtual_mode(void)
 
        efi_sync_low_kernel_mappings();
        efi_native_runtime_setup();
+       efi_runtime_update_mappings();
 #endif
 }