]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
KVM: arm/arm64: Avoid attempting to load timer vgic state without a vgic
authorChristoffer Dall <christoffer.dall@linaro.org>
Wed, 29 Nov 2017 16:05:16 +0000 (17:05 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Wed, 29 Nov 2017 17:17:47 +0000 (18:17 +0100)
The timer optimization patches inadvertendly changed the logic to always
load the timer state as if we have a vgic, even if we don't have a vgic.

Fix this by doing the usual irqchip_in_kernel() check and call the
appropriate load function.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/arch_timer.c

index 190c99ed1b73664be06beb6dc8ae2b7681163f29..f9555b1e7f158f5203c1aaba47002424d3279203 100644 (file)
@@ -835,7 +835,10 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu)
 no_vgic:
        preempt_disable();
        timer->enabled = 1;
-       kvm_timer_vcpu_load_vgic(vcpu);
+       if (!irqchip_in_kernel(vcpu->kvm))
+               kvm_timer_vcpu_load_user(vcpu);
+       else
+               kvm_timer_vcpu_load_vgic(vcpu);
        preempt_enable();
 
        return 0;