1
0
Fork 0

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>
hifive-unleashed-5.1
Christoffer Dall 2017-11-29 17:05:16 +01:00
parent e3feebf817
commit 22601127c0
1 changed files with 4 additions and 1 deletions

View 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;