Kernel: Assert on page fault during IRQ

We're not equipped to deal with page faults during an IRQ handler,
so add an assertion so we can immediately tell what's wrong.

This is why profiling sometimes hangs the system -- walking the stack
of the profiled thread causes a page fault and things fall apart.
This commit is contained in:
Andreas Kling 2020-02-21 12:26:12 +01:00
commit d46071c08f
Notes: sideshowbarker 2024-07-19 09:11:20 +09:00
4 changed files with 9 additions and 0 deletions

View file

@ -281,6 +281,7 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
{
ASSERT_INTERRUPTS_DISABLED();
ASSERT(Thread::current);
ASSERT(!g_in_irq);
#ifdef PAGE_FAULT_DEBUG
dbgprintf("MM: handle_page_fault(%w) at V%p\n", fault.code(), fault.vaddr().get());
#endif