summaryrefslogtreecommitdiff
path: root/Kernel/VM/PageDirectory.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-17 22:30:52 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-17 22:34:36 +0100
commit122c76d7fa267b5919d950ed5746b09f0866dd7a (patch)
tree13695bb78a73d3b691fd09ce6ca3957202452a77 /Kernel/VM/PageDirectory.cpp
parentad1f79fb4a60c444fbae6d101e1478fdea3afd8c (diff)
downloadserenity-122c76d7fa267b5919d950ed5746b09f0866dd7a.zip
Kernel: Don't allocate per-process PDPT from super pages either
The default system is now down to 3 super pages allocated on boot. :^)
Diffstat (limited to 'Kernel/VM/PageDirectory.cpp')
-rw-r--r--Kernel/VM/PageDirectory.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Kernel/VM/PageDirectory.cpp b/Kernel/VM/PageDirectory.cpp
index ce07a23a8c..65d8b6fe45 100644
--- a/Kernel/VM/PageDirectory.cpp
+++ b/Kernel/VM/PageDirectory.cpp
@@ -45,17 +45,22 @@ PageDirectory::PageDirectory(Process& process, const RangeAllocator* parent_rang
, m_range_allocator(parent_range_allocator ? RangeAllocator(*parent_range_allocator) : RangeAllocator(VirtualAddress(userspace_range_base), kernelspace_range_base - userspace_range_base))
{
// Set up a userspace page directory
- m_directory_table = MM.allocate_supervisor_physical_page();
+ m_directory_table = MM.allocate_user_physical_page();
m_directory_pages[0] = MM.allocate_user_physical_page();
m_directory_pages[1] = MM.allocate_user_physical_page();
m_directory_pages[2] = MM.allocate_user_physical_page();
// Share the top 1 GB of kernel-only mappings (>=3GB or >=0xc0000000)
m_directory_pages[3] = MM.kernel_page_directory().m_directory_pages[3];
- table().raw[0] = (u64)m_directory_pages[0]->paddr().as_ptr() | 1;
- table().raw[1] = (u64)m_directory_pages[1]->paddr().as_ptr() | 1;
- table().raw[2] = (u64)m_directory_pages[2]->paddr().as_ptr() | 1;
- table().raw[3] = (u64)m_directory_pages[3]->paddr().as_ptr() | 1;
+ {
+ InterruptDisabler disabler;
+ auto& table = *(PageDirectoryPointerTable*)MM.quickmap_page(*m_directory_table);
+ table.raw[0] = (u64)m_directory_pages[0]->paddr().as_ptr() | 1;
+ table.raw[1] = (u64)m_directory_pages[1]->paddr().as_ptr() | 1;
+ table.raw[2] = (u64)m_directory_pages[2]->paddr().as_ptr() | 1;
+ table.raw[3] = (u64)m_directory_pages[3]->paddr().as_ptr() | 1;
+ MM.unquickmap_page();
+ }
// Clone bottom 8 MB of mappings from kernel_page_directory
PageDirectoryEntry buffer[4];