#define CPUID2_X2APIC 0x00200000
#define CPUID2_POPCNT 0x00800000
#define CPUID2_AESNI 0x02000000
+#define CPUID2_VMM 0x80000000
/*
* Important bits in the AMD extended cpuid flags
#include <machine_base/apic/lapic.h>
#include <machine_base/apic/ioapic_abi.h>
#include <machine/segments.h>
+#include <machine/specialreg.h>
#include <sys/thread2.h>
#include <machine/intr_machdep.h>
mp_naps = ap_max;
}
+ if ((cpu_feature2 & CPUID2_VMM) && mp_naps == 0) {
+ /*
+ * XXX
+ * Special hack for vmware. It looks like that
+ * if only one CPU is configured (mp_naps == 0)
+ * in vmware (cpu_feature2 & CPUID2_VMM),
+ * then LAPIC will not work at all.
+ */
+ kprintf("LAPIC: single CPU virtual machine detected, "
+ "disable LAPIC\n");
+ return ENXIO;
+ }
return 0;
}