From 7db57d7a47671b4023e34413a2276611e1c65f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Tue, 12 Nov 2024 10:24:12 +0000 Subject: Add comment to flush all and remove now redudant todos. --- arch/x86_64/include/arch/memory/paging/active_page_table.hpp | 9 +++------ arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'arch/x86_64/include') diff --git a/arch/x86_64/include/arch/memory/paging/active_page_table.hpp b/arch/x86_64/include/arch/memory/paging/active_page_table.hpp index c5b972b..1bc5b74 100644 --- a/arch/x86_64/include/arch/memory/paging/active_page_table.hpp +++ b/arch/x86_64/include/arch/memory/paging/active_page_table.hpp @@ -164,12 +164,9 @@ namespace teachos::arch::memory::paging break; } } - // TODO: Flushing only specifc page does not work and cause temporary_page.map_table_frame to return an invalid - // page table (Memory inside buffer shows nothing) - // cpu::tlb_flush(page.start_address()); - // This is the case, because we have unmapped the active page and it is completly invalid, if we only flush one - // page, the other pages which are huge still exist in the cache and can therefore still be accessed. But because - // they are huge pages the temporary page is not mapped correctly. + // Uses flush all instead of cpu::tlb_flush(page.start_address());, because when we unmap the active page and + // only flush one page, the rest of the page which is huge still exist in the cache and + // can therefore still be accessed. But because they are huge pages the new mapping can not be accessed correctly. cpu::tlb_flush_all(); } diff --git a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp index f673da4..bcc3eba 100644 --- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp @@ -76,7 +76,6 @@ namespace teachos::arch::memory::paging { /*auto const backup = allocator::physical_frame::containing_address(cpu::read_control_register(cpu::control_register::CR3)); - // TODO: This creates invalid page table that points to nothing, is it the frame (current level 4 page table) auto page_table_level4 = temporary_page.map_table_frame(backup, active_table); active_table[511].set_entry(inactive_table.page_table_level_4_frame, entry::PRESENT | entry::WRITABLE);*/ -- cgit v1.2.3