From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbDUr-0001Zv-R8 for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:13:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbDUp-0003oX-SG for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:13:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbDUp-0003oL-7D for qemu-devel@nongnu.org; Mon, 27 Jun 2011 11:13:07 -0400 Message-ID: <4E089DFF.3090401@redhat.com> Date: Mon, 27 Jun 2011 18:13:03 +0300 From: Avi Kivity 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: qemu-devel@nongnu.org, "Michael S. Tsirkin" Cc: kvm@vger.kernel.org On 06/27/2011 04:21 PM, 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); > > The patchset is somewhat churny. One of the reasons is that we move from a > handle/pointer scheme in ram_addr_t to an object constructor/destructor scheme. > Another is that region size becomes a property of a region instead of being > maintained externally. Also, container memory regions must be passed around, > though we don't do that as well as we should. > > Todo: > - eliminate calls to get_system_memory() (where we ignore the bus hierarchy) > - add PCI APIs for the VGA window > - support the PIO address space using the memory API (allowing simplified > PCI BAR registration) > - convert 440FX > - convert everything else Michael, I'm looking at the pci bridge code, and it basically does the same thing - clip each BAR to the intersection of the decode window of all bridges it hides behind. How does a PCI bridge behave wrt VGA? is it a separate control? If so I probably need to implement generalized clipping (i.e. decode between 0xa0000-0xc0000 or between 0xc0000000-0xf0000000). -- error compiling committee.c: too many arguments to function