don't let scratch region overlap with kvm apic page#1393
Merged
ludfjig merged 1 commit intohyperlight-dev:mainfrom Apr 21, 2026
Merged
don't let scratch region overlap with kvm apic page#1393ludfjig merged 1 commit intohyperlight-dev:mainfrom
ludfjig merged 1 commit intohyperlight-dev:mainfrom
Conversation
Member
|
If it looks like there is space to move the whole region, is unconditionally moving it on i686 a simpler change? That would literally just be bumping one constant in |
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
0bb7ce7 to
4e7d3b2
Compare
Contributor
Author
Changed to this instead |
ppenna
added a commit
to nanvix/nanvix
that referenced
this pull request
Apr 21, 2026
Bump hyperlight-common, hyperlight-host, and hyperlight-guest to rev 3fd3b7f64dcdd66d8a759cf22bd0a4633bfaf61d, which lowers i686 MAX_GPA from 0xFFFF_FFFF to 0xFEDF_FFFF to avoid EEXIST when the scratch KVM memory slot overlaps the APIC access page at 0xFEE00000 (hyperlight-dev/hyperlight#1393). Because the Nanvix kernel runs with identity mapping (GVA == GPA) and no page tables translate scratch addresses, all scratch-region calculations must use MAX_GPA rather than MAX_GVA: - kernel/hyperlight/mod.rs: derive scratch_base_address and scratch_bitmap_end from MAX_GPA instead of MAX_GVA. - kernel/hyperlight/mod.rs: patch PEB input_stack.ptr and output_stack.ptr at boot by subtracting the GVA-GPA delta, since the host writes these pointers using scratch_base_gva() (MAX_GVA) but the guest needs GPA-based addresses. Filed as a follow-up upstream fix in hyperlight-dev/hyperlight#1403. - kernel/hyperlight/peb.rs: read guest credits counter from MAX_GPA offset instead of MAX_GVA. - uservm/hyperlight/mod.rs: remove stale hardcoded 0xFFFFF000 reference in scratch comment. Update Cargo.lock accordingly.
ppenna
added a commit
to nanvix/nanvix
that referenced
this pull request
Apr 21, 2026
Bump hyperlight-common, hyperlight-host, and hyperlight-guest to rev 3fd3b7f64dcdd66d8a759cf22bd0a4633bfaf61d, which lowers i686 MAX_GPA from 0xFFFF_FFFF to 0xFEDF_FFFF to avoid EEXIST when the scratch KVM memory slot overlaps the APIC access page at 0xFEE00000 (hyperlight-dev/hyperlight#1393). Because the Nanvix kernel runs with identity mapping (GVA == GPA) and no page tables translate scratch addresses, all scratch-region calculations must use MAX_GPA rather than MAX_GVA: - kernel/hyperlight/mod.rs: derive scratch_base_address and scratch_bitmap_end from MAX_GPA instead of MAX_GVA. - kernel/hyperlight/mod.rs: patch PEB input_stack.ptr and output_stack.ptr at boot by subtracting the GVA-GPA delta, since the host writes these pointers using scratch_base_gva() (MAX_GVA) but the guest needs GPA-based addresses. Filed as a follow-up upstream fix in hyperlight-dev/hyperlight#1403. - kernel/hyperlight/peb.rs: read guest credits counter from MAX_GPA offset instead of MAX_GVA. - uservm/hyperlight/mod.rs: remove stale hardcoded 0xFFFFF000 reference in scratch comment. Update Cargo.lock accordingly.
ppenna
added a commit
to nanvix/nanvix
that referenced
this pull request
Apr 21, 2026
Bump hyperlight-common, hyperlight-host, and hyperlight-guest to rev 3fd3b7f64dcdd66d8a759cf22bd0a4633bfaf61d, which lowers i686 MAX_GPA from 0xFFFF_FFFF to 0xFEDF_FFFF to avoid EEXIST when the scratch KVM memory slot overlaps the APIC access page at 0xFEE00000 (hyperlight-dev/hyperlight#1393). Because the Nanvix kernel runs with identity mapping (GVA == GPA) and no page tables translate scratch addresses, all scratch-region calculations must use MAX_GPA rather than MAX_GVA: - kernel/hyperlight/mod.rs: derive scratch_base_address and scratch_bitmap_end from MAX_GPA instead of MAX_GVA. - kernel/hyperlight/mod.rs: patch PEB input_stack.ptr and output_stack.ptr at boot by subtracting the GVA-GPA delta, since the host writes these pointers using scratch_base_gva() (MAX_GVA) but the guest needs GPA-based addresses. Filed as a follow-up upstream fix in hyperlight-dev/hyperlight#1403. - kernel/hyperlight/peb.rs: read guest credits counter from MAX_GPA offset instead of MAX_GVA. - uservm/hyperlight/mod.rs: remove stale hardcoded 0xFFFFF000 reference in scratch comment. Update Cargo.lock accordingly.
ppenna
added a commit
to nanvix/nanvix
that referenced
this pull request
Apr 21, 2026
Bump hyperlight-common, hyperlight-host, and hyperlight-guest to rev 3fd3b7f64dcdd66d8a759cf22bd0a4633bfaf61d, which lowers i686 MAX_GPA from 0xFFFF_FFFF to 0xFEDF_FFFF to avoid EEXIST when the scratch KVM memory slot overlaps the APIC access page at 0xFEE00000 (hyperlight-dev/hyperlight#1393). Because the Nanvix kernel runs with identity mapping (GVA == GPA) and no page tables translate scratch addresses, all scratch-region calculations must use MAX_GPA rather than MAX_GVA: - kernel/hyperlight/mod.rs: derive scratch_base_address and scratch_bitmap_end from MAX_GPA instead of MAX_GVA. - kernel/hyperlight/mod.rs: patch PEB input_stack.ptr and output_stack.ptr at boot by subtracting the GVA-GPA delta, since the host writes these pointers using scratch_base_gva() (MAX_GVA) but the guest needs GPA-based addresses. Filed as a follow-up upstream fix in hyperlight-dev/hyperlight#1403. - kernel/hyperlight/peb.rs: read guest credits counter from MAX_GPA offset instead of MAX_GVA. - uservm/hyperlight/mod.rs: remove stale hardcoded 0xFFFFF000 reference in scratch comment. Update Cargo.lock accordingly.
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.
fixes #1389