Move linear memory faulted guard page tracking into Memory.

This commit moves the tracking for faulted guard pages in a linear memory into
`Memory`.
This commit is contained in:
Peter Huene
2021-03-08 09:23:17 -08:00
parent 7a93132ffa
commit 5fa0f8d469
5 changed files with 76 additions and 57 deletions

View File

@@ -313,8 +313,12 @@ unsafe fn handle_page_fault(
None => {
log::trace!("out of bounds memory access at {:p}", addr);
// Record the guard page fault with the instance so it can be reset later.
instance.record_guard_page_fault(page_addr, len, reset_guard_page);
// Record the guard page fault so the page protection level can be reset later
instance.memories[memory_index].record_guard_page_fault(
page_addr,
len,
reset_guard_page,
);
wake_guard_page_access(&uffd, page_addr, len)?;
}
}