Skip to content

Map exact page-rounded lengths in simpleguest - #1844

Merged
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:fix-simpleguest-map-length
Sep 30, 2026
Merged

ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:fix-simpleguest-map-length

Conversation

@ludfjig

@ludfjig ludfjig commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

map_region requires a page-aligned length. Adding 4096 maps an extra page when the buffer is already aligned and leaves other lengths unaligned. Round up to the smallest page multiple that covers the buffer.

Note this only affects simpleguest which is a test-only guest

`map_region` requires a page-aligned length. Adding 4096 maps an extra page when the buffer is already aligned and leaves other lengths unaligned. Round up to the smallest page multiple that covers the buffer.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 18:42
@ludfjig ludfjig added the C-bug For PRs that fix bugs label Sep 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

Only a minor regression-coverage nit remains.

Review effort: Lite
Findings: None

What changed in this PR

Updates simpleguest to map buffers using the smallest page-aligned length.

Changes:

  • Imports PAGE_SIZE.
  • Replaces fixed extra-page lengths with next_multiple_of(PAGE_SIZE).
File Description
src/​tests/​rust_guests/​simpleguest/​src/​main.rs Applies exact page-rounded lengths to read, write, and execute mappings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ludfjig ludfjig added the S-needs-review PR is ready for (re-)review label Sep 23, 2026
@github-actions github-actions Bot removed the S-needs-review PR is ready for (re-)review label Sep 30, 2026
@ludfjig
ludfjig merged commit ff297a6 into hyperlight-dev:main Sep 30, 2026
132 of 144 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants