mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Add a _very_ basic TLB shootdown mechanism
This TLB shootdown implementation is pretty janky: When the kernel unmaps a mapping, it sends an IPI to all other cores and doesn't even wait to ensure they've finished handling it. Upon getting one of these IPIs, the core just re-writes cr3 to flush all TLBs.
This commit is contained in:
@@ -21,6 +21,7 @@ constexpr uintptr_t apic_eoi_addr = 0xfee000b0 + mem::linear_offset;
|
||||
extern "C" {
|
||||
void isr_handler(cpu_state*);
|
||||
void irq_handler(cpu_state*);
|
||||
void _reload_cr3();
|
||||
}
|
||||
|
||||
uint8_t
|
||||
@@ -187,6 +188,11 @@ isr_handler(cpu_state *regs)
|
||||
scheduler::get().schedule();
|
||||
break;
|
||||
|
||||
case isr::ipiShootdown:
|
||||
// TODO: Real shootdown algorithm
|
||||
_reload_cr3();
|
||||
break;
|
||||
|
||||
default:
|
||||
util::format({message, sizeof(message)}, "Unknown interrupt 0x%lx", regs->interrupt);
|
||||
kassert(false, message, regs);
|
||||
|
||||
Reference in New Issue
Block a user