lkml.org 
[lkml]   [2021]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 10/13] KVM: x86/mmu: Allow zapping collapsible SPTEs to use MMU read lock
Date
On 31/03/21 23:08, Ben Gardon wrote:
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index dcbfc784cf2f..81967b4e7d76 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -5610,10 +5610,13 @@ void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm,
>
> write_lock(&kvm->mmu_lock);
> slot_handle_leaf(kvm, slot, kvm_mmu_zap_collapsible_spte, true);
> -
> - if (is_tdp_mmu_enabled(kvm))
> - kvm_tdp_mmu_zap_collapsible_sptes(kvm, slot);
> write_unlock(&kvm->mmu_lock);
> +
> + if (is_tdp_mmu_enabled(kvm)) {
> + read_lock(&kvm->mmu_lock);
> + kvm_tdp_mmu_zap_collapsible_sptes(kvm, memslot);
> + read_unlock(&kvm->mmu_lock);
> + }
> }

Same here, this will conflict with

KVM: x86/mmu: Coalesce TLB flushes when zapping collapsible SPTEs

Again, you will have to add back some "if (flush)" before the write_unlock.

Paolo

\
 
 \ /
  Last update: 2021-04-01 12:14    [W:1.281 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site