I am planning to use the local APIC timer for a per-CPU scheduler timer to pre-empt greedy threads, so we'd ideally always like to be able to configure it correctly. We therefore need multiple back-ups to correctly find its frequency:
[x] Check if we're running under a hypervisor and if it gives us the frequency
[x] Get the core crystal clock frequency
[ ] Provide a suitable backup choice on known microarchitectures
[ ] Use another timer (such as the ACPI timer, or worst case the PIT) to time it for a known period of time
This suggests the KVM has special support for giving us the APIC frequency.
This also suggests that linux has a dedicated CPUID leaf for the hypervisor to specify timer frequencies
I am planning to use the local APIC timer for a per-CPU scheduler timer to pre-empt greedy threads, so we'd ideally always like to be able to configure it correctly. We therefore need multiple back-ups to correctly find its frequency:
This suggests the KVM has special support for giving us the APIC frequency. This also suggests that linux has a dedicated CPUID leaf for the hypervisor to specify timer frequencies