booter: build a self-owned LINEAR TLB for the bootvm ASID - #81
Open
stzahi1 wants to merge 3 commits into
Open
Conversation
stzahi1
force-pushed
the
booter_linear_tlb
branch
from
July 20, 2026 12:45
2ef6dea to
e7a876e
Compare
Bryan Bayerdorffer (bryanb-h2)
requested changes
Jul 22, 2026
Contributor
|
Did you look at add_linear_trans() to see if it could be repurposed for this? |
Copilot stopped work on behalf of
Neeraj Jetha (njjetha) due to an error
July 27, 2026 12:47
Neeraj Jetha (njjetha)
requested review from
Copilot
and removed request for
Copilot and
Neeraj Jetha (njjetha)
July 27, 2026 14:27
Replace the kernel's OFFSET translation with a LINEAR table the booter builds and installs itself via h2_vmtrap_newmap(), covering its own footprint (image + heap + stack) sized from BOOT_TLB_PGSIZE and PAGE_BITS. Add a GUEST_WINDOW_PAGES-sized (16M-page) window starting at H2K_GUEST_START, since load_vm() accesses guest physical memory directly through the booter's own map and needs coverage beyond the booter's footprint entries. Signed-off-by: Tzahi Sabo <stzahi@qti.qualcomm.com>
…xed guess booter_self_map() used to install a fixed GUEST_WINDOW_PAGES (5 x 16M) guest window before any guest ELF was even opened, silently capping how much guest memory the booter could read/write directly via load_vm()/ copy_vm(). Move that mapping into load_vm() itself, growing the booter's persistent LINEAR table on demand (booter_grow_guest_window()) at each point where the actual required size becomes known: the phdr load loop, the clone-path copy_vm(), and the stash-path copy_vm(). Window growth is sized per-VM using vm_params[idx].page_size instead of a hardcoded constant. booter_self_map() now builds footprint-only entries; GUEST_WINDOW_PAGES is removed. Signed-off-by: Tzahi Sabo <stzahi@qti.qualcomm.com>
stzahi1
force-pushed
the
booter_linear_tlb
branch
from
July 29, 2026 13:53
ab9a2b3 to
e461872
Compare
guest_base + pre_total_size was computed in 32-bit arithmetic before being passed to booter_grow_guest_window()'s unsigned long long parameter. For high guest_base values (e.g. opt_si's 0x87000000) the addition could wrap, silently under-growing or no-op'ing the guest LINEAR window instead of sizing it correctly. Signed-off-by: Tzahi Sabo <stzahi@qti.qualcomm.com>
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.
Replace the kernel's OFFSET translation with a LINEAR table the booter builds and installs itself via h2_vmtrap_newmap(), covering its own footprint (image + heap + stack) sized from BOOT_TLB_PGSIZE and PAGE_BITS.
Add a GUEST_WINDOW_PAGES-sized (16M-page) window starting at H2K_GUEST_START, since load_vm() accesses guest physical memory directly through the booter's own map and needs coverage beyond the booter's footprint entries.