-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversation
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I'm reworking the initial page mapping of uhyve to resolve hermit-os/uhyve#426, but the kernel currently expects the first GiB to be mapped and panics otherwise.
In a transition phase, it makes sense to at least not panic if the page is not mapped.