From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUl3C-0004DZ-2U for qemu-devel@nongnu.org; Tue, 23 Apr 2013 17:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUl39-0008Vu-6y for qemu-devel@nongnu.org; Tue, 23 Apr 2013 17:46:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUl38-0008VR-VR for qemu-devel@nongnu.org; Tue, 23 Apr 2013 17:46:55 -0400 Message-ID: <51770133.4090003@redhat.com> Date: Tue, 23 Apr 2013 23:46:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1366705795-24732-1-git-send-email-imammedo@redhat.com> <1366705795-24732-18-git-send-email-imammedo@redhat.com> <5176C15E.9050106@redhat.com> <5176C766.7070706@siemens.com> <5176F6DE.8080709@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 17/21] introduce memory_region_get_address() and use it in kvm/ioapic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "kwolf@redhat.com" , "aliguori@us.ibm.com" , "ehabkost@redhat.com" , "gleb@redhat.com" , "mst@redhat.com" , Jan Kiszka , "quintela@redhat.com" , claudio.fontana@huawei.com, "qemu-devel@nongnu.org" , "aderumier@odiso.com" , "lcapitulino@redhat.com" , "blauwirbel@gmail.com" , "anthony.perard@citrix.com" , "alex.williamson@redhat.com" , "kraxel@redhat.com" , "yang.z.zhang@intel.com" , "stefano.stabellini@eu.citrix.com" , "armbru@redhat.com" , "rth@twiddle.net" Il 23/04/2013 23:39, Peter Maydell ha scritto: >> > >> > Hmm, good point. address_space_get_region_addr()? > Maybe we should make this parallel-ish to memory_region_find() > (which finds an MR within an AS by addr/size)? > > Actually, I think I'd favour cleaning up some of the existing > API which has parameters named "address_space" which are > MemoryRegion*s. I think these probably predate the AddressSpace > type and should be updated to use it (and be renamed to fit too). > > So how about: > MemoryRegionSection memory_region_find(MemoryRegion *address_space, > hwaddr addr, uint64_t size); > becomes > MemoryRegionSection address_space_find_region_by_addr( > AddressSpace *address_space, > hwaddr addr, uint64_t size); > (bit of a mouthful, but never mind) > > void memory_global_sync_dirty_bitmap(MemoryRegion *address_space); > becomes > void address_space_sync_dirty_bitmap(AddressSpace *address_space); > > (in both cases the first thing the implementation does is call > memory_region_to_address_space() to get the AddressSpace* anyway.) > > and our new function is > MemoryRegionSection address_space_find_region(AddressSpace *as, > MemoryRegion *mr); > > ? > > (we don't have to do the tidyup first, but the new function > signature makes more sense viewed in the light of the others) I can look at it for 1.6, since I've already forward ported Avi's IOMMU patches and added s/DMAContext/AddressSpace/ on top. What about 1.5 though? Paolo