h2: boot: initialize SHIFT and TCM_VAL to zero on non-multicore path#70
Open
Brian Cain (androm3da) wants to merge 1 commit into
Open
h2: boot: initialize SHIFT and TCM_VAL to zero on non-multicore path#70Brian Cain (androm3da) wants to merge 1 commit into
Brian Cain (androm3da) wants to merge 1 commit into
Conversation
When MULTICORE is defined but CORE_COUNT == 0 (single-core hardware, as on the QEMU virt machine), boot.ref.S jumps directly to .Lno_multicore without executing the multicore core-synchronization block that sets SHIFT (r15) and TCM_VAL (r7). These registers are subsequently passed to H2K_thread_boot() as the multicore_shift and tcm_offset arguments. With SHIFT uninitialized, H2K_kg_init() computes a garbage phys_offset (H2K_LINK_ADDR - garbage_shift - H2K_LOAD_ADDR), corrupting the H2 kernel address-space setup and causing silent boot failures. Initialize SHIFT = #0 and TCM_VAL = #0 at .Lno_multicore so the single-core path always passes correct zero values to H2K_thread_boot(). Signed-off-by: Brian Cain <brian.cain@oss.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.
When MULTICORE is defined but CORE_COUNT == 0 (single-core hardware, as on the QEMU virt machine), boot.ref.S jumps directly to .Lno_multicore without executing the multicore core-synchronization block that sets SHIFT (r15) and TCM_VAL (r7). These registers are subsequently passed to H2K_thread_boot() as the multicore_shift and tcm_offset arguments.
With SHIFT uninitialized, H2K_kg_init() computes a garbage phys_offset (H2K_LINK_ADDR - garbage_shift - H2K_LOAD_ADDR), corrupting the H2 kernel address-space setup and causing silent boot failures.
Initialize SHIFT = #0 and TCM_VAL = #0 at .Lno_multicore so the single-core path always passes correct zero values to H2K_thread_boot().