From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paul Mackerras <paulus@samba.org>, Avi Kivity <avi@redhat.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 2/3] KVM: perform an invalid memslot step for gpa base change
Date: Fri, 24 Aug 2012 15:54:58 -0300 [thread overview]
Message-ID: <20120824185634.562101569@amt.cnet> (raw)
In-Reply-To: 20120824185456.658814016@amt.cnet
[-- Attachment #1: 02-invalidate-translations-on-memslot-gpa-change --]
[-- Type: text/plain, Size: 1006 bytes --]
PPC must flush all translations before the new memory slot
is visible.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: kvm/virt/kvm/kvm_main.c
===================================================================
--- kvm.orig/virt/kvm/kvm_main.c
+++ kvm/virt/kvm/kvm_main.c
@@ -791,7 +791,7 @@ int __kvm_set_memory_region(struct kvm *
/* destroy any largepage mappings for dirty tracking */
}
- if (!npages) {
+ if (!npages || base_gfn != old.base_gfn) {
struct kvm_memory_slot *slot;
r = -ENOMEM;
@@ -807,8 +807,8 @@ int __kvm_set_memory_region(struct kvm *
old_memslots = kvm->memslots;
rcu_assign_pointer(kvm->memslots, slots);
synchronize_srcu_expedited(&kvm->srcu);
- /* From this point no new shadow pages pointing to a deleted
- * memslot will be created.
+ /* From this point no new shadow pages pointing to a deleted,
+ * or moved, memslot will be created.
*
* validation of sp->gfn happens in:
* - gfn_to_hva (kvm_read_guest, gfn_to_pfn)
next prev parent reply other threads:[~2012-08-24 18:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 18:54 [patch 0/3] kvm: split kvm_arch_flush_shadow and move mmio spte invalidation to x86 Marcelo Tosatti
2012-08-24 18:54 ` [patch 1/3] KVM: split kvm_arch_flush_shadow Marcelo Tosatti
2012-08-24 18:54 ` Marcelo Tosatti [this message]
2012-08-24 18:54 ` [patch 3/3] KVM: move postcommit flush to x86, as mmio sptes are x86 specific Marcelo Tosatti
2012-08-27 8:04 ` Xiao Guangrong
2012-08-28 20:45 ` Marcelo Tosatti
2012-08-27 14:41 ` Takuya Yoshikawa
2012-08-27 19:06 ` Marcelo Tosatti
2012-08-28 0:30 ` Takuya Yoshikawa
2012-08-28 20:41 ` Marcelo Tosatti
2012-08-28 20:43 ` [patch 3/3 V2] " Marcelo Tosatti
2012-08-25 12:37 ` [patch 0/3] kvm: split kvm_arch_flush_shadow and move mmio spte invalidation to x86 Paul Mackerras
2012-09-06 13:37 ` Avi Kivity
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=20120824185634.562101569@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=paulus@samba.org \
--cc=xiaoguangrong@linux.vnet.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 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.