Use bottom-up ELF placement policy - #1395
Merged
Merged
Conversation
Contributor
Author
|
Since now both Linux and OP-TEE shims require bottom-up page placement, the core |
Sangho Lee (sangho2)
marked this pull request as draft
September 18, 2026 22:31
Sangho Lee (sangho2)
marked this pull request as ready for review
September 18, 2026 22:59
Contributor
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 22, 2026
Sangho Lee (sangho2)
force-pushed
the
sanghle/bottom_up_elf_placement
branch
from
September 22, 2026 23:54
35aa07f to
003f199
Compare
Sangho Lee (sangho2)
force-pushed
the
sanghle/bottom_up_elf_placement
branch
from
September 23, 2026 00:13
003f199 to
e472443
Compare
|
🤖 SemverChecks 🤖 No breaking API changes detected Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered. |
dywongcloud
added a commit
to dywongcloud/litebox
that referenced
this pull request
Sep 25, 2026
Bring in the two upstream commits on top of 4964033: - df162a1 Relocate page management into dedicated modules (microsoft#1415) - fcad93e Use bottom-up ELF placement policy (microsoft#1395) Resolution: - litebox::mm::linux is now litebox::mm::vmem; every path on our side (including the macOS platform and the shims) follows the rename. - The Linux and Windows userland platforms move prot_flags and their PageManagementProvider impl, with helpers and page tests, into page_mgmt.rs. Our Windows additions (the virtual-memory mutation lock, RecommitCommitted, allocation rollback) move with them unchanged. - The mm test backend gains upstream's Windows TASK_ADDR bounds next to our Apple ones. - Bottom-up ELF placement is ported onto our loader: the main image is claimed from default_low_addr() (which honours the platform's TASK_ADDR_MIN) with MAP_FIXED_NOREPLACE and retried past racing mappings, the interpreter stays top-down, and do_mmap is pub(crate).
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.
This PR replaces the Linux shim loader's top-down fallback placement policy with a bottom-up policy. Currently, if placement of the main ELF at
DEFAULT_LOW_ADDRfails, the loader searches downward fromTASK_ADDR_MAXfor a suitable gap without accounting for trampoline allocation orbrk-based heap growth. Instead, this PR places the ELF in the first suitable gap at or aboveDEFAULT_LOW_ADDR.