efi_selftest: fix SetVirtualAddressMap unit test
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 27 Jul 2019 17:16:32 +0000 (19:16 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 30 Jul 2019 19:36:22 +0000 (21:36 +0200)
We read the address map before assigning the memory for the pages that will
be mapped to virtual addresses. So these pages will overlap with the entry
for EFI_CONVENTIONAL_MEMORY. We have to ensure that every page is described
at most once in the map.

Remove EFI_CONVENTIONAL_MEMORY from the map that we pass to
SetVirtualAddressMap().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_selftest/efi_selftest_set_virtual_address_map.c

index 6ee7bbeb01e33e3184e894de5bc9bec97c5c8c2d..3ffb61b7e8f66b7177b0a683665278fe8d1ad940 100644 (file)
@@ -123,6 +123,7 @@ static int setup(const efi_handle_t handle,
                case EFI_LOADER_DATA:
                case EFI_BOOT_SERVICES_CODE:
                case EFI_BOOT_SERVICES_DATA:
+               case EFI_CONVENTIONAL_MEMORY:
                        continue;
                }
                memcpy(pos1, pos2, desc_size);