diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-04-21 10:44:56 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:45 -0400 |
commit | 8061823a25218174f30c3dd943989e1d72f7d06e (patch) | |
tree | ee94e6ac86efe3c0bdeb933b8538ae06e99f6fe3 /arch/x86/kvm/svm.c | |
parent | 3438253926822a6bf8487b4f7d82f26a2c0b2388 (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/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 8fc6eea148e7..6eef6d22e87e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -2091,8 +2091,9 @@ static int interrupt_window_interception(struct vcpu_svm *svm, | |||
2091 | * If the user space waits to inject interrupts, exit as soon as | 2091 | * If the user space waits to inject interrupts, exit as soon as |
2092 | * possible | 2092 | * possible |
2093 | */ | 2093 | */ |
2094 | if (kvm_run->request_interrupt_window && | 2094 | if (!irqchip_in_kernel(svm->vcpu.kvm) && |
2095 | !svm->vcpu.arch.irq_summary) { | 2095 | kvm_run->request_interrupt_window && |
2096 | !kvm_cpu_has_interrupt(&svm->vcpu)) { | ||
2096 | ++svm->vcpu.stat.irq_window_exits; | 2097 | ++svm->vcpu.stat.irq_window_exits; |
2097 | kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; | 2098 | kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; |
2098 | return 0; | 2099 | return 0; |
@@ -2373,7 +2374,8 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu, | |||
2373 | (svm->vmcb->save.rflags & X86_EFLAGS_IF) && | 2374 | (svm->vmcb->save.rflags & X86_EFLAGS_IF) && |
2374 | (svm->vcpu.arch.hflags & HF_GIF_MASK)); | 2375 | (svm->vcpu.arch.hflags & HF_GIF_MASK)); |
2375 | 2376 | ||
2376 | if (svm->vcpu.arch.interrupt_window_open && svm->vcpu.arch.irq_summary) | 2377 | if (svm->vcpu.arch.interrupt_window_open && |
2378 | kvm_cpu_has_interrupt(&svm->vcpu)) | ||
2377 | /* | 2379 | /* |
2378 | * If interrupts enabled, and not blocked by sti or mov ss. Good. | 2380 | * If interrupts enabled, and not blocked by sti or mov ss. Good. |
2379 | */ | 2381 | */ |
@@ -2383,7 +2385,8 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu, | |||
2383 | * Interrupts blocked. Wait for unblock. | 2385 | * Interrupts blocked. Wait for unblock. |
2384 | */ | 2386 | */ |
2385 | if (!svm->vcpu.arch.interrupt_window_open && | 2387 | if (!svm->vcpu.arch.interrupt_window_open && |
2386 | (svm->vcpu.arch.irq_summary || kvm_run->request_interrupt_window)) | 2388 | (kvm_cpu_has_interrupt(&svm->vcpu) || |
2389 | kvm_run->request_interrupt_window)) | ||
2387 | svm_set_vintr(svm); | 2390 | svm_set_vintr(svm); |
2388 | else | 2391 | else |
2389 | svm_clear_vintr(svm); | 2392 | svm_clear_vintr(svm); |