From: Peter Xu <peterx@redhat.com>
To: maobibo <maobibo@loongson.cn>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Sean Christopherson <sean.j.christopherson@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
linux-mips@vger.kernel.org,
Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH RFC 4/4] KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs()
Date: Wed, 18 Mar 2020 11:28:37 -0400 [thread overview]
Message-ID: <20200318152837.GB26585@xz-x1> (raw)
In-Reply-To: <e434cbe0-8d1c-c7fe-e169-01268bd4541c@loongson.cn>
On Wed, Mar 18, 2020 at 11:03:13AM +0800, maobibo wrote:
>
>
> On 02/08/2020 06:35 AM, Peter Xu wrote:
> > Select HAVE_KVM_ARCH_TLB_FLUSH_ALL for MIPS to define its own
> > kvm_flush_remote_tlbs(). It's as simple as calling the
> > flush_shadow_all(kvm) hook. Then replace all the flush_shadow_all()
> > calls to use this KVM generic API to do TLB flush.
> >
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> > arch/mips/kvm/Kconfig | 1 +
> > arch/mips/kvm/mips.c | 22 ++++++++++------------
> > 2 files changed, 11 insertions(+), 12 deletions(-)
> >
> > diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig
> > index eac25aef21e0..8a06f660d39e 100644
> > --- a/arch/mips/kvm/Kconfig
> > +++ b/arch/mips/kvm/Kconfig
> > @@ -26,6 +26,7 @@ config KVM
> > select KVM_MMIO
> > select MMU_NOTIFIER
> > select SRCU
> > + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
> > ---help---
> > Support for hosting Guest kernels.
> >
> > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
> > index 1d5e7ffda746..518020b466bf 100644
> > --- a/arch/mips/kvm/mips.c
> > +++ b/arch/mips/kvm/mips.c
> > @@ -194,13 +194,16 @@ int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
> > return 0;
> > }
> >
> > +void kvm_flush_remote_tlbs(struct kvm *kvm)
> > +{
> > + kvm_mips_callbacks->flush_shadow_all(kvm);
> > +}
> > +
> Hi Peter,
Hi, Bibo,
>
> Although I do not understand mip VZ fully, however it changes behavior of
> MIPS VZ, since kvm_flush_remote_tlbs is also called in function
> kvm_mmu_notifier_change_pte/kvm_mmu_notifier_invalidate_range_start
I'm not familiar with MIPS either, however... I would start to suspect
MIPS could be problematic with MMU notifiers when cpu_has_guestid is
not set. If that's the case, then this series might instead fix it.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2020-03-18 15:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 22:35 [PATCH RFC 0/4] KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs() Peter Xu
2020-02-07 22:35 ` [PATCH RFC 1/4] KVM: Provide kvm_flush_remote_tlbs_common() Peter Xu
2020-02-12 13:33 ` Paolo Bonzini
2020-02-07 22:35 ` [PATCH RFC 2/4] KVM: MIPS: Drop flush_shadow_memslot() callback Peter Xu
2020-02-07 22:35 ` [PATCH RFC 3/4] KVM: MIPS: Replace all the kvm_flush_remote_tlbs() references Peter Xu
2020-02-07 22:35 ` [PATCH RFC 4/4] KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs() Peter Xu
2020-03-18 3:03 ` maobibo
2020-03-18 15:28 ` Peter Xu [this message]
2020-03-19 2:21 ` maobibo
2020-02-07 23:00 ` [PATCH RFC 0/4] KVM: MIPS: Provide " Peter Xu
2020-02-12 12:25 ` Paolo Bonzini
2020-02-12 16:30 ` Paul Burton
2020-02-12 16:40 ` Paolo Bonzini
2020-02-12 19:02 ` Philippe Mathieu-Daudé
2020-03-11 18:32 ` Peter Xu
2020-03-17 13:33 ` Paolo Bonzini
2020-03-17 14:18 ` Peter Xu
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=20200318152837.GB26585@xz-x1 \
--to=peterx@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=maobibo@loongson.cn \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.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).