Commit 93fa50f6 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: x86/mmu: Batch TLB flushes from TDP MMU for MMU notifier change_spte

Batch TLB flushes (with other MMUs) when handling ->change_spte()
notifications in the TDP MMU.  The MMU notifier path in question doesn't
allow yielding and correcty flushes before dropping mmu_lock.
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Reviewed-by: default avatarBen Gardon <bgardon@google.com>
Message-Id: <20220226001546.360188-9-seanjc@google.com>
Reviewed-by: default avatarMingwei Zhang <mizhang@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c8e5a0d0
...@@ -1226,13 +1226,12 @@ static bool set_spte_gfn(struct kvm *kvm, struct tdp_iter *iter, ...@@ -1226,13 +1226,12 @@ static bool set_spte_gfn(struct kvm *kvm, struct tdp_iter *iter,
*/ */
bool kvm_tdp_mmu_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range) bool kvm_tdp_mmu_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
{ {
bool flush = kvm_tdp_mmu_handle_gfn(kvm, range, set_spte_gfn); /*
* No need to handle the remote TLB flush under RCU protection, the
/* FIXME: return 'flush' instead of flushing here. */ * target SPTE _must_ be a leaf SPTE, i.e. cannot result in freeing a
if (flush) * shadow page. See the WARN on pfn_changed in __handle_changed_spte().
kvm_flush_remote_tlbs_with_address(kvm, range->start, 1); */
return kvm_tdp_mmu_handle_gfn(kvm, range, set_spte_gfn);
return false;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment