Skip to content

Remove HyperlightPEB file mappings#1380

Draft
ludfjig wants to merge 2 commits intohyperlight-dev:mainfrom
ludfjig:remove-file-mappings
Draft

Remove HyperlightPEB file mappings#1380
ludfjig wants to merge 2 commits intohyperlight-dev:mainfrom
ludfjig:remove-file-mappings

Conversation

@ludfjig
Copy link
Copy Markdown
Contributor

@ludfjig ludfjig commented Apr 15, 2026

Removes file_mappings which instead can be replaced by init_blob.

depends on #1379 first, will mark ready after

ludfjig and others added 2 commits April 14, 2026 20:05
Some linkers emit PT_LOAD segments where filesz == memsz but contain
.bss sections whose VMA range overlaps with file bytes from unrelated
sections. The loader copies the full segment verbatim, leaving .bss
with stale data instead of zeros.

Collect NOBITS section ranges (excluding .tbss) during ELF parsing and
zero-fill them after loading PT_LOAD segments.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>

Co-authored-by: danbugs <danilochiarlone@gmail.com>
Remove the nanvix-unstable-gated file_mappings field from HyperlightPEB
and all host-side code that wrote to it:
- write_file_mapping_entry in mgr.rs
- PEB layout calculations (array sizing, heap offset, getter methods)
- PEB file_mapping writes in write_peb and map_file_cow
- 3 PEB test functions (multiuse, deferred, multiple_entries)
- evolve-time write_file_mapping_entry call

Embedders that need file mapping metadata can pass it through init_data
instead of the PEB struct.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>

Co-authored-by: danbugs <danilochiarlone@gmail.com>
@ludfjig ludfjig added the kind/refactor For PRs that restructure or remove code without adding new functionality. label Apr 15, 2026
@ludfjig ludfjig marked this pull request as draft April 15, 2026 03:09
@ludfjig ludfjig mentioned this pull request Apr 15, 2026
@ludfjig ludfjig changed the title Remove file mappings Remove HyperlightPEB file mappings Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor For PRs that restructure or remove code without adding new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant