On Sat, Nov 23, 2019 at 12:18 AM Jordan Geoghegan <jor...@geoghegan.ca> wrote: > > However the timekeeping situation for my Linux VMs is bleak. On both > Void and Alpine, no clocks are even detected. In the dmesg it complains > about the TSC clock source being unstable. Ultimately, we're left with > only jiffies as a clock source option:
Anecdotally, I've found distros using Linux kernels in the 4.9-4.14 range do ok in letting you force tsc even if it says it's unstable. Newer kernels often have a myriad of issues booting. (Might not be kernel related so much as just all the other stuff that changes around it.) If you experience either slight, chronic drift or drift related to the OpenBSD host suspending/resuming after long periods of time, I wrote a Linux kernel driver that mimics OpenBSD's vmmci(4) that may help: https://github.com/voutilad/virtio_vmmci The driver listens for notifications from vmd about clock drift events and use kernel api calls to adjust as needed, properly triggering anything scheduled. An added nicety is it'll also listen for shutdown/reboot events as well and try to cleanly reboot or halt the system via whatever init system the Linux guest uses, meaning services should have a chance to stop themselves. -Dave