Restrict the faulting addresses we call pmap_fault from to just those that

may fault due to superpage mappings being changed.

Sponsored by:	DARPA, AFRL
This commit is contained in:
andrew 2018-05-21 16:14:53 +00:00
parent 482d0f575f
commit 5d4a66a5af

View File

@ -189,8 +189,16 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr,
}
}
if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
return;
/*
* We may fault from userspace or when in a DMAP region due to
* a superpage being unmapped when the access took place. In these
* cases we need to wait for the pmap to be unlocked and check
* if the translation is still invalid.
*/
if (map != kernel_map || VIRT_IN_DMAP(far)) {
if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
return;
}
KASSERT(td->td_md.md_spinlock_count == 0,
("data abort with spinlock held"));