The callout of the periodic interrupt was rearmed from its handler with
a timeout of one period from the time the handler ran. Each period was
longer than programmed by the latency of the callout, so the interrupt
came at a lower rate than the guest asked for. A guest that counts
these interrupts to keep its time runs slow.
Give the callout absolute deadlines one period apart, as vatpit does.
If a deadline has already passed when it is computed, for instance
after the VM was paused, start again from the current time.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev