QEMU virt64 AArch64 SMP Boot Overview CPU0 completes the shared platform bring-up first, then wakes the remaining CPUs and all cores join the same scheduler. Boot CPU path Secondary CPU path Shared runtime state Boot CPU 1 BootROM / BL1 QEMU firmware handoff Load the image and jump to _start. x0 carries the DTB physical address. 2 _start entry_point.S Kernel entry for CPU0. Sets up the first control flow. 3 Early assembly setup init_cpu_el / init_kernel_bss / init_cpu_stack_early Synchronize to EL1h, clear BSS, set SP_EL1. Save the FDT and enable the early MMU map. 4 rtthread_startup src/components.c Disable local IRQs and start the kernel initialization backbone. 5 rt_hw_common_setup libcpu/aarch64/common/setup.c Build the full MMU map, memblock, and heap. Initialize GIC, UART, GTIMER, and SMP IPIs. 6 rt_system_scheduler_start CPU0 starts scheduling The main thread becomes the first runnable task. 7 main_thread_entry Before user main() Wake the remaining CPUs before the application starts running. 8 rt_hw_secondary_cpu_up entry PA plus enable-method Resolve PA(_secondary_cpu_entry). Issue PSCI CPU_ON or spin-table wakeup. Secondary CPU 9 _secondary_cpu_entry entry_point.S Read MPIDR, find the logical CPU id, set TPIDR and the private stack. 10 rt_hw_secondary_cpu_bsp_start libcpu/aarch64/common/setup.c Bind the shared MMU table, initialize local GIC, GTIMER, SMP IPI, and CPU device. PSCI CPU_ON wakes the target CPU Shared scheduler state rt_system_scheduler_start on all CPUs CPU0 continues from main(); CPU1..N-1 join after local BSP bring-up. CPU0 keeps running Secondary CPUs join after local BSP bring-up Key source files: libcpu/aarch64/cortex-a/entry_point.S, libcpu/aarch64/common/setup.c, src/components.c