16-CURRENT is running in a UTM VM on a very new MacBook laptop. Initially the time is synced with an outside NTP server. The time is running fine. ntpd is not running. How to reproduce the problem: 1. Suspend the host system by closing the laptop lid and disconnecting power. 2. Wake it up after 5 minutes. 3. Observe that the time is behind by ~30 secs. The problem is reproducible. It looks like FreeBSD updates the time after it wakes up but it doesn't update it correctly. The time is behind by 30 secs, not 5 minutes.
IMO, the expected behavior is that there should be correct time adjustment on wake-up without the need of forced NTP update in /etc/rc.resume scripts.
Some relevant sysctl values: kern.timecounter.nanosleep_precise: 1 kern.timecounter.fast_gettime: 1 kern.timecounter.tick: 1 kern.timecounter.choice: ARM MPCore Timecounter(1000) dummy(-1000000) kern.timecounter.hardware: ARM MPCore Timecounter kern.timecounter.alloweddeviation: 5 kern.timecounter.timehands_count: 2 kern.timecounter.stepwarnings: 0 kern.timecounter.tc.ARM MPCore Timecounter.quality: 1000 kern.timecounter.tc.ARM MPCore Timecounter.frequency: 24000000 kern.timecounter.tc.ARM MPCore Timecounter.counter: 818740853 kern.timecounter.tc.ARM MPCore Timecounter.mask: 4294967295 kern.eventtimer.choice: ARM MPCore Eventtimer(1000) kern.eventtimer.et.ARM MPCore Eventtimer.quality: 1000 kern.eventtimer.et.ARM MPCore Eventtimer.frequency: 24000000 kern.eventtimer.et.ARM MPCore Eventtimer.flags: 6 kern.eventtimer.periodic: 0 kern.eventtimer.timer: ARM MPCore Eventtimer kern.eventtimer.idletick: 0 kern.eventtimer.singlemul: 4
This might be a bug in the hypervisor if it is not skewing the timecounter value sufficiently after a sleep in which case there is not anything FreeBSD as a guest can do about that. It might be that FreeBSD needs to handle an event from the hypervisor invoked after a wakeup during a resume (I'm not sure if that hypervisor even has such an event), but if such an event did exist, it would need to just trigger NTP. I don't think there's any real solution to this that doesn't involve NTP in some fashion.
QEMU is a hypervisor in UTM on MacOS.