From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 7/8] xen/device_tree: Add dt_device_get_address_raw Date: Wed, 05 Nov 2014 14:18:28 +0000 Message-ID: <545A31B4.6040901@linaro.org> References: <1415180475-8339-1-git-send-email-frediano.ziglio@huawei.com> <1415180475-8339-8-git-send-email-frediano.ziglio@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1415180475-8339-8-git-send-email-frediano.ziglio@huawei.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Ian Campbell , Stefano Stabellini , Tim Deegan Cc: zoltan.kiss@huawei.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi Frediano, I will made a global comment here for patch #7 and #8. On 11/05/2014 09:41 AM, Frediano Ziglio wrote: > Allow to read untranslated address from device node. > > Signed-off-by: Frediano Ziglio > --- > xen/common/device_tree.c | 34 ++++++++++++++++++++++++++++++++++ > xen/include/xen/device_tree.h | 11 +++++++++++ > 2 files changed, 45 insertions(+) > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c > index 1a886c0..4186a24 100644 > --- a/xen/common/device_tree.c > +++ b/xen/common/device_tree.c > @@ -711,6 +711,40 @@ int dt_device_get_address(const struct dt_device_node *dev, int index, > return 0; > } > > +/* dt_device_get_address_raw - Returns address not translated */ > +int dt_device_get_address_raw(const struct dt_device_node *dev, int index, > + u64 *addr) This is wrong to assume that the untranslated address will fit in a 64 bits value. Technically an untranslated address could be encoded on up to 4 cells (though it has been hardcoded). In any case, I don't think this is the right solution to the problem. As DOM0 will always have the same layout as the hardware for the GIC, we should copy "regs" and strip the unecessary regions (such as the GICH and GICV). Regards, -- Julien Grall