From: Dave Voutila Subject: Re: Improving time keeping in x86 VMs To: Mike Larkin Cc: Stefan Fritsch , tech@openbsd.org Date: Tue, 03 Jun 2025 06:35:49 -0400 Mike Larkin writes: > On Fri, May 30, 2025 at 09:23:27AM +0200, Stefan Fritsch wrote: >> On Mon, 19 May 2025, Mike Larkin wrote: >> >> I don't usually use vmm and don't know what normally works on vmm and what >> does not. Therefore I have some doubts that I am the right persion to do >> the testing, but I have tried booting the installer ISOs on openbsd >> -current with my vmm patch on an core i5-8365U. I have looked at the >> output of "while sleep 1; do date; done" (or something equivalent if >> "date" was not available). I have successfully checked these distros >> (kernel versions taken from uname -a): >> >> centos 6.10 2.6.32-754.el6.x86_64 >> >> debian 8.8 3.16.0-4-amd64 >> debian 12.10 6.1.0-32-amd64 >> >> fedora 39 6.5.6-300.fc39.x86_64 >> fedora 41 6.11.4-301.fc41.x86_64 >> >> alpine 3.21 6.12.13-0-virt >> >> ubuntu 18.04 4.15.0-20-generic >> ubuntu 20.04.6 5.4.0-144-generic >> ubuntu 22.04.5 5.15.0-119-generic >> ubuntu 25.04 6.14.0-15-generic >> >> For centos 6.10, debian 8.8, fedora 39+41, I have also tried this without >> my patch. On centos 6.10 and debian 8.8, "sleep 1" takes ~ 5 seconds >> without my patch, but only 1 second with my patch. fedora 39+41 seem to >> use clocksource tsc without my patch, so they don't have that problem. >> >> Debian 8.8 does not find its cdrom due to missing virtio-scsi driver but >> rescue shell works. I remember that this was a problem in old Debian >> installers. >> >> Fedora 39+41 don't find the cdrom either, with fed 41 I have debugged this >> until >> >> systemd-coredump[1172]: Process 1157 (cdrom_id) of user 0 terminated >> abnormally with signal 6/ABRT, processing... >> >> After a long wait I get the rescue shell. The behavior is identical >> with/without my patch. >> >> I could not get ubuntu 16.04 to boot without vga, the bootloader fails >> already. >> >> The list above covers a wide range of linux versions. As only very few kvm >> features were present in the first kvm versions, linux as a guest >> dutifully checks the cpuid feature bits. Therefore I don't expect that >> more casual testing would reveal more issues. Also, sometimes linux uses >> tsc as clocksource at boot but is later unhappy with it and switches to a >> different clock source. I saw this on one alpine linux VM on bluhm's >> system when I started looking at this. I also expect that behaviour may be >> different depending on the cpu type and the number of sockets in the host >> system. One would need much more testers to cover these cases. >> >> An updated diff to account for changes in -current is attached below. This >> includes only the vmm(4) part. The pvclock(4) part is covered in a >> separate sub-thread. >> >> Cheers, >> Stefan >> > > Thanks for testing. ok mlarkin. > > -ml > Given the testing I'm happy to see this go in and happy to support any fallout if it happens. Would love to kill off my hacky Linux kernel module for fixing time keeping. -dv