It was coming from my paging_remap_page() function, and causing a Page Fault despite the fact a physical address was properly mapped to the faulting address.
The problem was caused by this:
Code: Select all
pte->address = (paddr & SMALL_PAGE_MASK) | (pte->flags & ~SMALL_PAGE_MASK);
paging_invalidate_page(vaddr & SMALL_PAGE_MASK);
Code: Select all
pte->address = (paddr & SMALL_PAGE_MASK) | (pte->flags & ~SMALL_PAGE_MASK);
if(pte->accessed)
{
paging_invalidate_page(vaddr & SMALL_PAGE_MASK);
}
Code: Select all
invlpg
I haven't been able to find anything in literature that documents this nuance, and I was wondering if anyone else has run into the issue.
Also, I'll leave this here if anyone else does run into it.