diff options
author | Christoffer Dall <cdall@linaro.org> | 2017-06-18 09:32:08 +0200 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-11-06 16:23:12 +0100 |
commit | f2a2129e0ac8d8fa79c3f85425c36f6e3368f022 (patch) | |
tree | 02b8a911c717be93bc7658b95560fb175047e74c /include/kvm/arm_arch_timer.h | |
parent | KVM: arm/arm64: Move timer/vgic flush/sync under disabled irq (diff) | |
download | linux-f2a2129e0ac8d8fa79c3f85425c36f6e3368f022.tar.xz linux-f2a2129e0ac8d8fa79c3f85425c36f6e3368f022.zip |
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/arm_arch_timer.h')
-rw-r--r-- | include/kvm/arm_arch_timer.h | 3 |
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; }; |