-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change host's memory setup to be minimally configured #297
Draft
danbugs
wants to merge
7
commits into
hyperlight-dev:main
Choose a base branch
from
danbugs:danbugs/memory-layout
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,888
−9,557
Conversation
This file contains 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
danbugs
added a commit
to danbugs/hyperlight
that referenced
this pull request
Feb 27, 2025
…st code to start at 0x0 instead of after paging sections This is the first step in moving memory sections around to provide a more generic layout. After this, I'll move continue moving sections to fulfill the layout shown in the description for PR hyperlight-dev#297. Changes: - removed no longer applicable checks in hypervisor_handler - changed the way we build memory in get_memory_regions - added functions to get the offsets/addresses to paging sections as they are no longer static from 0x0 and are now relative to code size - updated code docs - changed set_up_shared_memory to properly place paging sections - updated paging docs Signed-off-by: danbugs <[email protected]>
danbugs
added a commit
to danbugs/hyperlight
that referenced
this pull request
Feb 27, 2025
…st code to start at 0x0 instead of after paging sections This is the first step in moving memory sections around to provide a more generic layout. After this, I'll move continue moving sections to fulfill the layout shown in the description for PR hyperlight-dev#297. Changes: - removed no longer applicable checks in hypervisor_handler - changed the way we build memory in get_memory_regions - added functions to get the offsets/addresses to paging sections as they are no longer static from 0x0 and are now relative to code size - updated code docs - changed set_up_shared_memory to properly place paging sections - updated paging docs Signed-off-by: danbugs <[email protected]>
56852a6
to
40a8091
Compare
… be 0x0. We had an arbitrary unmapped section of memory from 0x0 to 0x200_000 (2MB). This was reported to be a point of friction when embedding custom guests. Changes: - removed custom write for page 0. - fixed get_address macro to work properly when guest_offset == 0. - removed test that no longer makes sense w/ starting mem at 0x0. - cleaned docs/comments referring to mapped memory starting at 0x200_000. - fixed some typos. Signed-off-by: danbugs <[email protected]>
…st code to start at 0x0 instead of after paging sections This is the first step in moving memory sections around to provide a more generic layout. After this, I'll move continue moving sections to fulfill the layout shown in the description for PR hyperlight-dev#297. Changes: - removed no longer applicable checks in hypervisor_handler - changed the way we build memory in get_memory_regions - added functions to get the offsets/addresses to paging sections as they are no longer static from 0x0 and are now relative to code size - updated code docs - changed set_up_shared_memory to properly place paging sections - updated paging docs Signed-off-by: danbugs <[email protected]>
f692bda
to
b7435ae
Compare
…},sandbox/config},testing/lib,Justfile,Cargo.toml,.gitignore] added custom guest memory region and tmp custom guest Context: Instead of having a static memory layout set by the host, we want to provide the guest w/ a custom sized allocated undifferentiated memory region for it address in any way it wants. This commit starts that by adding the custom guest memory region. Changes: - added new section to SandboxMemoryLayout, and made getters for its offset and size. - changed get_total_page_table_size calculation to account for custom section. - added new section to builder in get_memory_regions. - wrote address of custom guest memory region to custom guest memory offset. - added new memory section to page table setup (i.e., set_up_shared_memory). - added function to get custom guest memory region as Vec<u8>. - made custom guest memory section size configurable via SandboxConfiguration. - fixed existing tests. - added new guest (customguest) to test custom setup. Modified Justfile to include it for easy builds too. - added new test for custom init with the new customguest. Signed-off-by: danbugs <[email protected]>
b7435ae
to
ce255f8
Compare
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
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.
We want to allow embedding custom guests in Hyperlight, but, currently, the static memory layout we configure in the host is too strict. This PR is modifying our memory layout to be minimally configured.
Here's a wip view of the memory layout for when this PR is finished:

Changes: