From b03d906f80dbafea77669b276c36843759af5d3e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 29 Jul 2024 19:43:33 -0400 Subject: kernel/amd64: Don't try IPIs with null cpu_info Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/machdep.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys') 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 (;;); -- cgit v1.2.3