]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: x86/mmu: Use yield-safe TDP MMU root iter in MMU notifier unmapping
authorSean Christopherson <seanjc@google.com>
Sat, 20 Nov 2021 01:50:08 +0000 (01:50 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Nov 2021 08:09:25 +0000 (03:09 -0500)
Use the yield-safe variant of the TDP MMU iterator when handling an
unmapping event from the MMU notifier, as most occurences of the event
allow yielding.

Fixes: 41c263d69428 ("KVM: x86/mmu: Allow yielding during MMU notifier unmap/zap, if possible")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211120015008.3780032-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c

index 1f8c9f783b7852bc5d6770f86cb04d2acd26b300..4cd6bf7e73f02cdceabcd148742a0cdebd585fe5 100644 (file)
@@ -1031,7 +1031,7 @@ bool kvm_tdp_mmu_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range,
 {
        struct kvm_mmu_page *root;
 
-       for_each_tdp_mmu_root(kvm, root, range->slot->as_id)
+       for_each_tdp_mmu_root_yield_safe(kvm, root, range->slot->as_id, false)
                flush = zap_gfn_range(kvm, root, range->start, range->end,
                                      range->may_block, flush, false);