KVM: SVM: check for nested VINTR flag in svm_interrupt_allowed
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 7 Aug 2009 09:49:47 +0000 (11:49 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 07:46:37 +0000 (10:46 +0300)
Not checking for this flag breaks any nested hypervisor that does not
set VINTR. So fix it with this patch.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/svm.c

index 144f2025799fa6924b72ffca69d413f0b6a92196..6610f60b4c96575dfcf530273bc425e2de94cf41 100644 (file)
@@ -2463,7 +2463,7 @@ static int svm_interrupt_allowed(struct kvm_vcpu *vcpu)
        return (vmcb->save.rflags & X86_EFLAGS_IF) &&
                !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) &&
                gif_set(svm) &&
-               !is_nested(svm);
+               !(is_nested(svm) && (svm->vcpu.arch.hflags & HF_VINTR_MASK));
 }
 
 static void enable_irq_window(struct kvm_vcpu *vcpu)