diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-12-16 23:50:52 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-12-16 23:50:52 -0500 |
commit | 31bfad632b0cad16795cdb43f4854a1e50a5eed0 (patch) | |
tree | 77a1e402ecc2dcd2b447fc1b0d0fd07540b29a92 /src | |
parent | 993f9d3a48593e6407c81e042dc0b6010be59e1e (diff) | |
download | seabios-31bfad632b0cad16795cdb43f4854a1e50a5eed0.tar.gz |
Don't turn off apic after smp detect; use cmos for smp count on emulators.
Don't restor the APIC_SVR value - doing so confuses kvm.
When running on an emulator, get the smp count from cmos (timing on an
emulator - especially when simulating large cpu counts - is too
unreliable to do a count based on timers.)
Diffstat (limited to 'src')
-rw-r--r-- | src/cmos.h | 1 | ||||
-rw-r--r-- | src/smpdetect.c | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -39,6 +39,7 @@ #define CMOS_MEM_HIGHMEM_LOW 0x5b #define CMOS_MEM_HIGHMEM_MID 0x5c #define CMOS_MEM_HIGHMEM_HIGH 0x5d +#define CMOS_BIOS_SMP_COUNT 0x5f // CMOS_FLOPPY_DRIVE_TYPE bitdefs #define CFD_NO_DRIVE 0 diff --git a/src/smpdetect.c b/src/smpdetect.c index 7f0c7aaa..02740263 100644 --- a/src/smpdetect.c +++ b/src/smpdetect.c @@ -7,6 +7,7 @@ #include "util.h" // dprintf #include "config.h" // CONFIG_* +#include "cmos.h" // CMOS_BIOS_SMP_COUNT #define CPUID_APIC (1 << 9) @@ -96,10 +97,13 @@ smp_probe(void) writel(APIC_ICR_LOW, 0x000C4600 | sipi_vector); // Wait for other CPUs to process the SIPI. - mdelay(10); + if (CONFIG_COREBOOT) + mdelay(10); + else + while (inb_cmos(CMOS_BIOS_SMP_COUNT) + 1 != readl(&smp_cpus)) + ; // Restore memory. - writel(APIC_SVR, val); *(u64*)BUILD_AP_BOOT_ADDR = old; u32 count = readl(&smp_cpus); |