paging: move address, sizes, and utility types to paging crate#1088
Open
ziqiaozhou wants to merge 2 commits into
Open
paging: move address, sizes, and utility types to paging crate#1088ziqiaozhou wants to merge 2 commits into
ziqiaozhou wants to merge 2 commits into
Conversation
Create the paging crate and move foundational types from the kernel: - address.rs (PhysAddr, VirtAddr, Address trait), remove unused VirtPhysPair which was introduced 2 years ago and is no longer used by svsm code. - sizes.rs (PAGE_SIZE, PAGE_SHIFT, size constants) - util.rs (align_up, align_down, page_align_up, overlap, bit_mask) - Associated verus spec/proof files for verification - paging: move Verus specs and proofs into dedicated dirs - gate proofs and spec with verus_only The kernel re-exports these types to maintain API compatibility. Unit tests for utility functions move to paging/src/util.rs. Signed-off-by: Ziqiao Zhou <ziqiaozhou@microsoft.com>
00xc
reviewed
May 26, 2026
Match the license with other files. Signed-off-by: Ziqiao Zhou <ziqiaozhou@microsoft.com>
Contributor
Author
|
@joergroedel This PR is the first step for #1062 and #1100. Feel free to drop any comments if you have concerns on this change. |
joergroedel
reviewed
Jun 11, 2026
joergroedel
left a comment
Member
There was a problem hiding this comment.
A review comment from codex which I am not sure is relevant. Dropping it here for reference:
- [P2] Guard Verus specs with the cfg used by cargo-verus — /home/joro/src/svsm/paging/src/util.rs:12-18. When running the documented cargo verify --features verus flow, cargo-verus passes --cfg verus_keep_ghost (as the existing kernel code and build script expect), not verus_only. With these #[cfg(verus_only)] guards, the moved alignment specs/proofs are not included while the #[verus_spec] annotations still refer to align_up_requires, align_up_ens, etc., so verification builds of the new paging crate will fail once this crate is pulled in by kernel's verus feature.
Contributor
Author
This is not related. verus_only and verus_keep_ghost are all applied when we run |
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.
Create the paging crate and move foundational types from the kernel:
The kernel re-exports these types to maintain API compatibility. Unit tests for utility functions move to paging/src/util.rs.
Move helper functions for #1062. #1062 is based on this PR