1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

Kernel: Fix losing PTEs

We can't use a HashMap with a small key that doesn't guarantee
collisions. Change it to a HashTable instead.

Fixes #3254
This commit is contained in:
Tom 2020-08-25 17:14:48 -06:00 committed by Andreas Kling
parent bcbe2fe525
commit dd83f6a266
2 changed files with 3 additions and 2 deletions

View file

@ -227,7 +227,8 @@ PageTableEntry& MemoryManager::ensure_pte(PageDirectory& page_directory, Virtual
pde.set_present(true);
pde.set_writable(true);
pde.set_global(&page_directory == m_kernel_page_directory.ptr());
page_directory.m_physical_pages.set(page_directory_index, move(page_table));
auto result = page_directory.m_physical_pages.set(move(page_table));
ASSERT(result == AK::HashSetResult::InsertedNewEntry);
}
return quickmap_pt(PhysicalAddress((FlatPtr)pde.page_table_base()))[page_table_index];