aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-09 16:25:11 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-09 16:25:11 +0000
commit4c030cbaee174a9f7f42d4f5ca7ddf6debbbe048 (patch)
treec022b72aa6baedf40e0a654126b7be4d4ddb8368 /arch/x86_64/include
parent022e2555c233c13f990026ea86d164f56a9cd7be (diff)
downloadteachos-4c030cbaee174a9f7f42d4f5ca7ddf6debbbe048.tar.xz
teachos-4c030cbaee174a9f7f42d4f5ca7ddf6debbbe048.zip
Fix flush all method and move crash.
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/cpu/tlb.hpp2
-rw-r--r--arch/x86_64/include/arch/memory/paging/active_page_table.hpp6
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp2
3 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86_64/include/arch/memory/cpu/tlb.hpp b/arch/x86_64/include/arch/memory/cpu/tlb.hpp
index dc7ec61..21f09e5 100644
--- a/arch/x86_64/include/arch/memory/cpu/tlb.hpp
+++ b/arch/x86_64/include/arch/memory/cpu/tlb.hpp
@@ -5,8 +5,6 @@
namespace teachos::arch::memory::cpu
{
- paging::virtual_address constexpr PAGE_TABLE_LEVEL_4_ADDRESS = 0xffffffff'fffff000;
-
/**
* @brief Invalidates any translation lookaside buffer (TLB) entry for the page table the given address is cotained
* in. See https://www.felixcloutier.com/x86/invlpg for more information on the used x86 instruction.
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 09fbc76..567a806 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,8 +164,10 @@ namespace teachos::arch::memory::paging
break;
}
}
-
- cpu::tlb_flush(page.start_address());
+ // 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());
+ cpu::tlb_flush_all();
}
private:
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 0786ec1..c91c5f0 100644
--- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
@@ -76,8 +76,6 @@ namespace teachos::arch::memory::paging
auto const backup = allocator::physical_frame::containing_address(cpu::read_cr3_register());
auto page_table_level4 = temporary_page.map_table_frame(backup, active_table);
- // TODO: Page Table Level 4 is invalid, all entries point to non-existent memory :(
-
active_table[511].set_entry(inactive_table.page_table_level_4_frame, entry::PRESENT | entry::WRITABLE);
cpu::tlb_flush_all();
map_elf_kernel_sections(active_table);