summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/svm/svm.c
diff options
context:
space:
mode:
authorCathy Avery <cavery@redhat.com>2020-04-14 16:11:06 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-05-13 12:14:24 -0400
commit9c3d370a8efaac49b0520617c9ab4e552aefbf1e (patch)
tree0f01cd29e4cc55cf31e8bbf016b5f435a4aa37bf /arch/x86/kvm/svm/svm.c
parent6e085cbfb0f0c7de4ca0f370adb572b0e07a818c (diff)
downloadlwn-9c3d370a8efaac49b0520617c9ab4e552aefbf1e.tar.gz
lwn-9c3d370a8efaac49b0520617c9ab4e552aefbf1e.zip
KVM: SVM: Implement check_nested_events for NMI
Migrate nested guest NMI intercept processing to new check_nested_events. Signed-off-by: Cathy Avery <cavery@redhat.com> Message-Id: <20200414201107.22952-2-cavery@redhat.com> [Reorder clauses as NMIs have higher priority than IRQs; inject immediate vmexit as is now done for IRQ vmexits. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
-rw-r--r--arch/x86/kvm/svm/svm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index c2a4e2d21676..f97f29e1eb49 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3070,9 +3070,10 @@ static int svm_nmi_allowed(struct kvm_vcpu *vcpu)
struct vcpu_svm *svm = to_svm(vcpu);
struct vmcb *vmcb = svm->vmcb;
int ret;
+
ret = !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) &&
!(svm->vcpu.arch.hflags & HF_NMI_MASK);
- ret = ret && gif_set(svm) && nested_svm_nmi(svm);
+ ret = ret && gif_set(svm);
return ret;
}
@@ -3150,9 +3151,6 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu)
return; /* STGI will cause a vm exit */
}
- if (svm->nested.exit_required)
- return; /* we're not going to run the guest yet */
-
/*
* Something prevents NMI from been injected. Single step over possible
* problem (IRET or exception injection or interrupt shadow)