Skip to content

update axerrno and page_table*, add comments, bump to 0.3.0 due to incompatible deps #34

Merged
aarkegz merged 8 commits intomasterfrom
aar-master
Mar 5, 2026
Merged

update axerrno and page_table*, add comments, bump to 0.3.0 due to incompatible deps #34
aarkegz merged 8 commits intomasterfrom
aar-master

Conversation

@aarkegz
Copy link
Copy Markdown
Contributor

@aarkegz aarkegz commented Mar 5, 2026

No description provided.

@aarkegz aarkegz requested a review from hky1999 March 5, 2026 11:34
@aarkegz aarkegz self-assigned this Mar 5, 2026
hky1999
hky1999 approved these changes Mar 5, 2026
Copy link
Copy Markdown
Contributor

@hky1999 hky1999 left a comment

Choose a reason for hiding this comment

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

CI checks error

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.0 and update axerrno, page_table_entry, and page_table_multiarch dependency 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)] on flush_tlb applies 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 unmap no 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.

Copy link
Copy Markdown
Contributor

@hky1999 hky1999 left a comment

Choose a reason for hiding this comment

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

LGTM

@aarkegz aarkegz merged commit 1d16ab8 into master Mar 5, 2026
24 checks passed
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 this pull request may close these issues.

4 participants