From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, Gleb Natapov <gleb@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Carsten Otte <cotte@de.ibm.com>, Alexander Graf <agraf@suse.de>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
KVM <kvm@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>
Subject: [PATCH 01/11] KVM: s390: Dont do a gmap update on minor memslot changes
Date: Mon, 25 Mar 2013 17:22:48 +0100 [thread overview]
Message-ID: <1364228578-20528-2-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1364228578-20528-1-git-send-email-cornelia.huck@de.ibm.com>
From: Christian Borntraeger <borntraeger@de.ibm.com>
Some memslot updates dont affect the gmap implementation,
e.g. setting/unsetting dirty tracking. Since a gmap update
will cause tlb flushes and segment table invalidations we
want to avoid that.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
arch/s390/kvm/kvm-s390.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 33161b4..f241e33 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1007,6 +1007,16 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
{
int rc;
+ /* If the basics of the memslot do not change, we do not want
+ * to update the gmap. Every update causes several unnecessary
+ * segment translation exceptions. This is usually handled just
+ * fine by the normal fault handler + gmap, but it will also
+ * cause faults on the prefix page of running guest CPUs.
+ */
+ if (old->userspace_addr == mem->userspace_addr &&
+ old->base_gfn * PAGE_SIZE == mem->guest_phys_addr &&
+ old->npages * PAGE_SIZE == mem->memory_size)
+ return;
rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr,
mem->guest_phys_addr, mem->memory_size);
--
1.7.12.4
next prev parent reply other threads:[~2013-03-25 16:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 16:22 [PATCH 00/11] KVM: s390: More patches for kvm-next Cornelia Huck
2013-03-25 16:22 ` Cornelia Huck [this message]
2013-03-25 16:22 ` [PATCH 02/11] KVM: s390: fix 24 bit psw handling in lpsw/lpswe handler Cornelia Huck
2013-03-25 16:22 ` [PATCH 03/11] KVM: s390: fix psw conversion in lpsw handler Cornelia Huck
2013-03-25 16:22 ` [PATCH 04/11] KVM: s390: fix return code handling in lpsw/lpswe handlers Cornelia Huck
2013-03-25 16:22 ` [PATCH 05/11] KVM: s390: make if statements in lpsw/lpswe handlers readable Cornelia Huck
2013-03-25 16:22 ` [PATCH 06/11] KVM: s390: fix and enforce return code handling for irq injections Cornelia Huck
2013-03-25 16:22 ` [PATCH 07/11] KVM: s390: fix stsi exception handling Cornelia Huck
2013-03-25 16:22 ` [PATCH 08/11] KVM: s390: fix compile with !CONFIG_COMPAT Cornelia Huck
2013-03-25 16:22 ` [PATCH 09/11] KVM: s390: Change the virtual memory mapping location for virtio devices Cornelia Huck
2013-03-25 16:22 ` [PATCH 10/11] KVM: s390: Remove the sanity checks for kvm memory slot Cornelia Huck
2013-03-25 16:22 ` [PATCH 11/11] KVM: s390: Enable KVM_CAP_NR_MEMSLOTS on s390 Cornelia Huck
2013-04-02 13:15 ` [PATCH 00/11] KVM: s390: More patches for kvm-next Gleb Natapov
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=1364228578-20528-2-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=gleb@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=schwidefsky@de.ibm.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