redshirt
redshirt copied to clipboard
Panicking is per-CPU
Since we're slowly getting support for multiple CPUs, there's a design issue here: each CPU will panic individually.
This is not a problem per se. Rust already provides tools to handle this when a thread panics individually. In particular, all the rules regarding panic safety are the same for threads and for CPUs.
The problem is that any panic message on x86 will quickly get overwritten by the normal execution of other CPUs, and it might be hard to actually notice that something wrong happened.
We might want to stop all the CPUs here and print a "BSOD" instead. I suppose that Linux/other OSes do that by emitting an IPI whose handler halts the target CPU.