aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-04-21 10:44:56 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:45 -0400
commit8061823a25218174f30c3dd943989e1d72f7d06e (patch)
treeee94e6ac86efe3c0bdeb933b8538ae06e99f6fe3 /arch/x86/kvm/vmx.c
parent3438253926822a6bf8487b4f7d82f26a2c0b2388 (diff)
KVM: Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too
At the vector level, kernel and userspace irqchip are fairly similar. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c6997c0e8ca6..b3292c1ea2f2 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2535,21 +2535,20 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu,
2535 vmx_inject_nmi(vcpu); 2535 vmx_inject_nmi(vcpu);
2536 if (vcpu->arch.nmi_pending) 2536 if (vcpu->arch.nmi_pending)
2537 enable_nmi_window(vcpu); 2537 enable_nmi_window(vcpu);
2538 else if (vcpu->arch.irq_summary 2538 else if (kvm_cpu_has_interrupt(vcpu) ||
2539 || kvm_run->request_interrupt_window) 2539 kvm_run->request_interrupt_window)
2540 enable_irq_window(vcpu); 2540 enable_irq_window(vcpu);
2541 return; 2541 return;
2542 } 2542 }
2543 2543
2544 if (vcpu->arch.interrupt_window_open) { 2544 if (vcpu->arch.interrupt_window_open) {
2545 if (vcpu->arch.irq_summary && !vcpu->arch.interrupt.pending) 2545 if (kvm_cpu_has_interrupt(vcpu) && !vcpu->arch.interrupt.pending)
2546 kvm_queue_interrupt(vcpu, kvm_pop_irq(vcpu)); 2546 kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu));
2547 2547
2548 if (vcpu->arch.interrupt.pending) 2548 if (vcpu->arch.interrupt.pending)
2549 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); 2549 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr);
2550 } 2550 } else if(kvm_cpu_has_interrupt(vcpu) ||
2551 if (!vcpu->arch.interrupt_window_open && 2551 kvm_run->request_interrupt_window)
2552 (vcpu->arch.irq_summary || kvm_run->request_interrupt_window))
2553 enable_irq_window(vcpu); 2552 enable_irq_window(vcpu);
2554} 2553}
2555 2554
@@ -2976,8 +2975,9 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu,
2976 * If the user space waits to inject interrupts, exit as soon as 2975 * If the user space waits to inject interrupts, exit as soon as
2977 * possible 2976 * possible
2978 */ 2977 */
2979 if (kvm_run->request_interrupt_window && 2978 if (!irqchip_in_kernel(vcpu->kvm) &&
2980 !vcpu->arch.irq_summary) { 2979 kvm_run->request_interrupt_window &&
2980 !kvm_cpu_has_interrupt(vcpu)) {
2981 kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; 2981 kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
2982 return 0; 2982 return 0;
2983 } 2983 }