summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/mmu/tdp_mmu.h
diff options
context:
space:
mode:
authorBen Gardon <bgardon@google.com>2021-04-02 02:37:36 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-04-20 01:04:45 +0300
commit4c6654bd160dbf4503b360ef8eed80b99eb1b8d9 (patch)
treeaabe3986f40b49d94e88553b85d4cb00f8012937 /arch/x86/kvm/mmu/tdp_mmu.h
parentb7cccd397f310739fb85383033e95580f99927e0 (diff)
downloadlinux-4c6654bd160dbf4503b360ef8eed80b99eb1b8d9.tar.xz
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>
Diffstat (limited to 'arch/x86/kvm/mmu/tdp_mmu.h')
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.h b/arch/x86/kvm/mmu/tdp_mmu.h
index 25ec0173700e..5fdf63090451 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.h
+++ b/arch/x86/kvm/mmu/tdp_mmu.h
@@ -49,6 +49,7 @@ static inline bool kvm_tdp_mmu_zap_sp(struct kvm *kvm, struct kvm_mmu_page *sp)
void kvm_tdp_mmu_zap_all(struct kvm *kvm);
void kvm_tdp_mmu_invalidate_all_roots(struct kvm *kvm);
+void kvm_tdp_mmu_zap_invalidated_roots(struct kvm *kvm);
int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
int map_writable, int max_level, kvm_pfn_t pfn,