summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/svm/svm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-23 08:06:43 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-05-13 12:14:33 -0400
commitbbdad0b5a708ddb37a9f051504c2133fa92df97a (patch)
tree98d45b21583e43e07335386ed7df34829051bc62 /arch/x86/kvm/svm/svm.c
parent429ab576f387c8fcaeb2a172901aaba3c6794310 (diff)
downloadlwn-bbdad0b5a708ddb37a9f051504c2133fa92df97a.tar.gz
lwn-bbdad0b5a708ddb37a9f051504c2133fa92df97a.zip
KVM: nSVM: Report NMIs as allowed when in L2 and Exit-on-NMI is set
Report NMIs as allowed when the vCPU is in L2 and L2 is being run with Exit-on-NMI enabled, as NMIs are always unblocked from L1's perspective in this case. 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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 739414028536..c4f1846b6259 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3071,6 +3071,9 @@ static bool svm_nmi_allowed(struct kvm_vcpu *vcpu)
struct vmcb *vmcb = svm->vmcb;
bool ret;
+ if (is_guest_mode(vcpu) && nested_exit_on_nmi(svm))
+ return true;
+
ret = !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) &&
!(svm->vcpu.arch.hflags & HF_NMI_MASK);
ret = ret && gif_set(svm);