xen/arm: remove physical timer offset
authorJeff Kubascik <jeff.kubascik@dornerworks.com>
Tue, 21 Jan 2020 15:07:03 +0000 (10:07 -0500)
committerJulien Grall <julien@xen.org>
Mon, 27 Jan 2020 11:54:29 +0000 (11:54 +0000)
commitf14f55b7ee295277c8dd09e37e0fa0902ccf7eb4
tree9d1b8070b3185680af7fd0c5a1b03abe7e2879b8
parentf190e634daba1a40570700b3e7697d497874c66f
xen/arm: remove physical timer offset

The physical timer traps apply an offset so that time starts at 0 for
the guest. However, this offset is not currently applied to the physical
counter. Per the ARMv8 Reference Manual (ARM DDI 0487E.a), section
D11.2.4 Timers, the "Offset" between the counter and timer should be
zero for a physical timer. This removes the offset to make the timer and
counter consistent.

This also cleans up the physical timer implementation to better match
the virtual timer - both cval's now hold the hardware value.

In the case the guest sets cval to a time before Xen started, the correct
behavior is to expire the timer immediately. To do this, we set the expires
argument of set_timer to zero.

Signed-off-by: Jeff Kubascik <jeff.kubascik@dornerworks.com>
Acked-by: Julien Grall <julien@xen.org>
xen/arch/arm/vtimer.c
xen/include/asm-arm/domain.h