From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMojr-0002Qu-B4 for qemu-devel@nongnu.org; Wed, 18 May 2011 17:57:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMojq-0005vm-68 for qemu-devel@nongnu.org; Wed, 18 May 2011 17:57:07 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:54034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMojp-0005vh-S9 for qemu-devel@nongnu.org; Wed, 18 May 2011 17:57:06 -0400 Received: by pzk30 with SMTP id 30so1135040pzk.4 for ; Wed, 18 May 2011 14:57:05 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DD440A8.60300@redhat.com> Date: Wed, 18 May 2011 23:56:56 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1305741151-4793-4-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: <1305741151-4793-4-git-send-email-stefano.stabellini@eu.citrix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] exec.c: refactor cpu_physical_memory_map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefano.stabellini@eu.citrix.com Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, agraf@suse.de On 05/18/2011 07:52 PM, stefano.stabellini@eu.citrix.com wrote: > From: Stefano Stabellini > > Introduce qemu_ram_ptr_length that takes an address and a size as > parameters rather than just an address. > > Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length only > once rather than calling qemu_get_ram_ptr one time per page. > This is not only more efficient but also tries to simplify the logic of > the function. > Currently we are relying on the fact that all the pages are mapped > contiguously in qemu's address space: we have a check to make sure that > the virtual address returned by qemu_get_ram_ptr from the second call on > is consecutive. Now we are making this more explicit replacing all the > calls to qemu_get_ram_ptr with a single call to qemu_ram_ptr_length > passing a size argument. Would the interface at http://permalink.gmane.org/gmane.comp.emulators.qemu/101475 work for you alternatively? Paolo