Skip to content

Commit

Permalink
uhyve: don't panic on initial unmap if page is not mapped
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Dec 10, 2024
1 parent fcb871c commit 718eb38
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 718eb38

Please sign in to comment.