diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/svm.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 59fe4d54da11..3f3fe815c21b 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -2472,10 +2472,18 @@ static int svm_interrupt_allowed(struct kvm_vcpu *vcpu) | |||
2472 | { | 2472 | { |
2473 | struct vcpu_svm *svm = to_svm(vcpu); | 2473 | struct vcpu_svm *svm = to_svm(vcpu); |
2474 | struct vmcb *vmcb = svm->vmcb; | 2474 | struct vmcb *vmcb = svm->vmcb; |
2475 | return (vmcb->save.rflags & X86_EFLAGS_IF) && | 2475 | int ret; |
2476 | !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && | 2476 | |
2477 | gif_set(svm) && | 2477 | if (!gif_set(svm) || |
2478 | !(is_nested(svm) && (svm->vcpu.arch.hflags & HF_VINTR_MASK)); | 2478 | (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK)) |
2479 | return 0; | ||
2480 | |||
2481 | ret = !!(vmcb->save.rflags & X86_EFLAGS_IF); | ||
2482 | |||
2483 | if (is_nested(svm)) | ||
2484 | return ret && !(svm->vcpu.arch.hflags & HF_VINTR_MASK); | ||
2485 | |||
2486 | return ret; | ||
2479 | } | 2487 | } |
2480 | 2488 | ||
2481 | static void enable_irq_window(struct kvm_vcpu *vcpu) | 2489 | static void enable_irq_window(struct kvm_vcpu *vcpu) |