From 9310e46afa3779aed0a3cb2340ec5d2531a0de90 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Fri, 31 Dec 2021 16:05:54 +0000 Subject: Revert "only map 64KiB past end of kernel. cleanup main_efi.c" This reverts commit c8c0c0c4a78ecdc1eb078ddc6b119137a9d30aa4. --- kc/boot/kc_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kc/boot/kc_main.c b/kc/boot/kc_main.c index c469d40..36aad0c 100644 --- a/kc/boot/kc_main.c +++ b/kc/boot/kc_main.c @@ -344,8 +344,7 @@ static EFI_STATUS enter_kernel(Elf64_Ehdr *ehdr) set_page_map(system_page_map); k_boot_data = (struct kc_boot_data *)object_space_base; - k_boot_data->object_space.base = sizeof(*k_boot_data) + - (char *)object_space_base; + k_boot_data->object_space.base = sizeof(*k_boot_data) + (char *)object_space_base; k_boot_data->object_space.size = object_space_size; convert_memory_map(); @@ -402,8 +401,9 @@ EFI_STATUS kc_main(struct efi_loader_interface *interface) // it is not necessary to know the actual size of this object // as it will be overlaid with a virtual address space // upon kernel initialization. - uint64_t object_space_end = (uintptr_t)object_space_base + - page_size(1) * 16; + uint64_t object_space_end = ((uintptr_t)object_space_base + + page_size(2) + page_size(1) * 16) & + ~(page_size(2) - 1); object_space_size = object_space_end - (uintptr_t)object_space_base; -- cgit v1.3.1-1-g115d