Re: [PATCH 13/13] KVM: x86/mmu: Tear down roots in fast invalidation thread

2021-04-01 Thread Paolo Bonzini
On 01/04/21 00:29, Sean Christopherson wrote: + if (is_tdp_mmu_enabled(kvm)) { + read_lock(>mmu_lock); + kvm_tdp_mmu_zap_all_fast(kvm); Purely because it exists first, I think we should follow the legacy MMU's terminology, i.e. kvm_tdp_mmu_zap_obsolete_pages().

Re: [PATCH 13/13] KVM: x86/mmu: Tear down roots in fast invalidation thread

2021-04-01 Thread Paolo Bonzini
On 31/03/21 23:08, Ben Gardon wrote: +/* + * Since kvm_tdp_mmu_invalidate_roots has acquired a reference to each + * invalidated root, they will not be freed until this function drops the + * reference. Before dropping that reference, tear down the paging + * structure so that whichever thread

Re: [PATCH 13/13] KVM: x86/mmu: Tear down roots in fast invalidation thread

2021-03-31 Thread Sean Christopherson
On Wed, Mar 31, 2021, Ben Gardon wrote: > --- > arch/x86/kvm/mmu/mmu.c | 6 > arch/x86/kvm/mmu/tdp_mmu.c | 74 +- > arch/x86/kvm/mmu/tdp_mmu.h | 1 + > 3 files changed, 80 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/mmu/mmu.c

[PATCH 13/13] KVM: x86/mmu: Tear down roots in fast invalidation thread

2021-03-31 Thread Ben Gardon
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