From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2] xen: arm: handle initrd addresses above the 4G boundary Date: Mon, 09 Dec 2013 15:05:59 +0000 Message-ID: <52A5DC57.3000409@linaro.org> References: <1386589415-8369-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386589415-8369-1-git-send-email-ian.campbell@citrix.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: Ian Campbell Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 > --- > 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