mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
Kernel: Unmap Prekernel pages after they are no longer needed
The Prekernel's memory is only accessed until MemoryManager has been initialized. Keeping them around afterwards is both unnecessary and bad, as it prevents the userland from using the 0x100000-0x155000 virtual address range. Co-authored-by: Idan Horowitz <idan.horowitz@gmail.com>
This commit is contained in:
parent
2f1b4b8a81
commit
4fc28bfe02
Notes:
sideshowbarker
2024-07-17 22:23:21 +09:00
Author: https://github.com/BertalanD
Commit: 4fc28bfe02
Pull-request: https://github.com/SerenityOS/serenity/pull/11318
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/bgianfo ✅
4 changed files with 31 additions and 8 deletions
|
@ -243,7 +243,7 @@ void Region::unmap(ShouldDeallocateVirtualRange deallocate_range)
|
|||
size_t count = page_count();
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
auto vaddr = vaddr_from_page_index(i);
|
||||
MM.release_pte(*m_page_directory, vaddr, i == count - 1);
|
||||
MM.release_pte(*m_page_directory, vaddr, i == count - 1 ? MemoryManager::IsLastPTERelease::Yes : MemoryManager::IsLastPTERelease::No);
|
||||
}
|
||||
MemoryManager::flush_tlb(m_page_directory, vaddr(), page_count());
|
||||
if (deallocate_range == ShouldDeallocateVirtualRange::Yes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue