Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uhyve: don't panic on initial unmap if page is not mapped #1508

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to what we do in paging::unmap. Would it make sense to log this too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so unless you like ~510 lines of info log output on a normal boot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would not have to use info. But if you don't think a debug or trace is useful, that's fine for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't think it is worth it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a TODO into the comment or will this be tracked in an issue?

Copy link
Member Author

@jounathaen jounathaen Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is sufficient not to panic for a while, and as soon as the Uhyve version that doesn't map the memory anymore (hermit-os/uhyve@700425d btw) is out for a while, we completely remove this part. We can track it in hermit-os/uhyve#426 or create a new issue.

Err(e) => panic!("Couldn't unmap page {page:?}: {e:?}"),
}
}

tlb::flush_all();
Expand Down
Loading