Skip to content

Commit

Permalink
Merge pull request #1508 from hermit-os/no_unmap_error
Browse files Browse the repository at this point in the history
uhyve: don't panic on initial unmap if page is not mapped
  • Loading branch information
mkroening authored Dec 11, 2024
2 parents 0ce8753 + 718eb38 commit 55b15ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/arch/x86_64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,11 @@ pub fn init_page_tables() {

let mut page_table = unsafe { recursive_page_table() };
for page in page_range {
let (_frame, flush) = page_table.unmap(page).unwrap();
flush.ignore();
match page_table.unmap(page) {
Ok((_frame, flush)) => flush.ignore(),
Err(UnmapError::PageNotMapped) => {} // If it wasn't mapped, that's not an issue
Err(e) => panic!("Couldn't unmap page {page:?}: {e:?}"),
}
}

tlb::flush_all();
Expand Down

0 comments on commit 55b15ad

Please sign in to comment.