From 71b9d8cf3ba0cec43cf2e32bd04db826e9cd95f4 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 16 Jun 2011 22:36:22 +0000 Subject: [PATCH] Check for the (local) APIC feature on the CPU before moving on to SMP config and APIC enumeration. As the local APIC is the basis for inter-CPU communication, we can't do SMP when it's absent. Fixes #7692, but indeed it makes no real sense for QEMU to provide the APIC info in the MP and ACPI tables (and actually emulate the hardware) when it disables the APIC support flag at the same time. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42215 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/bios_ia32/smp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/system/boot/platform/bios_ia32/smp.cpp b/src/system/boot/platform/bios_ia32/smp.cpp index 795abda5b6..e46511c0c8 100644 --- a/src/system/boot/platform/bios_ia32/smp.cpp +++ b/src/system/boot/platform/bios_ia32/smp.cpp @@ -612,6 +612,17 @@ smp_init(void) return; #endif + cpuid_info info; + if (get_current_cpuid(&info, 1) != B_OK) + return; + + if ((info.eax_1.features & IA32_FEATURE_APIC) == 0) { + // Local APICs aren't present; As they form the basis for all inter CPU + // communication and therefore SMP, we don't need to go any further. + dprintf("no local APIC present, not attempting SMP init\n"); + return; + } + // first try to find ACPI tables to get MP configuration as it handles // physical as well as logical MP configurations as in multiple cpus, // multiple cores or hyper threading.