aboutsummaryrefslogtreecommitdiff
path: root/include/kvm
diff options
context:
space:
mode:
authorChristoffer Dall2017-06-18 00:32:08 -0700
committerChristoffer Dall2017-11-06 16:23:12 +0100
commitf2a2129e0ac8d8fa79c3f85425c36f6e3368f022 (patch)
tree02b8a911c717be93bc7658b95560fb175047e74c /include/kvm
parentee9bb9a1e3c6e40874c1611ac24b76c87d2cba7b (diff)
KVM: arm/arm64: Use separate timer for phys timer emulation
We were using the same hrtimer for emulating the physical timer and for making sure a blocking VCPU thread would be eventually woken up. That worked fine in the previous arch timer design, but as we are about to actually use the soft timer expire function for the physical timer emulation, change the logic to use a dedicated hrtimer. This has the added benefit of not having to cancel any work in the sync path, which in turn allows us to run the flush and sync with IRQs disabled. Note that the hrtimer used to program the host kernel's timer to generate an exit from the guest when the emulated physical timer fires never has to inject any work, and to share the soft_timer_cancel() function with the bg_timer, we change the function to only cancel any pending work if the pointer to the work struct is not null. Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_arch_timer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index 0eed5bc9fd5e..184c3ef2df93 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -48,6 +48,9 @@ struct arch_timer_cpu {
/* Work queued with the above timer expires */
struct work_struct expired;
+ /* Physical timer emulation */
+ struct hrtimer phys_timer;
+
/* Is the timer enabled */
bool enabled;
};