diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2017-10-27 19:34:30 +0200 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2018-01-02 10:05:46 +0100 |
commit | 4c60e360d6dfa4d9c3586b687f348eeb3fd675dd (patch) | |
tree | 251fb5e5b0cf45a93e56fd8bf92687340752e4ff /include/kvm | |
parent | df635c5b184da05145db1d63e1dcb1c853f425c2 (diff) | |
download | linux-4c60e360d6dfa4d9c3586b687f348eeb3fd675dd.tar.gz linux-4c60e360d6dfa4d9c3586b687f348eeb3fd675dd.tar.bz2 linux-4c60e360d6dfa4d9c3586b687f348eeb3fd675dd.zip |
KVM: arm/arm64: Provide a get_input_level for the arch timer
The VGIC can now support the life-cycle of mapped level-triggered
interrupts, and we no longer have to read back the timer state on every
exit from the VM if we had an asserted timer interrupt signal, because
the VGIC already knows if we hit the unlikely case where the guest
disables the timer without ACKing the virtual timer interrupt.
This means we rework a bit of the code to factor out the functionality
to snapshot the timer state from vtimer_save_state(), and we can reuse
this functionality in the sync path when we have an irqchip in
userspace, and also to support our implementation of the
get_input_level() function for the timer.
This change also means that we can no longer rely on the timer's view of
the interrupt line to set the active state, because we no longer
maintain this state for mapped interrupts when exiting from the guest.
Instead, we only set the active state if the virtual interrupt is
active, and otherwise we simply let the timer fire again and raise the
virtual interrupt from the ISR.
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'include/kvm')
-rw-r--r-- | include/kvm/arm_arch_timer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h index 6e45608b2399..b1dcfde0a3ef 100644 --- a/include/kvm/arm_arch_timer.h +++ b/include/kvm/arm_arch_timer.h @@ -90,6 +90,8 @@ void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu); void kvm_timer_init_vhe(void); +bool kvm_arch_timer_get_input_level(int vintid); + #define vcpu_vtimer(v) (&(v)->arch.timer_cpu.vtimer) #define vcpu_ptimer(v) (&(v)->arch.timer_cpu.ptimer) |