IsaacWoods / poplar

Microkernel and userspace written in Rust exploring modern ideas
https://poplar.isaacwoods.dev
Mozilla Public License 2.0
251 stars 8 forks source link

Local APIC timer #15

Open IsaacWoods opened 5 years ago

IsaacWoods commented 5 years ago

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

IsaacWoods commented 5 years ago

Note: for KVM to publish the 0x4000_0010 leaf, we need to add the vmware-cpuid-freq and invtsc cpu features