From 525d567af67ae988964c751df0c3e29b7e160324 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 12 Oct 2022 14:24:34 +0200 Subject: [PATCH] VMM: When unmapping a page, invalidate the TLB for that page --- kernel/src/memory/VMM.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/src/memory/VMM.cpp b/kernel/src/memory/VMM.cpp index 8552c0d4..b87a9f26 100644 --- a/kernel/src/memory/VMM.cpp +++ b/kernel/src/memory/VMM.cpp @@ -57,6 +57,8 @@ namespace Paging PDE = PT->entries[P_i]; PDE.Present = false; PT->entries[P_i] = PDE; + invalidate: + asm volatile("invlpg (%0)" : : "r"(virtualAddress) : "memory"); } uint64_t VirtualMemoryManager::getPhysical(uint64_t virtualAddress)