Skip to content
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

Feat(kernel/vm): allocate virtual memory spot #165

Merged
merged 56 commits into from
Dec 15, 2024
Merged

Conversation

JonasKruckenberg
Copy link
Owner

@JonasKruckenberg JonasKruckenberg commented Dec 13, 2024

Implement the find_spot method that searches the augmented wavltree of mappings for a suitable gap given a Layout. The resulting spot will be randomized, but left-leaning.
Further method accepts an entropy_bits parameter that can be used to tune the sparseness of produced allocations. More consideration for this parameter can be found in the docs (docs/aslr.md)

Note this PR builds on #158

This change removes dependency on `alloc` from the loader, to archive this we removed the lz4 compression feature, use `xmas-elf` instead of `object` and don't use `panic-abort`.

This chage makes the loader slimmer and helps with upcoming refactoring
With the previous change `panic-abort` has now become obsolete
In preparation for the virtmem overhaul, this change moves the elf mapping functionality from the `kmm` crate to the loader.
This change allows managing an existing page table through the pmm interface
This change adds another method to the `Once` primitive that allows fallible closures
This change allows `Riscv64Sv39` to print its page table when displayed using the `Display` trait
This change removes the admittedly overengineered `Arch` trait that caused viral generics throughout all dependents with simple functions and consts
JonasKruckenberg and others added 24 commits December 12, 2024 13:07
This change uses the `wavltree` lifecycle hooks to maintain an augmented version of the WAVLTree that supports more efficient gap search. This is inspired by a similar inspiration in the Zircon kernel and works by tracking the largest and smallest address of each nodes subtree, as well as the biggest gap in each subtree.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Implement the `find_spot` method that searches the augmented wavltree of mappings for a suitable gap given a `Layout`. The resulting spot will be randomized, but left-leaning.
Further method accepts an `entropy_bits` parameter that can be used to tune the sparseness of produced allocations. More consideration for this parameter can be found in the docs (docs/aslr.md)
@JonasKruckenberg JonasKruckenberg merged commit 4827a14 into main Dec 15, 2024
16 checks passed
@JonasKruckenberg JonasKruckenberg deleted the feat/find-spot branch December 16, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant