Conversation
Unicorn's vendored QEMU defines a 52-bit guest physical address space for x86-64 (qemu/target/i386/cpu-param.h: TARGET_PHYS_ADDR_SPACE_BITS under TARGET_X86_64) and truncates accesses resolving above it, so loads from the canonical x64 alias (0xFFFFF78000000000) fault even though the page is mapped. Mirror the page at the address executed accesses resolve to (the alias masked to 52 bits) and populate every alias with live time values. Skip aliases that already have a mapping instead of letting a duplicate map break kernel-mode loading, and lock the mirroring behavior in with tests.
…n updates Build the user shared data page once and write identical bytes to every alias so all views report the same time values, instead of re-reading the clock per alias. Coalesce per-page mem_protect calls into contiguous runs of matching permissions while loading image sections.
Drop the vendored-QEMU address-space exposition above _X64_EXEC_ADDR_MASK. Behavior unchanged. KUSER bootstrap tests pass.
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.
Draft: Unicorn QEMU truncates x86-64 guest phys to 52 bits so loads from canonical KUSER alias 0xFFFFF78000000000 fault. Mirror page at truncated exec alias, single snapshot so all views agree, skip foreign maps, batch mem_protect runs. Tests: tests/test_kernel_bootstrap.py KUSER cases (2 passed locally; 1 pre-existing failure is missing capa sample, unrelated).