[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51034a41-2d03-103e-6c11-1ed27a952de2@redhat.com>
Date: Thu, 1 Apr 2021 12:12:52 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Ben Gardon <bgardon@...gle.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Peter Xu <peterx@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Peter Shier <pshier@...gle.com>,
Peter Feiner <pfeiner@...gle.com>,
Junaid Shahid <junaids@...gle.com>,
Jim Mattson <jmattson@...gle.com>,
Yulei Zhang <yulei.kernel@...il.com>,
Wanpeng Li <kernellwp@...il.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Xiao Guangrong <xiaoguangrong.eric@...il.com>
Subject: Re: [PATCH 10/13] KVM: x86/mmu: Allow zapping collapsible SPTEs to
use MMU read lock
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
Powered by blists - more mailing lists