From fccd0432a13b17a85cea3dbd48ee7999159f31a9 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 19 Dec 2021 18:17:48 +0200 Subject: [PATCH] Kernel: Don't share the bottom 2 MiB of kernel mappings with processes Now that the last 2 users of these mappings (the Prekernel and the APIC ap boot environment) were removed, these are no longer used. --- Kernel/Memory/PageDirectory.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Kernel/Memory/PageDirectory.cpp b/Kernel/Memory/PageDirectory.cpp index d75669da65..0e922005f7 100644 --- a/Kernel/Memory/PageDirectory.cpp +++ b/Kernel/Memory/PageDirectory.cpp @@ -125,13 +125,6 @@ ErrorOr> PageDirectory::try_create_for_userspace(Vi MM.unquickmap_page(); } - // Clone bottom 2 MiB of mappings from kernel_page_directory - PageDirectoryEntry buffer; - auto* kernel_pd = MM.quickmap_pd(MM.kernel_page_directory(), 0); - memcpy(&buffer, kernel_pd, sizeof(PageDirectoryEntry)); - auto* new_pd = MM.quickmap_pd(*directory, 0); - memcpy(new_pd, &buffer, sizeof(PageDirectoryEntry)); - cr3_map().insert(directory->cr3(), directory); return directory; }