mirror of
https://github.com/pithings/unkernel.git
synced 2026-12-05 22:59:37 +08:00
A CPU 0 stopped by another CPU parks in wasm_idle(-1), but its host's idle wait ends at once while CPU 0's word of pending interrupts is not 0. The stop bit stayed there (taken in cpu_relax(), or raised again by a CPU whose session ended), so CPU 0 was resumed in a loop of microtasks that starved its host's event loop, and the exit from the other CPU was never taken. Inline SMP kernels hung that way in pnpm test:api on 2 CPUs (3 of 13 runs) once exec started new images on the other CPU, where poweroff then stopped CPU 0. kw_ipi_stop() now clears the word before each wait (folded into "wasm: SMP"; the later patches change only in their hashes).