-
Notifications
You must be signed in to change notification settings - Fork 7
h2: capture boot registers and forward a DTB address to the Linux guest #72
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
Open
Brian Cain (androm3da)
wants to merge
3
commits into
qualcomm:master
Choose a base branch
from
androm3da:bcain/qemu_boot-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,10 +70,48 @@ | |
| #define CORE_DONE 0x1 | ||
|
|
||
| FUNC_START start .entry .p2align 12 | ||
| /* | ||
| * STANDALONE test links pull this object in solely for | ||
| * h2_boot_params (referenced by info.ref.c) and supply their own | ||
| * `start' via crt0_standalone.o. Weak lets that definition win | ||
| * instead of colliding; real (non-STANDALONE) links still resolve | ||
| * to this one, since it's the only definition present there. | ||
| */ | ||
| .weak start | ||
| jump .Lpast_mbox | ||
| .space 0x200 // FIXME: needs to be enough for all angel mailboxes but still fit all code in 4K | ||
|
|
||
| /* | ||
| * Boot parameter block: lives at a fixed offset in the entry page | ||
| * so that boot firmware or external tooling can locate and patch | ||
| * it. The first two words capture r1:0 as they were at reset on | ||
| * the boot thread; bootloaders pass the device tree blob physical | ||
| * address there for forwarding to a guest. The remaining pad is | ||
| * reserved for future parameters or a patched-in platform-specific | ||
| * boot stub. | ||
| */ | ||
| .p2align 3 | ||
| .globl h2_boot_params | ||
| h2_boot_params: | ||
| .word 0 // r0 at entry (e.g. DTB physical address, low) | ||
| .word 0 // r1 at entry (e.g. DTB physical address, high) | ||
| .space 0x38 // reserved | ||
|
|
||
| .Lpast_mbox: | ||
| /* | ||
| * Capture r1:0 into the boot parameter block before anything | ||
| * clobbers them. Only the boot thread's values are meaningful; | ||
| * secondary hardware threads also enter here when started later. | ||
| */ | ||
| r10 = HTID | ||
| { | ||
| p0 = cmp.eq(r10,#0) | ||
| if (!p0.new) jump:nt .Lpast_bootparam_capture | ||
| } | ||
| r10 = add(PC,##h2_boot_params@PCREL) | ||
| memd(r10+#0) = r1:0 | ||
| dccleana(r10) // reach memory before the cache kill below | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Caches should be off at this point. Guess this can't hurt. |
||
| .Lpast_bootparam_capture: | ||
|
|
||
| #ifdef CRASH_DEBUG | ||
| r7 = PC | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to H2K_boot_params.