]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-u-boot/ti-u-boot.git/commitdiff
efi_loader: fix memory type for memory reservation block
authorMark Kettenis <kettenis@openbsd.org>
Sun, 14 Mar 2021 19:04:24 +0000 (20:04 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 25 Mar 2021 19:07:18 +0000 (20:07 +0100)
The (yet unreleased version of the) devicetree specification clearly
states that:

  As with the /reserved-memory node, when booting via UEFI
  entries in the Memory Reservation Block must also be listed
  in the system memory map obtained via the GetMemoryMap() toi
  protect against allocations by UEFI applications. The memory
  reservation block entries should be listed with type
  EfiReservedMemoryType.

This restores the behaviour that was changed by commit 4cbb2930bd8c
("efi_loader: consider no-map property of reserved memory").

Fixes: 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory")
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_dt_fixup.c

index a4529ee3ef261f734448ee8debe258623e4ac1be..b6fe5d2e5a34d49ce00e6dbe7a6311749cb0dcc5 100644 (file)
@@ -61,7 +61,7 @@ void efi_carve_out_dt_rsv(void *fdt)
        for (i = 0; i < nr_rsv; i++) {
                if (fdt_get_mem_rsv(fdt, i, &addr, &size) != 0)
                        continue;
-               efi_reserve_memory(addr, size, false);
+               efi_reserve_memory(addr, size, true);
        }
 
        /* process reserved-memory */