mirror_ubuntu-kernels/drivers/firmware/efi/libstub
Ard Biesheuvel e7761d827e efi/unaccepted: Use ACPI reclaim memory for unaccepted memory table
Kyril reports that crashkernels fail to work on confidential VMs that
rely on the unaccepted memory table, and this appears to be caused by
the fact that it is not considered part of the set of firmware tables
that the crashkernel needs to map.

This is an oversight, and a result of the use of the EFI_LOADER_DATA
memory type for this table. The correct memory type to use for any
firmware table is EFI_ACPI_RECLAIM_MEMORY (including ones created by the
EFI stub), even though the name suggests that is it specific to ACPI.
ACPI reclaim means that the memory is used by the firmware to expose
information to the operating system, but that the memory region has no
special significance to the firmware itself, and the OS is free to
reclaim the memory and use it as ordinary memory if it is not interested
in the contents, or if it has already consumed them. In Linux, this
memory is never reclaimed, but it is always covered by the kernel direct
map and generally made accessible as ordinary memory.

On x86, ACPI reclaim memory is translated into E820_ACPI, which the
kexec logic already recognizes as memory that the crashkernel may need
to to access, and so it will be mapped and accessible to the booting
crash kernel.

Fixes: 745e3ed85f ("efi/libstub: Implement support for unaccepted memory")
Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2023-09-11 06:37:51 +00:00
..
alignedmem.c arm64: efi: Limit allocations to 48-bit addressable physical region 2022-12-07 19:50:44 +01:00
arm32-stub.c efi: libstub: Move screen_info handling to common code 2022-11-09 12:42:02 +01:00
arm64-stub.c arm64: libstub: Move KASLR handling functions to kaslr.c 2023-09-05 19:49:29 -07:00
arm64.c efi/zboot: arm64: Grab code size from ELF symbol in payload 2023-04-26 23:06:48 +02:00
bitmap.c efi/libstub: Implement support for unaccepted memory 2023-06-06 16:58:23 +02:00
efi-stub-entry.c efi: Do not include <linux/screen_info.h> from EFI header 2023-07-08 20:26:36 +02:00
efi-stub-helper.c x86/efistub: Perform 4/5 level paging switch from the stub 2023-08-07 20:52:32 +02:00
efi-stub.c efi/libstub: Use relocated version of kernel's struct screen_info 2023-03-23 12:27:18 +01:00
efistub.h Merge patch series "riscv: Introduce KASLR" 2023-09-08 11:25:13 -07: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 efi: libstub: Add mixed mode support to command line initrd loader 2022-11-18 09:14:08 +01:00
find.c efi/libstub: Implement support for unaccepted memory 2023-06-06 16:58:23 +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: Clone memcmp() into the stub 2022-11-09 12:42:02 +01:00
kaslr.c Merge patch series "riscv: Introduce KASLR" 2023-09-08 11:25:13 -07:00
loongarch-stub.c efi/loongarch: Reintroduce efi_relocate_kernel() to relocate kernel 2023-04-05 12:05:11 +02:00
loongarch.c efi/loongarch: libstub: Split off kernel image relocation for builtin stub 2022-11-09 12:42:03 +01:00
Makefile Merge patch series "riscv: Introduce KASLR" 2023-09-08 11:25:13 -07:00
Makefile.zboot efi/libstub: zboot: Avoid eager evaluation of objcopy flags 2023-05-25 09:26:00 +02:00
mem.c arm64: efi: Limit allocations to 48-bit addressable physical region 2022-12-07 19:50:44 +01:00
pci.c efi/libstub: Correct comment typos 2020-05-06 11:27:55 +02:00
printk.c efi: libstub: Enable efi_printk() in zboot decompressor 2022-11-09 12:42:02 +01:00
random.c efi: stub: use random seed from EFI variable 2022-12-01 09:51:21 +01:00
randomalloc.c efi/libstub: Add limit argument to efi_random_alloc() 2023-08-07 21:01:46 +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: libstub: Implement KASLR by using generic functions 2023-09-05 19:49:31 -07:00
riscv.c efi/riscv: libstub: Split off kernel image relocation for builtin stub 2022-11-09 12:42:03 +01:00
screen_info.c efi: Do not include <linux/screen_info.h> from EFI header 2023-07-08 20:26:36 +02: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
smbios.c efi/libstub: smbios: Drop unused 'recsize' parameter 2023-03-18 11:44:57 +01:00
string.c efi: libstub: Provide local implementations of strrchr() and memchr() 2022-11-09 12:42:02 +01: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
unaccepted_memory.c efi/unaccepted: Use ACPI reclaim memory for unaccepted memory table 2023-09-11 06:37:51 +00:00
vsprintf.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
x86-5lvl.c x86/efistub: Perform 4/5 level paging switch from the stub 2023-08-07 20:52:32 +02:00
x86-stub.c EFI updates for v6.6 2023-08-28 16:25:45 -07:00
x86-stub.h x86/efistub: Perform 4/5 level paging switch from the stub 2023-08-07 20:52:32 +02:00
zboot-header.S efi/zboot: Set forward edge CFI compat header flag if supported 2023-04-20 15:45:12 +02:00
zboot.c efi/libstub: Add limit argument to efi_random_alloc() 2023-08-07 21:01:46 +02:00
zboot.lds efi/zboot: arm64: Inject kernel code size symbol into the zboot payload 2023-04-26 18:01:41 +02:00