From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 1/2] KVM: Introduce kvm_arch_memslots_updated() Date: Mon, 8 Jul 2013 12:49:23 +0200 Message-ID: <20130708124923.675b3a5e@gondolin> References: <20130704133928.85fd1aab.yoshikawa_takuya_b1@lab.ntt.co.jp> <20130704134029.4db2736a.yoshikawa_takuya_b1@lab.ntt.co.jp> <20130704095315.GD5113@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , pbonzini@redhat.com, kvm@vger.kernel.org, agraf@suse.de, borntraeger@de.ibm.com, christoffer.dall@linaro.org, xiaoguangrong@linux.vnet.ibm.com To: Gleb Natapov Return-path: Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:44075 "EHLO e06smtp15.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793Ab3GHKta (ORCPT ); Mon, 8 Jul 2013 06:49:30 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Jul 2013 11:44:41 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D24DF2190068 for ; Mon, 8 Jul 2013 11:53:16 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r68AnFSU49479902 for ; Mon, 8 Jul 2013 10:49:15 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r68AnP5i024180 for ; Mon, 8 Jul 2013 04:49:26 -0600 In-Reply-To: <20130704095315.GD5113@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 4 Jul 2013 12:53:15 +0300 Gleb Natapov wrote: > On Thu, Jul 04, 2013 at 01:40:29PM +0900, Takuya Yoshikawa wrote: > > This is called right after the memslots is updated, i.e. when the result > > of update_memslots() gets installed in install_new_memslots(). Since > > the memslots needs to be updated twice when we delete or move a memslot, > > kvm_arch_commit_memory_region() does not correspond to this exactly. > > > > In the following patch, x86 will use this new API to check if the mmio > > generation has reached its maximum value, in which case mmio sptes need > > to be flushed out. > > > > Signed-off-by: Takuya Yoshikawa > > --- > > Removed the trailing space after "return old_memslots;" at this chance. > > > > arch/arm/kvm/arm.c | 4 ++++ > > arch/ia64/kvm/kvm-ia64.c | 4 ++++ > > arch/mips/kvm/kvm_mips.c | 4 ++++ > > arch/powerpc/kvm/powerpc.c | 4 ++++ > > arch/s390/kvm/kvm-s390.c | 4 ++++ > > arch/x86/kvm/x86.c | 4 ++++ > > include/linux/kvm_host.h | 1 + > > virt/kvm/kvm_main.c | 5 ++++- > > 8 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index e3aae6d..1c1e9de 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -498,6 +498,7 @@ int __kvm_set_memory_region(struct kvm *kvm, > > void kvm_arch_free_memslot(struct kvm_memory_slot *free, > > struct kvm_memory_slot *dont); > > int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); > > +void kvm_arch_memslots_updated(struct kvm *kvm); > We can define empty function here like this: > #ifdef __KVM_HAVE_MEMSLOT_UPDATE > void kvm_arch_memslots_updated(struct kvm *kvm); > #else > static void kvm_arch_memslots_updated(struct kvm *kvm) > { > } > #endif > > and make x86.c define __KVM_HAVE_MEMSLOT_UPDATE. > > But I am fine with your approach too. Do other arch maintainers have any > preferences here? I don't really have a strong preference either way, so Acked-by: Cornelia Huck for the current approach.