oomol-lab / ovm

Run ovm-core virtual machine on Apple Virtualization Framework
Mozilla Public License 2.0
6 stars 3 forks source link

fix(vm): kernel incorrectly believes that tsc is unreliable in amd64 #21

Closed BlackHole1 closed 10 months ago

BlackHole1 commented 10 months ago

When a Mac wakes up from sleep, the hardware clock in the guest will lag for a while. This causes the kernel to think that the TSC is unstable, and thus switches to HPET. However, the HPET is much slower than the TSC, causing any program involved with time-related code to experience a drop in performance. Don't worry about any side effects of this option. In PR #19, we forced an update of the system time and hardware time in the guest. In arm64, the clocksource is fixed as arch_sys_counter, so this issue does not exist.