diff options
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 3a1eeb1..c09ca0e 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -111,6 +111,16 @@ try_mitigate_spectre(void) void cpu_halt_all(void) { + /* + * If we have no current 'cpu_info' structure set, + * we can't send IPIs, so just assume only the current + * processor is the only one active, clear interrupts + * then halt it. + */ + if (rdmsr(IA32_GS_BASE) == 0) { + __ASMV("cli; hlt"); + } + /* Send IPI to all cores */ lapic_send_ipi(0, IPI_SHORTHAND_ALL, halt_vector); for (;;); |