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

Recursive Index in page tables? #88

Closed
mark-i-m opened this issue Dec 31, 2019 · 3 comments · Fixed by #116
Closed

Recursive Index in page tables? #88

mark-i-m opened this issue Dec 31, 2019 · 3 comments · Fixed by #116

Comments

@mark-i-m
Copy link
Contributor

Is it always index 0? Should this be passed in the BootInfo struct?

@phil-opp
Copy link
Member

phil-opp commented Jan 2, 2020

We used to hardcode the index to 511, but this changed with #71. Now we dynamically look for a free level 4 entry. The chosen index is indirectly reported through the recursive_page_table_addr field in the BootInfo:

/// The virtual address of the recursively mapped level 4 page table.
#[cfg(feature = "recursive_page_table")]
pub recursive_page_table_addr: u64,

It shouldn't be 0, however, because the bootloader maps itself to that slot…

@mark-i-m
Copy link
Contributor Author

mark-i-m commented Jan 2, 2020

Thanks! I eventually figured that out. Perhaps a "get recursive index" method could be added that just masks out bits 21:12 and returns a PageTableIndex?

@phil-opp
Copy link
Member

Sure, I'd be happy to merge a pull request for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants