arm/arm64: KVM: Clear map->active on pend/active clear
authorChristoffer Dall <christoffer.dall@linaro.org>
Sat, 17 Oct 2015 15:55:12 +0000 (17:55 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Tue, 20 Oct 2015 16:06:34 +0000 (18:06 +0200)
commit544c572e03174438b6656ed24a4516b9a9d5f14a
treeebeb8f44e77a1f0f0b375ca97fcae8902684cd6b
parentcff9211eb1a1f58ce7f5a2d596b617928fd4be0e
arm/arm64: KVM: Clear map->active on pend/active clear

When a guest reboots or offlines/onlines CPUs, it is not uncommon for it
to clear the pending and active states of an interrupt through the
emulated VGIC distributor.  However, since the architected timers are
defined by the architecture to be level triggered and the guest
rightfully expects them to be that, but we emulate them as
edge-triggered, we have to mimic level-triggered behavior for an
edge-triggered virtual implementation.

We currently do not signal the VGIC when the map->active field is true,
because it indicates that the guest has already been signalled of the
interrupt as required.  Normally this field is set to false when the
guest deactivates the virtual interrupt through the sync path.

We also need to catch the case where the guest deactivates the interrupt
through the emulated distributor, again allowing guests to boot even if
the original virtual timer signal hit before the guest's GIC
initialization sequence is run.

Reviewed-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic.c