aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-06-05 04:33:28 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2015-08-12 06:28:23 -0400
commit9a99d050705318d1cb27979e1c810464347db9db (patch)
tree5cdbba92fcce70d797737ddb997c874c2cea0d37 /arch/arm/kvm
parent48f8bd57756573b08520629a2413227fcdf058f5 (diff)
arm/arm64: KVM: Fix ordering of timer/GIC on guest entry
As we now inject the timer interrupt when we're about to enter the guest, it makes a lot more sense to make sure this happens before the vgic code queues the pending interrupts. Otherwise, we get the interrupt on the following exit, which is not great for latency (and leads to all kind of bizarre issues when using with active interrupts at the HW level). Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/arm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 9ce5cf02ed17..1141d21b7e3c 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -523,8 +523,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
523 if (vcpu->arch.pause) 523 if (vcpu->arch.pause)
524 vcpu_pause(vcpu); 524 vcpu_pause(vcpu);
525 525
526 kvm_vgic_flush_hwstate(vcpu);
527 kvm_timer_flush_hwstate(vcpu); 526 kvm_timer_flush_hwstate(vcpu);
527 kvm_vgic_flush_hwstate(vcpu);
528 528
529 preempt_disable(); 529 preempt_disable();
530 local_irq_disable(); 530 local_irq_disable();
@@ -540,8 +540,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
540 if (ret <= 0 || need_new_vmid_gen(vcpu->kvm)) { 540 if (ret <= 0 || need_new_vmid_gen(vcpu->kvm)) {
541 local_irq_enable(); 541 local_irq_enable();
542 preempt_enable(); 542 preempt_enable();
543 kvm_timer_sync_hwstate(vcpu);
544 kvm_vgic_sync_hwstate(vcpu); 543 kvm_vgic_sync_hwstate(vcpu);
544 kvm_timer_sync_hwstate(vcpu);
545 continue; 545 continue;
546 } 546 }
547 547
@@ -587,9 +587,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
587 trace_kvm_exit(kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu)); 587 trace_kvm_exit(kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu));
588 preempt_enable(); 588 preempt_enable();
589 589
590
591 kvm_timer_sync_hwstate(vcpu);
592 kvm_vgic_sync_hwstate(vcpu); 590 kvm_vgic_sync_hwstate(vcpu);
591 kvm_timer_sync_hwstate(vcpu);
593 592
594 ret = handle_exit(vcpu, run, ret); 593 ret = handle_exit(vcpu, run, ret);
595 } 594 }