]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Fix timer enable flow
authorChristoffer Dall <christoffer.dall@linaro.org>
Thu, 14 Dec 2017 23:30:12 +0000 (00:30 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 18 Dec 2017 09:53:24 +0000 (10:53 +0100)
commit60b9ec83d3bde2af530ace18c23c086cce42e55a
tree2b4a966ef0885a8321fe3a1da7cd783f72d922db
parentfe8d6afaa0c1cfc0f91a945f7c7659eae618848c
KVM: arm/arm64: Fix timer enable flow

When enabling the timer on the first run, we fail to ever restore the
state and mark it as loaded.  That means, that in the initial entry to
the VCPU ioctl, unless we exit to userspace for some reason such as a
pending signal, if the guest programs a timer and blocks, we will wait
forever, because we never read back the hardware state (the loaded flag
is not set), and so we think the timer is disabled, and we never
schedule a background soft timer.

The end result?  The VCPU blocks forever, and the only solution is to
kill the thread.

Fixes: 37ae28cb8fbf ("arm/arm64: KVM: Load the timer state when enabling the timer")
Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/arch_timer.c