From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
linux-mips@vger.kernel.org, peterx@redhat.com,
Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: [PATCH RFC 3/4] KVM: MIPS: Replace all the kvm_flush_remote_tlbs() references
Date: Fri, 7 Feb 2020 17:35:19 -0500 [thread overview]
Message-ID: <20200207223520.735523-4-peterx@redhat.com> (raw)
In-Reply-To: <20200207223520.735523-1-peterx@redhat.com>
Replace kvm_flush_remote_tlbs() calls in MIPS code into
kvm_flush_remote_tlbs_common(). This is to prepare that MIPS will
define its own kvm_flush_remote_tlbs() soon.
The only three references are all in the flush_shadow_all() hooks.
One of them can be directly dropped because it's exactly the
kvm_flush_remote_tlbs_common(). Since at it, refactors the other one
a bit.
No functional change expected.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
arch/mips/kvm/trap_emul.c | 8 +-------
arch/mips/kvm/vz.c | 7 ++-----
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/mips/kvm/trap_emul.c b/arch/mips/kvm/trap_emul.c
index 2ecb430ea0f1..ced481c963be 100644
--- a/arch/mips/kvm/trap_emul.c
+++ b/arch/mips/kvm/trap_emul.c
@@ -697,12 +697,6 @@ static int kvm_trap_emul_vcpu_setup(struct kvm_vcpu *vcpu)
return 0;
}
-static void kvm_trap_emul_flush_shadow_all(struct kvm *kvm)
-{
- /* Flush GVA page tables and invalidate GVA ASIDs on all VCPUs */
- kvm_flush_remote_tlbs(kvm);
-}
-
static u64 kvm_trap_emul_get_one_regs[] = {
KVM_REG_MIPS_CP0_INDEX,
KVM_REG_MIPS_CP0_ENTRYLO0,
@@ -1285,7 +1279,7 @@ static struct kvm_mips_callbacks kvm_trap_emul_callbacks = {
.vcpu_init = kvm_trap_emul_vcpu_init,
.vcpu_uninit = kvm_trap_emul_vcpu_uninit,
.vcpu_setup = kvm_trap_emul_vcpu_setup,
- .flush_shadow_all = kvm_trap_emul_flush_shadow_all,
+ .flush_shadow_all = kvm_flush_remote_tlbs_common,
.gva_to_gpa = kvm_trap_emul_gva_to_gpa_cb,
.queue_timer_int = kvm_mips_queue_timer_int_cb,
.dequeue_timer_int = kvm_mips_dequeue_timer_int_cb,
diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c
index 814bd1564a79..91fbf6710da4 100644
--- a/arch/mips/kvm/vz.c
+++ b/arch/mips/kvm/vz.c
@@ -3105,10 +3105,7 @@ static int kvm_vz_vcpu_setup(struct kvm_vcpu *vcpu)
static void kvm_vz_flush_shadow_all(struct kvm *kvm)
{
- if (cpu_has_guestid) {
- /* Flush GuestID for each VCPU individually */
- kvm_flush_remote_tlbs(kvm);
- } else {
+ if (!cpu_has_guestid) {
/*
* For each CPU there is a single GPA ASID used by all VCPUs in
* the VM, so it doesn't make sense for the VCPUs to handle
@@ -3119,8 +3116,8 @@ static void kvm_vz_flush_shadow_all(struct kvm *kvm)
* kick any running VCPUs so they check asid_flush_mask.
*/
cpumask_setall(&kvm->arch.asid_flush_mask);
- kvm_flush_remote_tlbs(kvm);
}
+ kvm_flush_remote_tlbs_common(kvm);
}
static void kvm_vz_vcpu_reenter(struct kvm_run *run, struct kvm_vcpu *vcpu)
--
2.24.1
next prev parent reply other threads:[~2020-02-07 22:35 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 ` Peter Xu [this message]
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
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=20200207223520.735523-4-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--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).