On i386 during identifycpu(), we call calibrate_cyclecounter() for every
CPU in the system. This is pointless: every new call clobbers the cpuspeed
measured during the prior call. It is also extremely slow: every call to
calibrate_cyclecounter() takes about 1 second.
Instead, let's only call calibrate_cyclecounter() once, on the primary CPU.
Multiprocessor i386 machines will now boot much faster.
ok deraadt@
-/* $OpenBSD: machdep.c,v 1.659 2023/01/10 00:49:45 cheloha Exp $ */
+/* $OpenBSD: machdep.c,v 1.660 2023/01/10 01:01:18 cheloha Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
}
break;
}
- calibrate_cyclecounter();
+ if (CPU_IS_PRIMARY(ci))
+ calibrate_cyclecounter(); /* set cpuspeed */
}
if (cpuid_level != -1)