From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 3/3] KVM: move postcommit flush to x86, as mmio sptes are x86 specific Date: Tue, 28 Aug 2012 17:45:12 -0300 Message-ID: <20120828204512.GC19425@amt.cnet> References: <20120824185456.658814016@amt.cnet> <20120824185634.625676530@amt.cnet> <503B2A1C.5040104@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paul Mackerras , Avi Kivity , kvm@vger.kernel.org To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6149 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753097Ab2H1UpR (ORCPT ); Tue, 28 Aug 2012 16:45:17 -0400 Content-Disposition: inline In-Reply-To: <503B2A1C.5040104@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Aug 27, 2012 at 04:04:44PM +0800, Xiao Guangrong wrote: > On 08/25/2012 02:54 AM, Marcelo Tosatti wrote: > > Other arches do not need this. > > > > Signed-off-by: Marcelo Tosatti > > > > 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); > > + } > > Can not use kvm_arch_flush_shadow_all()? Better reduce it to necessary cases only.