From: Sean Christopherson <seanjc@google.com>
To: Hou Wenlong <houwenlong93@linux.alibaba.com>
Cc: kvm@vger.kernel.org, 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>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: x86/mmu: Skip tlb flush if it has been done in zap_gfn_range()
Date: Wed, 17 Nov 2021 15:56:00 +0000 [thread overview]
Message-ID: <YZUmEHx6iE9Mr3Ls@google.com> (raw)
In-Reply-To: <5e16546e228877a4d974f8c0e448a93d52c7a5a9.1637140154.git.houwenlong93@linux.alibaba.com>
On Wed, Nov 17, 2021, Hou Wenlong wrote:
> If the parameter flush is set, zap_gfn_range() would flush remote tlb
> when yield, then tlb flush is not needed outside. So use the return
> value of zap_gfn_range() directly instead of OR on it in
> kvm_unmap_gfn_range() and kvm_tdp_mmu_unmap_gfn_range().
>
> Fixes: 3039bcc744980 ("KVM: Move x86's MMU notifier memslot walkers to generic code")
> Signed-off-by: Hou Wenlong <houwenlong93@linux.alibaba.com>
> ---
Ha, I fixed this in my local repo just yesterday :-)
Reviewed-by: Sean Christopherson <seanjc@google.com>
> arch/x86/kvm/mmu/mmu.c | 2 +-
> arch/x86/kvm/mmu/tdp_mmu.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index 354d2ca92df4..d57319e596a9 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -1582,7 +1582,7 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
> flush = kvm_handle_gfn_range(kvm, range, kvm_unmap_rmapp);
>
> if (is_tdp_mmu_enabled(kvm))
> - flush |= kvm_tdp_mmu_unmap_gfn_range(kvm, range, flush);
> + flush = kvm_tdp_mmu_unmap_gfn_range(kvm, range, flush);
>
> return flush;
> }
> diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
> index 7c5dd83e52de..9d03f5b127dc 100644
> --- a/arch/x86/kvm/mmu/tdp_mmu.c
> +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> @@ -1034,8 +1034,8 @@ bool kvm_tdp_mmu_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range,
> struct kvm_mmu_page *root;
>
> for_each_tdp_mmu_root(kvm, root, range->slot->as_id)
Another issue is that this should be for_each_tdp_mmu_root_yield_safe(). I'll get
a patch out for that later today.
> - flush |= zap_gfn_range(kvm, root, range->start, range->end,
> - range->may_block, flush, false);
> + flush = zap_gfn_range(kvm, root, range->start, range->end,
> + range->may_block, flush, false);
>
> return flush;
> }
> --
> 2.31.1
>
next prev parent reply other threads:[~2021-11-17 15:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 9:20 [PATCH 1/2] KVM: x86/mmu: Skip tlb flush if it has been done in zap_gfn_range() Hou Wenlong
2021-11-17 9:20 ` [PATCH 2/2] KVM: x86/mmu: Pass parameter flush as false in kvm_tdp_mmu_zap_collapsible_sptes() Hou Wenlong
2021-11-17 17:50 ` Ben Gardon
2021-11-17 18:32 ` Paolo Bonzini
2021-11-17 15:56 ` Sean Christopherson [this message]
2021-11-17 16:45 ` [PATCH 1/2] KVM: x86/mmu: Skip tlb flush if it has been done in zap_gfn_range() Paolo Bonzini
2021-11-17 17:03 ` Sean Christopherson
2021-11-17 18:04 ` Sean Christopherson
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=YZUmEHx6iE9Mr3Ls@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=houwenlong93@linux.alibaba.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.