From 1f540722955551b1ea320de1f0105e23be5caf53 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Sat, 27 Sep 2025 00:47:51 -0700 Subject: [PATCH] [platform][pc] when building with SMP, don't even attempt to bring up the local apic Not exactly what we want but avoids the lapic code needing the per cpu structures which aren't set up without SMP support. Consider leaving the percpu structure in, just only support for cpu 0. This fixes trying to boot the X86_LEGACY build on a machine with a local apic. --- platform/pc/interrupts.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/pc/interrupts.c b/platform/pc/interrupts.c index 6f174ce3..34161a9d 100644 --- a/platform/pc/interrupts.c +++ b/platform/pc/interrupts.c @@ -50,7 +50,10 @@ static struct int_vector int_table[INT_VECTORS]; void platform_init_interrupts(void) { pic_init(); + +#if WITH_SMP lapic_init(); +#endif // initialize all of the vectors for (int i = 0; i < INT_VECTORS; i++) { @@ -227,9 +230,11 @@ static void io_apic_callback(const void *_entry, size_t entry_len, void *cookie) #endif void platform_init_interrupts_postvm(void) { +#if WITH_SMP // Bring up the local apic on the first cpu // Doesn't need ACPI to detect its presence lapic_init_postvm(); +#endif #if WITH_LIB_ACPI_LITE // Now that we've scanned ACPI, try to initialize the ioapic(s)