update axerrno and page_table*, add comments, bump to 0.3.0 due to incompatible deps #34
Merged
update axerrno and page_table*, add comments, bump to 0.3.0 due to incompatible deps #34
axerrno and page_table*, add comments, bump to 0.3.0 due to incompatible deps #34Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates axerrno/page_table_* dependencies to newer major versions and adapts the nested page table + address space code to the updated page_table_multiarch APIs, alongside a crate version bump to reflect breaking dependency changes.
Changes:
- Bump crate to
0.3.0and updateaxerrno,page_table_entry, andpage_table_multiarchdependency versions. - Refactor nested page table operations to use the newer cursor-based mapping/unmapping APIs and updated return types.
- Extend the test paging handler mock to support multi-frame allocation/deallocation required by the updated paging handler trait.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/test_utils/mod.rs |
Adds alloc_frames/dealloc_frames to MockHal’s PagingHandler impl for new trait requirements. |
src/npt/mod.rs |
Updates NPT type aliases and refactors map/unmap/protect APIs to the new cursor-based interfaces and types. |
src/npt/arch/x86_64.rs |
Adjusts flush_tlb to avoid test-only unused variable warnings. |
src/lib.rs |
Imports AxError for mapping-error conversion after dependency updates. |
src/address_space/mod.rs |
Updates axerrno imports to align with new dependency versions and API usage. |
src/address_space/backend/mod.rs |
Adapts protect operation to new protect_region signature. |
src/address_space/backend/linear.rs |
Adapts linear backend unmap to new unmap_region signature. |
src/address_space/backend/alloc.rs |
Adapts alloc backend unmap to new unmap return tuple shape. |
Cargo.toml |
Bumps crate + dependency versions to the new major releases. |
Comments suppressed due to low confidence (2)
src/npt/arch/x86_64.rs:195
#[allow(unused_variables)]onflush_tlbapplies to all builds, which can mask legitimate unused-variable warnings if this function changes later. Prefer scoping it to tests with#[cfg_attr(test, allow(unused_variables))](or otherwise tightening the allowance) since the unused variable only occurs under#[cfg(test)].
// Under the x86 architecture, the flush_tlb operation will invoke the ring0 instruction,
// causing the test to trigger a SIGSEGV exception.
#[allow(unused_variables)]
fn flush_tlb(vaddr: Option<GuestPhysAddr>) {
#[cfg(not(test))]
src/npt/mod.rs:106
- The doc comment on
unmapno longer reflects the method’s return type (it now returns the unmapped physical address, mapping flags, and page size). Updating the comment to describe what is returned will prevent confusion for callers and keep rustdoc accurate.
/// Unmaps a virtual address.
pub fn unmap(
&mut self,
vaddr: GuestPhysAddr,
) -> memory_set::MappingResult<(PhysAddr, MappingFlags, PageSize)> {
match self {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.