summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-29 19:43:33 -0400
committerIan Moffett <ian@osmora.org>2024-07-29 19:43:33 -0400
commitb03d906f80dbafea77669b276c36843759af5d3e (patch)
tree3996606946fcfd31e38c5e8f6f20d4cfa4eb8bd2
parentd9ffdf1527a8b8c8289241893f6411b7a84f7347 (diff)
kernel/amd64: Don't try IPIs with null cpu_info
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/arch/amd64/amd64/machdep.c10
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 (;;);