ARM: timer: Handle level triggered IRQs correctly
authorAndre Przywara <andre.przywara@linaro.org>
Wed, 3 Jan 2018 17:53:22 +0000 (17:53 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 27 Mar 2018 19:43:27 +0000 (12:43 -0700)
commitb9db96f71a7466b3a46dc08af1417b040ac613b6
tree78a3718c31c8b3a08c0151ae2a495cecdeec9e9d
parent55e0590e4bed56db0ea628826409572c94c54ebf
ARM: timer: Handle level triggered IRQs correctly

The ARM Generic Timer uses a level-sensitive interrupt semantic. We
easily catch when the line goes high, as this triggers the hardware IRQ.
However we also have to keep track of when the line lowers, as the
emulation depends on it: Upon entering the guest, the new VGIC will
*clear* the virtual interrupt line, so it needs to re-sample the actual
state after returning from the guest.
So we have to sync the state of the interrupt condition at certain
points to catch when the line goes low and we can remove the vtimer vIRQ
from the vGIC (and the LR).
The VGIC in Xen so far only implemented edge triggered vIRQs, really, so
we need to add new functionality to re-sample the interrupt state.
Do this only when the new VGIC is in use.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c
xen/arch/arm/vtimer.c
xen/include/asm-arm/vtimer.h