]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Simplify bg_timer programming
authorChristoffer Dall <christoffer.dall@arm.com>
Mon, 26 Nov 2018 17:21:22 +0000 (18:21 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 19 Feb 2019 21:05:36 +0000 (21:05 +0000)
commit8eba1052c830a822549aaaf95f73d545a49d8992
treee997f4ed8b196b597a92bc89b22f00b70e78eee0
parentecbc93b180d7010c381afea5a150bfa603011565
KVM: arm/arm64: Simplify bg_timer programming

Instead of calling into kvm_timer_[un]schedule from the main kvm
blocking path, test if the VCPU is on the wait queue from the load/put
path and perform the background timer setup/cancel in this path.

This has the distinct advantage that we no longer race between load/put
and schedule/unschedule and programming and canceling of the bg_timer
always happens when the timer state is not loaded.

Note that we must now remove the checks in kvm_timer_blocking that do
not schedule a background timer if one of the timers can fire, because
we no longer have a guarantee that kvm_vcpu_check_block() will be called
before kvm_timer_blocking.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
include/kvm/arm_arch_timer.h
virt/kvm/arm/arch_timer.c
virt/kvm/arm/arm.c