Index: sys/arch/arm64/arm64/cpu.c =================================================================== RCS file: /cvs/src/sys/arch/arm64/arm64/cpu.c,v retrieving revision 1.84 diff -u -p -u -p -r1.84 cpu.c --- sys/arch/arm64/arm64/cpu.c 9 Feb 2023 23:35:06 -0000 1.84 +++ sys/arch/arm64/arm64/cpu.c 20 Feb 2023 06:01:15 -0000 @@ -949,12 +949,18 @@ cpu_boot_secondary_processors(void) CPU_INFO_ITERATOR cii; CPU_INFO_FOREACH(cii, ci) { + ci->ci_randseed = (arc4random() & 0x7fffffff) + 1; + atomic_setbits_int(&ci->ci_flags, CPUF_GO); + __asm volatile("dsb sy; sev" ::: "memory"); + arm_send_ipi(ci, ARM_IPI_NOP); + } + CPU_INFO_FOREACH(cii, ci) { if ((ci->ci_flags & CPUF_AP) == 0) continue; if (ci->ci_flags & CPUF_PRIMARY) continue; - ci->ci_randseed = (arc4random() & 0x7fffffff) + 1; +// ci->ci_randseed = (arc4random() & 0x7fffffff) + 1; cpu_boot_secondary(ci); } } @@ -1017,17 +1023,21 @@ cpu_start_secondary(struct cpu_info *ci, void cpu_boot_secondary(struct cpu_info *ci) { - atomic_setbits_int(&ci->ci_flags, CPUF_GO); - __asm volatile("dsb sy; sev" ::: "memory"); +// atomic_setbits_int(&ci->ci_flags, CPUF_GO); + //__asm volatile("dsb sy; sev" ::: "memory"); /* * Send an interrupt as well to make sure the CPU wakes up * regardless of whether it is in a WFE or a WFI loop. */ - arm_send_ipi(ci, ARM_IPI_NOP); - - while ((ci->ci_flags & CPUF_RUNNING) == 0) +// arm_send_ipi(ci, ARM_IPI_NOP); + int wait_i = 0; + while ((ci->ci_flags & CPUF_RUNNING) == 0) { __asm volatile("wfe"); + wait_i++; + if(wait_i >= 10) break; + delay(1000000); + } } void