summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArd Biesheuvel2014-10-20 16:27:26 +0200
committerArd Biesheuvel2015-01-12 17:29:12 +0100
commitf3cdfd239da56a4cea75a2920dc326f0f45f67e3 (patch)
tree71eef379af8b2aac7232d21bdcbb4ae390ae9ba5 /drivers/firmware/efi/libstub/efistub.h
parentarm64/efi: set EFI_ALLOC_ALIGN to 64 KB (diff)
downloadkernel-qcow2-linux-f3cdfd239da56a4cea75a2920dc326f0f45f67e3.tar.gz
kernel-qcow2-linux-f3cdfd239da56a4cea75a2920dc326f0f45f67e3.tar.xz
kernel-qcow2-linux-f3cdfd239da56a4cea75a2920dc326f0f45f67e3.zip
arm64/efi: move SetVirtualAddressMap() to UEFI stub
In order to support kexec, the kernel needs to be able to deal with the state of the UEFI firmware after SetVirtualAddressMap() has been called. To avoid having separate code paths for non-kexec and kexec, let's move the call to SetVirtualAddressMap() to the stub: this will guarantee us that it will only be called once (since the stub is not executed during kexec), and ensures that the UEFI state is identical between kexec and normal boot. This implies that the layout of the virtual mapping needs to be created by the stub as well. All regions are rounded up to a naturally aligned multiple of 64 KB (for compatibility with 64k pages kernels) and recorded in the UEFI memory map. The kernel proper reads those values and installs the mappings in a dedicated set of page tables that are swapped in during UEFI Runtime Services calls. Acked-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Matt Fleming <matt.fleming@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r--drivers/firmware/efi/libstub/efistub.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 304ab295ca1a..2be10984a67a 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -39,4 +39,8 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
void *get_fdt(efi_system_table_t *sys_table);
+void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
+ unsigned long desc_size, efi_memory_desc_t *runtime_map,
+ int *count);
+
#endif