It's possible that the "early" TSC calibration gave us a value which
is known to be exact; in that case, skip the later re-calibration.
Details
Darius has a VMWARE system and has offered to test this.
This patch should result in little or no change to kern.timecounter.tc.TSC but a second of DELAY being shaved off from the boot time.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Darius (Daniel O'Connor) has tested and confirms that this operates as expected under VMWare -- the TSC-low timecounter is set up correctly, but the 1 second of calibration time is gone.
Looks reasonable to me, thanks. We could possibly also skip late calibration if CPUID leaf 0x15 is present, as I believe it is also supposed to provide an authoritative value.
I wondered about that -- does 0x15 say what the frequency *is* or what the frequency *should be*? (Thinking about overclocking etc here).
I'm already planning on splitting the vmware bit so that the cpuid value from there can be used with other hypervisors -- KVM for one publishes that leaf. (Which means it's available in EC2.)
It provides the ratio of the TSC frequency and the "core crystal clock" frequency, as well as the nominal core crystal clock frequency. CPUID leaf 0x16, which provides the "processor base frequency," is described in the SDM with the caveat that, "Data is returned from this interface in accordance with the processor's specification and does not reflect actual values." There's no similar language in the description of leaf 0x15, so that and some reading of the DPDK and Linux code makes me think that 0x15 can be trusted to give an accurate value.