From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 07/10] KVM: introduce kvm->srcu and convert kvm_set_memory_region to SRCU update Date: Tue, 22 Sep 2009 09:55:44 -0300 Message-ID: <20090922125543.GC3138@amt.cnet> References: <20090921233711.213665413@amt.cnet> <20090921234124.596305294@amt.cnet> <1253616010.6210.2.camel@pc-fernando> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com To: Fernando Carrijo Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756498AbZIVMzw (ORCPT ); Tue, 22 Sep 2009 08:55:52 -0400 Content-Disposition: inline In-Reply-To: <1253616010.6210.2.camel@pc-fernando> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Sep 22, 2009 at 07:40:10AM -0300, Fernando Carrijo wrote: > Resending with Cc: added > > On Mon, 2009-09-21 at 20:37 -0300, Marcelo Tosatti wrote: > > > - kvm_arch_flush_shadow(kvm); > > + flush_shadow = 1; > > } > > #else /* not defined CONFIG_S390 */ > > new.user_alloc = user_alloc; > > @@ -641,34 +642,69 @@ skip_lpage: > > new.userspace_addr = mem->userspace_addr; > > #endif /* not defined CONFIG_S390 */ > > > > - if (!npages) > > + if (!npages) { > > + slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); > > + if (!slots) > > + goto out_free; > > + memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); > > Nothing wrong with the above line, but it makes me think if > > *slots = *kvm->memslots; > > would save us the function call overhead Perhaps. But this is a slow path anyway, so it does not matter much. Thanks for the review.