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

Re: [Xen-devel] [PATCH v2] xen: arm: handle initrd addresses above the 4G boundary



On 12/09/2013 11:43 AM, Ian Campbell wrote:
> The Xgene platform has no RAM below 4G.
> 
> The /chosen/linux,initrd-* properties do not have "reg" semantics and
> therefore #*-size are not used when interpreting. Instead they are are simply
> numbers which are interpreted according to the properties length.
> 
> Fix this both when parsing the entry in the host DTB and when creating the
> dom0 DTB. For dom0 we simply hardcode a 64-bit size, this is acceptable
> even for a 32-bit guest.
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
> v2: improve error messages
>     only accept start and end addresses which are exaclty u32 or u64 sized.
>     correct parameter name in dt_size_to_cells and comment on the rounding
>     down behaviour which it has.
> ---
>  xen/arch/arm/domain_build.c   |   19 +++++++++++++------
>  xen/common/device_tree.c      |   37 ++++++++++++++++++++++++++++++++-----
>  xen/include/xen/device_tree.h |    8 +++++++-
>  3 files changed, 52 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 213b3ac..532f39c6 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -222,11 +222,12 @@ static int write_properties(struct domain *d, struct 
> kernel_info *kinfo,
>           */
>          if ( early_info.modules.module[MOD_INITRD].size )
>          {
> -            res = fdt_property_cell(kinfo->fdt, "linux,initrd-start", 0);
> +            u64 a = 0;
> +            res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, 
> sizeof(a));
>              if ( res )
>                  return res;
>  
> -            res = fdt_property_cell(kinfo->fdt, "linux,initrd-end", 0);
> +            res = fdt_property(kinfo->fdt, "linux,initrd-end", &a, 
> sizeof(a));
>              if ( res )
>                  return res;
>          }
> @@ -926,6 +927,8 @@ static void initrd_load(struct kernel_info *kinfo)
>      unsigned long offs;
>      int node;
>      int res;
> +    u32 val[2];

Shouldn't it be __be32?

With this fix and given your answer on the previous version:

Acked-by: Julien Grall <julien.grall@xxxxxxxxxx>

-- 
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®.