[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 7/8] xen/device_tree: Add dt_device_get_address_raw



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 <frediano.ziglio@xxxxxxxxxx>
> ---
>  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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.