summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-23 17:02:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-05-13 18:14:31 +0200
commita9fa7cb6aa997ba58294f1a07d402ce5855bafe1 (patch)
tree2c1b49be8347793f84747492bdde4c7e3aea3814 /arch/x86/kvm/svm
parentKVM: x86: Make return for {interrupt_nmi,smi}_allowed() a bool instead of int (diff)
downloadlinux-a9fa7cb6aa997ba58294f1a07d402ce5855bafe1.tar.xz
linux-a9fa7cb6aa997ba58294f1a07d402ce5855bafe1.zip
KVM: x86: replace is_smm checks with kvm_x86_ops.smi_allowed
Do not hardcode is_smm so that all the architectural conditions for blocking SMIs are listed in a single place. Well, in two places because this introduces some code duplication between Intel and AMD. This ensures that nested SVM obeys GIF in kvm_vcpu_has_events. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm')
-rw-r--r--arch/x86/kvm/svm/svm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index c6e5374db825..739414028536 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3783,7 +3783,7 @@ static bool svm_smi_allowed(struct kvm_vcpu *vcpu)
return false;
}
- return true;
+ return !is_smm(vcpu);
}
static int svm_pre_enter_smm(struct kvm_vcpu *vcpu, char *smstate)