From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [patch 3/3] KVM: move postcommit flush to x86, as mmio sptes are x86 specific Date: Mon, 27 Aug 2012 16:04:44 +0800 Message-ID: <503B2A1C.5040104@linux.vnet.ibm.com> References: <20120824185456.658814016@amt.cnet> <20120824185634.625676530@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Paul Mackerras , Avi Kivity , kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from e28smtp07.in.ibm.com ([122.248.162.7]:34166 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752900Ab2H0IEx (ORCPT ); Mon, 27 Aug 2012 04:04:53 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Aug 2012 13:34:50 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7R84ljb3735914 for ; Mon, 27 Aug 2012 13:34:48 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7RDYLFa032492 for ; Mon, 27 Aug 2012 19:04:22 +0530 In-Reply-To: <20120824185634.625676530@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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()? Others are fine to me.