]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
KVM: arm/arm64: Get rid of kvm_timer_flush_hwstate
authorChristoffer Dall <cdall@linaro.org>
Tue, 20 Jun 2017 14:56:20 +0000 (07:56 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 6 Nov 2017 15:23:16 +0000 (16:23 +0100)
Now when both the vtimer and the ptimer when using both the in-kernel
vgic emulation and a userspace IRQ chip are driven by the timer signals
and at the vcpu load/put boundaries, instead of recomputing the timer
state at every entry/exit to/from the guest, we can get entirely rid of
the flush hwstate function.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
include/kvm/arm_arch_timer.h
virt/kvm/arm/arch_timer.c
virt/kvm/arm/arm.c

index c538f707e1c1eb4b1faf59f9f97b2294b38b0041..2352f3a4e88b0490140347d5074471767728f454 100644 (file)
@@ -66,7 +66,6 @@ int kvm_timer_hyp_init(void);
 int kvm_timer_enable(struct kvm_vcpu *vcpu);
 int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu);
 void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
-void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu);
 void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu);
 bool kvm_timer_should_notify_user(struct kvm_vcpu *vcpu);
 void kvm_timer_update_run(struct kvm_vcpu *vcpu);
index 20e56c4206326a8e1f58e35a167807cc74f55db4..53d9bd4a734f7952b3fe8160e350847cce474a09 100644 (file)
@@ -305,12 +305,6 @@ static void kvm_timer_update_state(struct kvm_vcpu *vcpu)
        struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
        struct arch_timer_context *ptimer = vcpu_ptimer(vcpu);
 
-       /*
-        * If userspace modified the timer registers via SET_ONE_REG before
-        * the vgic was initialized, we mustn't set the vtimer->irq.level value
-        * because the guest would never see the interrupt.  Instead wait
-        * until we call this function from kvm_timer_flush_hwstate.
-        */
        if (unlikely(!timer->enabled))
                return;
 
@@ -489,24 +483,6 @@ bool kvm_timer_should_notify_user(struct kvm_vcpu *vcpu)
               ptimer->irq.level != plevel;
 }
 
-/**
- * kvm_timer_flush_hwstate - prepare timers before running the vcpu
- * @vcpu: The vcpu pointer
- *
- * Check if the virtual timer has expired while we were running in the host,
- * and inject an interrupt if that was the case, making sure the timer is
- * masked or disabled on the host so that we keep executing.  Also schedule a
- * software timer for the physical timer if it is enabled.
- */
-void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
-{
-       struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
-       struct arch_timer_context *ptimer = vcpu_ptimer(vcpu);
-
-       if (unlikely(!timer->enabled))
-               return;
-}
-
 void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu)
 {
        struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
index 132d39ae13d2414ec7907e693f519fd2073e14fa..14c50d142c675b88601587bb96cb9fe6923c506c 100644 (file)
@@ -656,7 +656,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
                local_irq_disable();
 
-               kvm_timer_flush_hwstate(vcpu);
                kvm_vgic_flush_hwstate(vcpu);
 
                /*