]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: x86/mmu: nested EPT cannot be used in SMM
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Feb 2022 12:30:08 +0000 (07:30 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Apr 2022 16:49:17 +0000 (12:49 -0400)
The role.base.smm flag is always zero when setting up shadow EPT,
do not bother copying it over from vcpu->arch.root_mmu.

Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c

index 7b088417d978ac0fb0f6d04b1228394854ca749a..3a2d39f7f6eb8587793bee8fdbe2d9dd8e7a1d0b 100644 (file)
@@ -4953,9 +4953,11 @@ kvm_calc_shadow_ept_root_page_role(struct kvm_vcpu *vcpu, bool accessed_dirty,
 {
        union kvm_mmu_role role = {0};
 
-       /* SMM flag is inherited from root_mmu */
-       role.base.smm = vcpu->arch.root_mmu.mmu_role.base.smm;
-
+       /*
+        * KVM does not support SMM transfer monitors, and consequently does not
+        * support the "entry to SMM" control either.  role.base.smm is always 0.
+        */
+       WARN_ON_ONCE(is_smm(vcpu));
        role.base.level = level;
        role.base.has_4_byte_gpte = false;
        role.base.direct = false;