6102795
From ca1e8231dcf89b78c6860239281bbe36e7a63341 Mon Sep 17 00:00:00 2001
6102795
From: Mark Kettenis <kettenis@openbsd.org>
6102795
Date: Sun, 14 Mar 2021 20:04:24 +0100
6102795
Subject: [PATCH] efi_loader: fix memory type for memory reservation block
6102795
6102795
The devicetree specification clearly states that:
6102795
6102795
  As with the /reserved-memory node, when booting via UEFI
6102795
  entries in the Memory Reservation Block must also be listed
6102795
  in the system memory map obtained via the GetMemoryMap() toi
6102795
  protect against allocations by UEFI applications. The memory
6102795
  reservation block entries should be listed with type
6102795
  EfiReservedMemoryType.
6102795
6102795
This restores the behaviour that was changed by commit 4cbb2930bd8c
6102795
("efi_loader: consider no-map property of reserved memory").
6102795
6102795
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6102795
---
6102795
 lib/efi_loader/efi_dt_fixup.c | 2 +-
6102795
 1 file changed, 1 insertion(+), 1 deletion(-)
6102795
6102795
diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c
6102795
index a4529ee3ef..b6fe5d2e5a 100644
6102795
--- a/lib/efi_loader/efi_dt_fixup.c
6102795
+++ b/lib/efi_loader/efi_dt_fixup.c
6102795
@@ -61,7 +61,7 @@ void efi_carve_out_dt_rsv(void *fdt)
6102795
 	for (i = 0; i < nr_rsv; i++) {
6102795
 		if (fdt_get_mem_rsv(fdt, i, &addr, &size) != 0)
6102795
 			continue;
6102795
-		efi_reserve_memory(addr, size, false);
6102795
+		efi_reserve_memory(addr, size, true);
6102795
 	}
6102795
 
6102795
 	/* process reserved-memory */
6102795
-- 
6102795
2.30.2
6102795