pc64: disable interrupts in mmuwalk() for checkmmu()

we have to disable interrupts during mmuwalk() of user pages
as we can get preempted during mmu walk and the original
m->pml4 might become one of a different process.
This commit is contained in:
cinap_lenrek 2020-07-16 03:11:27 +02:00
parent 77ddc8c654
commit e7e6f4fc90

View file

@ -517,12 +517,17 @@ putmmu(uintptr va, uintptr pa, Page *)
void
checkmmu(uintptr va, uintptr pa)
{
uintptr *pte;
uintptr *pte, old;
int x;
x = splhi();
pte = mmuwalk(m->pml4, va, 0, 0);
if(pte != 0 && (*pte & PTEVALID) != 0 && PPN(*pte) != pa)
print("%ld %s: va=%#p pa=%#p pte=%#p\n",
up->pid, up->text, va, pa, *pte);
if(pte == 0 || ((old = *pte) & PTEVALID) == 0 || PPN(old) == pa){
splx(x);
return;
}
splx(x);
print("%ld %s: va=%#p pa=%#p pte=%#p\n", up->pid, up->text, va, pa, old);
}
uintptr