From e83f6bcb75fb0ca55a67121e07f2963e6af7f6e7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 13 Dec 2005 18:29:10 +0000 Subject: [PATCH] Revert previous commit. The BIOS braindamage is even worse than I originally thought. The BIOS that cleared CPUID_APIC actually managed to disable the local APIC entirely and even Windows 64 doesn't boot on it. Reported by: bz --- sys/amd64/amd64/local_apic.c | 4 ++++ sys/i386/i386/local_apic.c | 11 ++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/amd64/amd64/local_apic.c b/sys/amd64/amd64/local_apic.c index df8bcd88e9b0..e81ac65ed77a 100644 --- a/sys/amd64/amd64/local_apic.c +++ b/sys/amd64/amd64/local_apic.c @@ -831,6 +831,10 @@ apic_init(void *dummy __unused) struct apic_enumerator *enumerator; int retval, best; + /* We only support built in local APICs. */ + if (!(cpu_feature & CPUID_APIC)) + return; + /* Don't probe if APIC mode is disabled. */ if (resource_disabled("apic", 0)) return; diff --git a/sys/i386/i386/local_apic.c b/sys/i386/i386/local_apic.c index 53ebc0a108f9..f2d96b572179 100644 --- a/sys/i386/i386/local_apic.c +++ b/sys/i386/i386/local_apic.c @@ -834,15 +834,8 @@ apic_init(void *dummy __unused) uint64_t apic_base; int retval, best; - /* - * We only support built in local APICs. Unfortunately, we can't - * just check the CPUID_APIC bit in cpu_features because some BIOSen - * don't set that flag. Instead, we assume that all Pentium-class - * and later machines have a local APIC. The only non-Pentium-class - * CPUs that can talk to an external APIC are 486s, so we just - * bail if we are on a 486. - */ - if (cpu_class == CPUCLASS_486) + /* We only support built in local APICs. */ + if (!(cpu_feature & CPUID_APIC)) return; /* Don't probe if APIC mode is disabled. */