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 3/3] KVM: move postcommit flush to x86, as mmio sptes are x86 specific
Date: Fri, 24 Aug 2012 15:54:59 -0300 [thread overview]
Message-ID: <20120824185634.625676530@amt.cnet> (raw)
In-Reply-To: 20120824185456.658814016@amt.cnet
[-- Attachment #1: 03-move-postcommit-flush-to-x86 --]
[-- Type: text/plain, Size: 1221 bytes --]
Other arches do not need this.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: kvm/arch/x86/kvm/x86.c
===================================================================
--- kvm.orig/arch/x86/kvm/x86.c
+++ kvm/arch/x86/kvm/x86.c
@@ -6455,6 +6455,14 @@ void kvm_arch_commit_memory_region(struc
kvm_mmu_change_mmu_pages(kvm, nr_mmu_pages);
kvm_mmu_slot_remove_write_access(kvm, mem->slot);
spin_unlock(&kvm->mmu_lock);
+ /*
+ * If the new memory slot is created, we need to clear all
+ * mmio sptes.
+ */
+ if (old.npages == 0 && npages) {
+ kvm_mmu_zap_all(kvm);
+ kvm_reload_remote_mmus(kvm);
+ }
}
void kvm_arch_flush_shadow_all(struct kvm *kvm)
Index: kvm/virt/kvm/kvm_main.c
===================================================================
--- kvm.orig/virt/kvm/kvm_main.c
+++ kvm/virt/kvm/kvm_main.c
@@ -849,13 +849,6 @@ int __kvm_set_memory_region(struct kvm *
kvm_arch_commit_memory_region(kvm, mem, old, user_alloc);
- /*
- * If the new memory slot is created, we need to clear all
- * mmio sptes.
- */
- if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT)
- kvm_arch_flush_shadow_all(kvm);
-
kvm_free_physmem_slot(&old, &new);
kfree(old_memslots);
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 ` [patch 2/3] KVM: perform an invalid memslot step for gpa base change Marcelo Tosatti
2012-08-24 18:54 ` Marcelo Tosatti [this message]
2012-08-27 8:04 ` [patch 3/3] KVM: move postcommit flush to x86, as mmio sptes are x86 specific 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.625676530@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.