Kernel: Reduce the number of TLB invalidations

Invalidations are not done if mapping or unmapping previously unmapped
page. TLB invalidate IPIs are now ignored if they don't affect the
currently mapped address space
This commit is contained in:
2026-01-16 16:22:29 +02:00
parent 1143dc3cae
commit 34e84f8b07
5 changed files with 41 additions and 15 deletions

View File

@@ -370,6 +370,8 @@ namespace Kernel
switch (message->type)
{
case SMPMessage::Type::FlushTLB:
if (message->flush_tlb.page_table && message->flush_tlb.page_table != processor.m_current_page_table)
break;
for (size_t i = 0; i < message->flush_tlb.page_count; i++)
asm volatile("invlpg (%0)" :: "r"(message->flush_tlb.vaddr + i * PAGE_SIZE) : "memory");
break;