]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Tear down roots before kvm_mmu_zap_all_fast returns
authorBen Gardon <bgardon@google.com>
Thu, 1 Apr 2021 23:37:36 +0000 (16:37 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 19 Apr 2021 22:04:45 +0000 (18:04 -0400)
commit18eaec6ba5b5610c3681cbd40dd4dad2df64fda6
treeaabe3986f40b49d94e88553b85d4cb00f8012937
parent3b77c1a0cbfe9ff1f0f64b16eca94501909d6250
KVM: x86/mmu: Tear down roots before kvm_mmu_zap_all_fast returns

To avoid saddling a vCPU thread with the work of tearing down an entire
paging structure, take a reference on each root before they become
obsolete, so that the thread initiating the fast invalidation can tear
down the paging structure and (most likely) release the last reference.
As a bonus, this teardown can happen under the MMU lock in read mode so
as not to block the progress of vCPU threads.

Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210401233736.638171-14-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/mmu/tdp_mmu.h