mirror_ubuntu-kernels/drivers/firmware/efi/libstub
Ard Biesheuvel 37926f9630 efi: runtime: Don't assume virtual mappings are missing if VA == PA == 0
The generic EFI stub can be instructed to avoid SetVirtualAddressMap(),
and simply run with the firmware's 1:1 mapping. In this case, it
populates the virtual address fields of the runtime regions in the
memory map with the physical address of each region, so that the mapping
code has to be none the wiser. Only if SetVirtualAddressMap() fails, the
virtual addresses are wiped and the kernel code knows that the regions
cannot be mapped.

However, wiping amounts to setting it to zero, and if a runtime region
happens to live at physical address 0, its valid 1:1 mapped virtual
address could be mistaken for a wiped field, resulting on loss of access
to the EFI services at runtime.

So let's only assume that VA == 0 means 'no runtime services' if the
region in question does not live at PA 0x0.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2022-10-21 11:09:41 +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
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
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/libstub: Describe RNG functions 2020-02-23 21:57:19 +01: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