-
Notifications
You must be signed in to change notification settings - Fork 143
A VirtualAddr
panic is triggered when the page table called clean_up
#468
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
Comments
Some progress: [#0] 0xffffff0000085a11 → x86_64::addr::VirtAddr::new(addr=<optimized out>, addr=<optimized out>)
[#1] 0xffffff0000085a11 → x86_64::addr::{impl#8}::add(rhs=<optimized out>, rhs=<optimized out>)
[#2] 0xffffff0000085a11 → x86_64::structures::paging::mapper::mapped_page_table::{impl#5}::clean_up_addr_range::clean_up<PhysOffset, ...>()
[#3] 0xffffff000006ee55 → x86_64::structures::paging::mapper::mapped_page_table::{impl#5}::clean_up_addr_range<PhysOffset, ..>(...) |
Does this patch fix the issue? diff --git a/src/structures/paging/mapper/mapped_page_table.rs b/src/structures/paging/mapper/mapped_page_table.rs
index 25e83e1..53fc869 100644
--- a/src/structures/paging/mapper/mapped_page_table.rs
+++ b/src/structures/paging/mapper/mapped_page_table.rs
@@ -646,7 +646,11 @@ impl<'a, P: PageTableFrameMapping> CleanUp for MappedPageTable<'a, P> {
.skip(usize::from(start))
{
if let Ok(page_table) = page_table_walker.next_table_mut(entry) {
- let start = table_addr + (offset_per_entry * (i as u64));
+ let start = VirtAddr::forward_checked_impl(
+ table_addr,
+ (offset_per_entry as usize) * i,
+ )
+ .unwrap();
let end = start + (offset_per_entry - 1);
let start = Page::<Size4KiB>::containing_address(start);
let start = start.max(range.start); |
It will fix this issue in my case. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm migrating to v0.15.0, found that a
VirtualAddr
panic is triggered when the page table calledclean_up
.It caused by the
new
function introduced in #370.But since my kernel doesn't have backtrace, I am trying to find out why this is happening through step-by-step debugging.
The text was updated successfully, but these errors were encountered: