[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANgfPd_=M-8r8H5uoaPz_VTXZpmX6XD+QGAdBdz4PERUoqE1OA@mail.gmail.com>
Date: Wed, 17 Nov 2021 09:50:46 -0800
From: Ben Gardon <bgardon@...gle.com>
To: Hou Wenlong <houwenlong93@...ux.alibaba.com>
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86/mmu: Pass parameter flush as false in kvm_tdp_mmu_zap_collapsible_sptes()
On Wed, Nov 17, 2021 at 1:20 AM Hou Wenlong
<houwenlong93@...ux.alibaba.com> wrote:
>
> Since tlb flush has been done for legacy MMU before
> kvm_tdp_mmu_zap_collapsible_sptes(), so the parameter flush
> should be false for kvm_tdp_mmu_zap_collapsible_sptes().
>
> Fixes: e2209710ccc5d ("KVM: x86/mmu: Skip rmap operations if rmaps not allocated")
> Signed-off-by: Hou Wenlong <houwenlong93@...ux.alibaba.com>
Haha, I'm glad we're thinking along similar lines. I just sent a patch
yesterday to remove the flush parameter from that function entirely:
https://lore.kernel.org/lkml/20211115234603.2908381-2-bgardon@google.com/
I'll CC you on that patch.
> ---
> arch/x86/kvm/mmu/mmu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index d57319e596a9..4b2be04e9862 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -5853,7 +5853,7 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm,
> void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm,
> const struct kvm_memory_slot *slot)
> {
> - bool flush = false;
> + bool flush;
>
> if (kvm_memslots_have_rmaps(kvm)) {
> write_lock(&kvm->mmu_lock);
> @@ -5870,7 +5870,7 @@ void kvm_mmu_zap_collapsible_sptes(struct kvm *kvm,
>
> if (is_tdp_mmu_enabled(kvm)) {
> read_lock(&kvm->mmu_lock);
> - flush = kvm_tdp_mmu_zap_collapsible_sptes(kvm, slot, flush);
> + flush = kvm_tdp_mmu_zap_collapsible_sptes(kvm, slot, false);
> if (flush)
> kvm_arch_flush_remote_tlbs_memslot(kvm, slot);
> read_unlock(&kvm->mmu_lock);
> --
> 2.31.1
>
Powered by blists - more mailing lists