Skip to content

h2: boot: initialize SHIFT and TCM_VAL to zero on non-multicore path#70

Open
Brian Cain (androm3da) wants to merge 1 commit into
qualcomm:masterfrom
androm3da:bcain/qemu_boot-3
Open

h2: boot: initialize SHIFT and TCM_VAL to zero on non-multicore path#70
Brian Cain (androm3da) wants to merge 1 commit into
qualcomm:masterfrom
androm3da:bcain/qemu_boot-3

Conversation

@androm3da

Copy link
Copy Markdown
Member

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().

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untested Mark untested PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant