From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbDsh-0000BI-Sc for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbDsg-0007zp-8m for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:37:47 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:61432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbDsf-0007z4-TV for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:37:45 -0400 Received: by ywb3 with SMTP id 3so2441454ywb.4 for ; Mon, 27 Jun 2011 08:37:44 -0700 (PDT) Message-ID: <4E08A3C6.5080409@codemonkey.ws> Date: Mon, 27 Jun 2011 10:37:42 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1309180927-19003-1-git-send-email-avi@redhat.com> In-Reply-To: <1309180927-19003-1-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 00/20] Memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 06/27/2011 08:21 AM, Avi Kivity wrote: > As expected, this is taking longer than expected, so I'm releasing something > less complete than I'd have liked. Not even all of the PC machine is > converted, but the difficult parts are (cirrus). It appears to work well. > > The major change compared to v1 is the introduction of > memory_region_init_alias(), which defines a memory region in terms of another. > With the current API, the ability to alias is provided by address arithmetic > on ram_addr_t: > > ram_addr = qemu_ram_alloc(...); > cpu_register_physical_memory(..., ram_addr, size, ...); > /* alias: */ > cpu_register_physical_memory(..., ram_addr + offset, another_size, ...); > > With the new API, you have to create an alias: > > memory_region_init_ram(&mem, ...); > memory_region_register_subregion(...,&mem); > /* alias: */ > memory_region_init_alias(&alias, ...,&mem, offset, another_size); > memory_region_register_subregion(...,&alias); What's the rationale for explicit aliasing verses registering the same region to two different address spaces? Regards, Anthony Liguori