OSDN Git Service

KVM: arm/arm64: Fix lost IRQs from emulated physcial timer when blocked
authorChristoffer Dall <christoffer.dall@arm.com>
Wed, 25 Jul 2018 09:21:28 +0000 (10:21 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 31 Jul 2018 06:53:20 +0000 (07:53 +0100)
commit245715cbe83ca934af5d20e078fd85175c62995e
tree9b8445d6f9e892195f9b4aca37b7e6691610f8b3
parent7afc4ddbf299a13aaf28406783d141a34c6b4f5a
KVM: arm/arm64: Fix lost IRQs from emulated physcial timer when blocked

When the VCPU is blocked (for example from WFI) we don't inject the
physical timer interrupt if it should fire while the CPU is blocked, but
instead we just wake up the VCPU and expect kvm_timer_vcpu_load to take
care of injecting the interrupt.

Unfortunately, kvm_timer_vcpu_load() doesn't actually do that, it only
has support to schedule a soft timer if the emulated phys timer is
expected to fire in the future.

Follow the same pattern as kvm_timer_update_state() and update the irq
state after potentially scheduling a soft timer.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Cc: Stable <stable@vger.kernel.org> # 4.15+
Fixes: bbdd52cfcba29 ("KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit")
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/arch_timer.c