From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUhCe-00063k-Hh for qemu-devel@nongnu.org; Tue, 23 Apr 2013 13:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUhCb-0003t3-Mi for qemu-devel@nongnu.org; Tue, 23 Apr 2013 13:40:28 -0400 Received: from goliath.siemens.de ([192.35.17.28]:16686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUhCW-0003sD-RQ for qemu-devel@nongnu.org; Tue, 23 Apr 2013 13:40:25 -0400 Message-ID: <5176C766.7070706@siemens.com> Date: Tue, 23 Apr 2013 19:39:50 +0200 From: Jan Kiszka 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> 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: "gleb@redhat.com" , "mst@redhat.com" , "qemu-devel@nongnu.org" , "lcapitulino@redhat.com" , "blauwirbel@gmail.com" , "kraxel@redhat.com" , "quintela@redhat.com" , "armbru@redhat.com" , "yang.z.zhang@intel.com" , "ehabkost@redhat.com" , "stefano.stabellini@eu.citrix.com" , "aderumier@odiso.com" , "anthony.perard@citrix.com" , "alex.williamson@redhat.com" , Paolo Bonzini , "rth@twiddle.net" , "kwolf@redhat.com" , "aliguori@us.ibm.com" , "claudio.fontana@huawei.com" , Igor Mammedov , "afaerber@suse.de" On 2013-04-23 19:26, Peter Maydell wrote: > On 23 April 2013 18:14, Paolo Bonzini wrote: >> Il 23/04/2013 19:06, Peter Maydell ha scritto: >>>>> /* >>>>> + * memory_region_get_address: get current the address of a region >>>>> + * >>>>> + * Returns the absolute address of a region. >>>>> + * May be used on regions that are currently part of a memory hierarchy. >>>>> + * >>>>> + * @mr: the region being queried >>>>> + */ >>>>> +hwaddr memory_region_get_address(MemoryRegion *mr); >>> This doesn't make sense as a memory API in my opinion. There's >>> no such thing as the "absolute address of a MemoryRegion". >> >> What about also passing an AddressSpace and stopping at the address >> space's root? Would that make more sense? > > That would be an improvement, but it still requires this > device to know what address space it's mapped into, which > is a bit ugly. Unfortunately the KVM API mandates this knowledge (IOAPIC state contains the absolute mapping address). So we need some channel to explore where this device is mapped. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux