From 05fc75f9942462d76b4f9bbaa5e004ed36091f2e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 20 Jul 2021 12:14:37 +0200 Subject: Prekernel: Don't wrap around the PTE index improperly The boot_pd0_pts variable contains more than 512 PTEs so we shouldn't wrap the index here. --- Kernel/Prekernel/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel') diff --git a/Kernel/Prekernel/init.cpp b/Kernel/Prekernel/init.cpp index 310beea1ba..d079b2c661 100644 --- a/Kernel/Prekernel/init.cpp +++ b/Kernel/Prekernel/init.cpp @@ -177,7 +177,7 @@ extern "C" [[noreturn]] void init() // unmap the end_of_prekernel_image - MAX_KERNEL_SIZE region for (FlatPtr vaddr = (FlatPtr)end_of_prekernel_image; vaddr < MAX_KERNEL_SIZE; vaddr += PAGE_SIZE) - boot_pd0_pts[vaddr >> 12 & 0x1ff] = 0; + boot_pd0_pts[vaddr >> 12] = 0; void (*entry)(BootInfo const&) = (void (*)(BootInfo const&))kernel_elf_header.e_entry; entry(*adjust_by_load_base(&info)); -- cgit v1.2.3