aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/arch/memory/higher_half_mapper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86_64/arch/memory/higher_half_mapper.cpp b/arch/x86_64/arch/memory/higher_half_mapper.cpp
index 814cc991..cd0f943a 100644
--- a/arch/x86_64/arch/memory/higher_half_mapper.cpp
+++ b/arch/x86_64/arch/memory/higher_half_mapper.cpp
@@ -70,6 +70,11 @@ namespace arch::memory
return std::nullopt;
}
+ if (entry.huge())
+ {
+ kapi::system::panic("[ARCH:MEM] Tried to unmap a huge page, which is not supported!");
+ }
+
auto next_table = to_higher_half_pointer<page_table>(entry.frame()->start_address());
auto next_index = pml_index(level - 1, page);
table_path[4 - (level - 1)] = std::pair{next_table, next_index};
@@ -121,6 +126,11 @@ namespace arch::memory
auto index = pml_index(level, page);
auto & entry = (*table)[index];
+ if (entry.huge())
+ {
+ kapi::system::panic("[ARCH:MEM] Tried map an entry in a huge page, which is not supported!");
+ }
+
if (!entry.present())
{
auto table_frame = kapi::memory::allocate_frame();