]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Invalidate all roots when emulating INVVPID without EPT
authorJunaid Shahid <junaids@google.com>
Fri, 20 Mar 2020 21:28:00 +0000 (14:28 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Apr 2020 16:08:49 +0000 (12:08 -0400)
commit1928b56bdb26991a9f435a352e2eac50a9bd5997
treed485f5f3f2969deb662ba35945a0a79686d6bd0d
parent60ba0439c7360afe15f44000559c18710e61c0c7
KVM: nVMX: Invalidate all roots when emulating INVVPID without EPT

Free all roots when emulating INVVPID for L1 and EPT is disabled, as
outstanding changes to the page tables managed by L1 need to be
recognized.  Because L1 and L2 share an MMU when EPT is disabled, and
because VPID is not tracked by the MMU role, all roots in the current
MMU (root_mmu) need to be freed, otherwise a future nested VM-Enter or
VM-Exit could do a fast CR3 switch (without a flush/sync) and consume
stale SPTEs.

Fixes: f68557d26e2f6 ("KVM: nVMX: nested VPID emulation")
Signed-off-by: Junaid Shahid <junaids@google.com>
[sean: ported to upstream KVM, reworded the comment and changelog]
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200320212833.3507-5-sean.j.christopherson@intel.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c