From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXUcA-00076a-TT for qemu-devel@nongnu.org; Fri, 26 Sep 2014 08:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXUc1-00051W-LG for qemu-devel@nongnu.org; Fri, 26 Sep 2014 08:27:10 -0400 Message-ID: <54255B8E.7020500@suse.de> Date: Fri, 26 Sep 2014 14:26:54 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1411572143-40345-1-git-send-email-agraf@suse.de> <1411572143-40345-6-git-send-email-agraf@suse.de> <54255698.8070709@redhat.com> In-Reply-To: <54255698.8070709@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 5/7] sysbus: Add new platform bus helper device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-ppc@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, eric.auger@linaro.org, qemu-devel@nongnu.org, sean.stalley@intel.com, afaerber@suse.de On 09/26/2014 02:05 PM, Paolo Bonzini wrote: > Il 24/09/2014 17:22, Alexander Graf ha scritto: >> + if (!memory_region_is_mapped(sbdev_mr)) { >> + /* Region is not mapped? */ >> + return -1; >> + } >> + >> + parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL); >> + >> + assert(parent_mr); >> + if (parent_mr != pbus_mr_obj) { >> + /* MMIO region is not mapped on platform bus */ >> + return -1; >> + } >> + >> + return object_property_get_int(OBJECT(sbdev_mr), "addr", NULL); > I think this should try going through the parent recursively until > reaching NULL (which would fail) or pbus_mr_obj. Are you sure? Imagine one sysbus device includes another. We only want to look at the region the lowest sysbus device exposes, no? Alex