From c8c0c0c4a78ecdc1eb078ddc6b119137a9d30aa4 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Fri, 31 Dec 2021 16:05:26 +0000 Subject: only map 64KiB past end of kernel. cleanup main_efi.c --- kc/boot/kc_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kc') diff --git a/kc/boot/kc_main.c b/kc/boot/kc_main.c index 36aad0c..c469d40 100644 --- a/kc/boot/kc_main.c +++ b/kc/boot/kc_main.c @@ -344,7 +344,8 @@ 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(); @@ -401,9 +402,8 @@ 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(2) + page_size(1) * 16) & - ~(page_size(2) - 1); + uint64_t object_space_end = (uintptr_t)object_space_base + + page_size(1) * 16; object_space_size = object_space_end - (uintptr_t)object_space_base; -- cgit v1.3.1-1-g115d