vmm: Use relative alarms for periodic LAPIC timers
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 14 Aug 2017 16:06:28 +0000 (12:06 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 14 Aug 2017 21:02:20 +0000 (17:02 -0400)
commit0069391d75fa42ea5e1109144bc08358a7814ee7
tree583a31072d74d5696036e366bd5ef51bf4a3b767
parentfd57bb32eeed7fd4d2b8971ae8f6c39f4c5a70b4
vmm: Use relative alarms for periodic LAPIC timers

With relative alarms, we'll try to inject another IPI in X ticks from now,
instead of X ticks from when we wanted the previous alarm to go off.

If the VMM is descheduled for a long time, perhaps due to being an SCP or
otherwise low-priority, the "incremental" alarms will build up, since we
don't run our alarm handler immediately.

If the guest clocks off the ticks, it'll have problems.  If that happens,
we can come up with something else.  I tested tinycore by giving it the
period it wanted * 2, and it thought time passed correctly (date).

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/vmm/vmrunkernel.c