diff options
-rw-r--r-- | arch/x86/kvm/svm.c | 13 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 11 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
3 files changed, 2 insertions, 26 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 34c089023827..54a86183e5d3 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3294,24 +3294,11 @@ static int msr_interception(struct vcpu_svm *svm) | |||
3294 | 3294 | ||
3295 | static int interrupt_window_interception(struct vcpu_svm *svm) | 3295 | static int interrupt_window_interception(struct vcpu_svm *svm) |
3296 | { | 3296 | { |
3297 | struct kvm_run *kvm_run = svm->vcpu.run; | ||
3298 | |||
3299 | kvm_make_request(KVM_REQ_EVENT, &svm->vcpu); | 3297 | kvm_make_request(KVM_REQ_EVENT, &svm->vcpu); |
3300 | svm_clear_vintr(svm); | 3298 | svm_clear_vintr(svm); |
3301 | svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; | 3299 | svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; |
3302 | mark_dirty(svm->vmcb, VMCB_INTR); | 3300 | mark_dirty(svm->vmcb, VMCB_INTR); |
3303 | ++svm->vcpu.stat.irq_window_exits; | 3301 | ++svm->vcpu.stat.irq_window_exits; |
3304 | /* | ||
3305 | * If the user space waits to inject interrupts, exit as soon as | ||
3306 | * possible | ||
3307 | */ | ||
3308 | if (!lapic_in_kernel(&svm->vcpu) && | ||
3309 | kvm_run->request_interrupt_window && | ||
3310 | !kvm_cpu_has_interrupt(&svm->vcpu)) { | ||
3311 | kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; | ||
3312 | return 0; | ||
3313 | } | ||
3314 | |||
3315 | return 1; | 3302 | return 1; |
3316 | } | 3303 | } |
3317 | 3304 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4729b7f6e5f2..6ee0dc69675b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -5524,17 +5524,6 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu) | |||
5524 | kvm_make_request(KVM_REQ_EVENT, vcpu); | 5524 | kvm_make_request(KVM_REQ_EVENT, vcpu); |
5525 | 5525 | ||
5526 | ++vcpu->stat.irq_window_exits; | 5526 | ++vcpu->stat.irq_window_exits; |
5527 | |||
5528 | /* | ||
5529 | * If the user space waits to inject interrupts, exit as soon as | ||
5530 | * possible | ||
5531 | */ | ||
5532 | if (!lapic_in_kernel(vcpu) && | ||
5533 | vcpu->run->request_interrupt_window && | ||
5534 | !kvm_cpu_has_interrupt(vcpu)) { | ||
5535 | vcpu->run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; | ||
5536 | return 0; | ||
5537 | } | ||
5538 | return 1; | 5527 | return 1; |
5539 | } | 5528 | } |
5540 | 5529 | ||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 88fb3bf2ae6d..28c98c8f9d1c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6469,8 +6469,8 @@ static int vcpu_run(struct kvm_vcpu *vcpu) | |||
6469 | kvm_inject_pending_timer_irqs(vcpu); | 6469 | kvm_inject_pending_timer_irqs(vcpu); |
6470 | 6470 | ||
6471 | if (dm_request_for_irq_injection(vcpu)) { | 6471 | if (dm_request_for_irq_injection(vcpu)) { |
6472 | r = -EINTR; | 6472 | r = 0; |
6473 | vcpu->run->exit_reason = KVM_EXIT_INTR; | 6473 | vcpu->run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; |
6474 | ++vcpu->stat.request_irq_exits; | 6474 | ++vcpu->stat.request_irq_exits; |
6475 | break; | 6475 | break; |
6476 | } | 6476 | } |