linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lai Jiangshan <jiangshanlai+lkml@gmail.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	"Maciej S . Szmigiero" <maciej.szmigiero@oracle.com>,
	Ben Gardon <bgardon@google.com>
Subject: Re: [PATCH 1/3] KVM: x86/mmu: Drop a redundant, broken remote TLB flush
Date: Fri, 22 Oct 2021 11:03:15 +0800	[thread overview]
Message-ID: <CAJhGHyDHwz-ADZdUUcFd+PswTKKQRi=UDkZGQVu1erRbDFMSKQ@mail.gmail.com> (raw)
In-Reply-To: <CAJhGHyCA-nfoJPmQxVWRtu+iJk3aj9ZdNH630RjrQJ_vYnZ3Gg@mail.gmail.com>

On Fri, Oct 22, 2021 at 10:58 AM Lai Jiangshan
<jiangshanlai+lkml@gmail.com> wrote:
>
> On Fri, Oct 22, 2021 at 9:01 AM Sean Christopherson <seanjc@google.com> wrote:
> >
> > A recent commit to fix the calls to kvm_flush_remote_tlbs_with_address()
> > in kvm_zap_gfn_range() inadvertantly added yet another flush instead of
> > fixing the existing flush.  Drop the redundant flush, and fix the params
> > for the existing flush.
> >
> > Fixes: 2822da446640 ("KVM: x86/mmu: fix parameters to kvm_flush_remote_tlbs_with_address")
> > Cc: Maxim Levitsky <mlevitsk@redhat.com>
> > Cc: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> >  arch/x86/kvm/mmu/mmu.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> > index c6ddb042b281..f82b192bba0b 100644
> > --- a/arch/x86/kvm/mmu/mmu.c
> > +++ b/arch/x86/kvm/mmu/mmu.c
> > @@ -5709,13 +5709,11 @@ void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end)
> >                 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++)
> >                         flush = kvm_tdp_mmu_zap_gfn_range(kvm, i, gfn_start,
> >                                                           gfn_end, flush);
> > -               if (flush)
> > -                       kvm_flush_remote_tlbs_with_address(kvm, gfn_start,
> > -                                                          gfn_end - gfn_start);
>
> In the recent queue branch of kvm tree, there is the same "if (flush)" in
> the previous "if (kvm_memslots_have_rmaps(kvm))" branch.  The "if (flush)"
> branch needs to be removed too.

Oh, it is in the patch 2. For patch 1 and 2:

Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>

>
> Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
>
> >         }
> >
> >         if (flush)
> > -               kvm_flush_remote_tlbs_with_address(kvm, gfn_start, gfn_end);
> > +               kvm_flush_remote_tlbs_with_address(kvm, gfn_start,
> > +                                                  gfn_end - gfn_start);
> >
> >         kvm_dec_notifier_count(kvm, gfn_start, gfn_end);
> >
> > --
> > 2.33.0.1079.g6e70778dc9-goog
> >

  reply	other threads:[~2021-10-22  3:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  1:00 [PATCH 0/3] KVM: x86/mmu: Clean up kvm_zap_gfn_range() Sean Christopherson
2021-10-22  1:00 ` [PATCH 1/3] KVM: x86/mmu: Drop a redundant, broken remote TLB flush Sean Christopherson
2021-10-22  2:58   ` Lai Jiangshan
2021-10-22  3:03     ` Lai Jiangshan [this message]
2021-10-22 15:39   ` Maxim Levitsky
2021-10-22  1:00 ` [PATCH 2/3] KVM: x86/mmu: Drop a redundant remote TLB flush in kvm_zap_gfn_range() Sean Christopherson
2021-10-22 11:44   ` Maciej S. Szmigiero
2021-10-25 15:39     ` Sean Christopherson
2021-10-26 14:22       ` Maciej S. Szmigiero
2021-10-22  1:00 ` [PATCH 3/3] KVM: x86/mmu: Extract zapping of rmaps for gfn range to separate helper Sean Christopherson
2021-10-22 15:11 ` [PATCH 0/3] KVM: x86/mmu: Clean up kvm_zap_gfn_range() Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJhGHyDHwz-ADZdUUcFd+PswTKKQRi=UDkZGQVu1erRbDFMSKQ@mail.gmail.com' \
    --to=jiangshanlai+lkml@gmail.com \
    --cc=bgardon@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).