OpenCloudOS-Kernel/drivers/firmware/efi/libstub
Ard Biesheuvel 7d866e38c7 efi: random: Use 'ACPI reclaim' memory for random seed
EFI runtime services data is guaranteed to be preserved by the OS,
making it a suitable candidate for the EFI random seed table, which may
be passed to kexec kernels as well (after refreshing the seed), and so
we need to ensure that the memory is preserved without support from the
OS itself.

However, runtime services data is intended for allocations that are
relevant to the implementations of the runtime services themselves, and
so they are unmapped from the kernel linear map, and mapped into the EFI
page tables that are active while runtime service invocations are in
progress. None of this is needed for the RNG seed.

So let's switch to EFI 'ACPI reclaim' memory: in spite of the name,
there is nothing exclusively ACPI about it, it is simply a type of
allocation that carries firmware provided data which may or may not be
relevant to the OS, and it is left up to the OS to decide whether to
reclaim it after having consumed its contents.

Given that in Linux, we never reclaim these allocations, it is a good
choice for the EFI RNG seed, as the allocation is guaranteed to survive
kexec reboots.

One additional reason for changing this now is to align it with the
upcoming recommendation for EFI bootloader provided RNG seeds, which
must not use EFI runtime services code/data allocations.

Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-10-24 10:23:28 +02:00
..
Makefile - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
Makefile.zboot efi: libstub: Remove zboot signing from build options 2022-10-21 11:09:40 +02:00
alignedmem.c efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds 2020-07-09 09:45:09 +03:00
arm32-stub.c efi: libstub: pass image handle to handle_kernel_image() 2022-05-03 15:31:28 +02:00
arm64-stub.c EFI updates for v6.1 2022-10-09 08:56:54 -07:00
efi-stub-helper.c efi/arm64: libstub: avoid SetVirtualAddressMap() when possible 2022-09-27 13:26:16 +02:00
efi-stub.c efi: libstub: fix up the last remaining open coded boot service call 2022-09-27 13:26:16 +02:00
efistub.h efi/libstub: measure EFI LoadOptions 2022-09-27 13:26:16 +02:00
fdt.c efi: runtime: Don't assume virtual mappings are missing if VA == PA == 0 2022-10-21 11:09:41 +02:00
file.c Second shared stable tag between EFI and LoongArch trees 2022-09-27 13:26:13 +02:00
gop.c efi/gop: Add an option to list out the available GOP modes 2020-05-20 19:09:20 +02:00
intrinsics.c efi/libstub: use EFI provided memcpy/memset routines 2022-09-17 15:13:21 +02:00
loongarch-stub.c efi/loongarch: libstub: remove dependency on flattened DT 2022-09-27 13:22:49 +02:00
mem.c efi: libstub: install boot-time memory map as config table 2022-09-27 13:22:49 +02:00
pci.c efi/libstub: Correct comment typos 2020-05-06 11:27:55 +02:00
random.c efi: random: Use 'ACPI reclaim' memory for random seed 2022-10-24 10:23:28 +02:00
randomalloc.c efi: libstub: install boot-time memory map as config table 2022-09-27 13:22:49 +02:00
relocate.c efi: libstub: install boot-time memory map as config table 2022-09-27 13:22:49 +02:00
riscv-stub.c riscv/efi_stub: Add 64bit boot-hartid support on RV64 2022-07-19 16:39:19 -07:00
secureboot.c efi: libstub: check Shim mode using MokSBStateRT 2022-09-22 10:15:44 +02:00
skip_spaces.c efi/libstub: Fix missing-prototype warning for skip_spaces() 2020-06-15 19:43:58 +02:00
string.c efi/libstub: Fix missing-prototypes in string.c 2020-09-25 23:29:04 +02:00
systable.c efi/libstub: move efi_system_table global var into separate object 2022-09-19 11:19:35 +02:00
tpm.c More EFI changes for v5.8: 2020-05-25 15:11:14 +02:00
vsprintf.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
x86-stub.c efi: libstub: Give efi_main() asmlinkage qualification 2022-10-21 11:09:40 +02:00
zboot-header.S efi/libstub: implement generic EFI zboot 2022-09-20 09:50:30 +02:00
zboot.c efi: zboot: create MemoryMapped() device path for the parent if needed 2022-09-27 13:26:16 +02:00
zboot.lds efi: libstub: Fix incorrect payload size in zboot header 2022-10-21 11:09:41 +02:00