summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2017-11-29 11:05:16 -0500
committerChristoffer Dall <christoffer.dall@linaro.org>2017-11-29 12:17:47 -0500
commit22601127c0faa5db70ab88f23af11cb23c8f6cdf (patch)
tree672f81531c199e2d5d132f40a47fb4a24fb84ab4 /virt
parente3feebf81744acd8b581e5eb58a93e8fdcf042a5 (diff)
KVM: arm/arm64: Avoid attempting to load timer vgic state without a vgic
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>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/arch_timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 190c99ed1b73..f9555b1e7f15 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -835,7 +835,10 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu)
835no_vgic: 835no_vgic:
836 preempt_disable(); 836 preempt_disable();
837 timer->enabled = 1; 837 timer->enabled = 1;
838 kvm_timer_vcpu_load_vgic(vcpu); 838 if (!irqchip_in_kernel(vcpu->kvm))
839 kvm_timer_vcpu_load_user(vcpu);
840 else
841 kvm_timer_vcpu_load_vgic(vcpu);
839 preempt_enable(); 842 preempt_enable();
840 843
841 return 0; 844 return 0;