Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

efi: Enable BGRT loading under Xen

The BGRT table can be parsed if EFI_PARAVIRT is enabled, even if
EFI_MEMMAP is not. Xen will take care of preserving the image even if
EfiBootServicesData memory is reclaimed already, or invalidate the table
if it didn't preserve it - in both cases accesing the table itself under
virt is safe. Also allow the ESRT to be in reclaimable memory, as that
is where future Xen versions will put it.
This is similar approach as was taken for ESRT table in 01de145dc7fb
"efi: Actually enable the ESRT under Xen".

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Marek Marczykowski-Górecki and committed by
Ard Biesheuvel
eaeff841 80e80a70

+5 -2
+5 -2
drivers/firmware/efi/efi-bgrt.c
··· 29 29 void *image; 30 30 struct bmp_header bmp_header; 31 31 struct acpi_table_bgrt *bgrt = &bgrt_tab; 32 + int mem_type; 32 33 33 34 if (acpi_disabled) 34 35 return; 35 36 36 - if (!efi_enabled(EFI_MEMMAP)) 37 + if (!efi_enabled(EFI_MEMMAP) && !efi_enabled(EFI_PARAVIRT)) 37 38 return; 38 39 39 40 if (table->length < sizeof(bgrt_tab)) { ··· 63 62 goto out; 64 63 } 65 64 66 - if (efi_mem_type(bgrt->image_address) != EFI_BOOT_SERVICES_DATA) { 65 + mem_type = efi_mem_type(bgrt->image_address); 66 + if (mem_type != EFI_BOOT_SERVICES_DATA && 67 + mem_type != EFI_ACPI_RECLAIM_MEMORY) { 67 68 pr_notice("Ignoring BGRT: invalid image address\n"); 68 69 goto out; 69 70 }