Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b9b3260 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Kees Cook
Browse files

UPSTREAM: 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: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Acked-by: default avatarMatt Fleming <matt.fleming@intel.com>
Tested-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>

(cherry picked from commit f3cdfd239da56a4cea75a2920dc326f0f45f67e3)
Signed-off-by: default avatarTomasz Figa <tfiga@chromium.org>

Bug: 24475017

Change-Id: I2df4ed0ed8d8db5f7de3b5e4d900c6d1cf3b3038
Signed-off-by: default avatarKees Cook <keescook@google.com>
parent 20ea1314
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment