From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen: arm: load FDT below 0.5G Date: Wed, 24 Jul 2013 14:44:08 +0100 Message-ID: <51EFDA28.6050301@linaro.org> References: <1374599528-4250-1-git-send-email-ijc@hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1374599528-4250-1-git-send-email-ijc@hellion.org.uk> 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, Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 07/23/2013 06:12 PM, Ian Campbell wrote: > From: Ian Campbell > > The 32-bit Linux kernel uses its lowmem direct mapping to access the FDT. The > lowmem mapping is around 3/4GiB but varies depending on the kernel's .config. > Use a limit of 1/2G to be safe. > > Signed-off-by: Ian Campbell I'm curious, how did you find this value? I can't easily find a specific range for the lowmem direct mapping. > --- > xen/arch/arm/domain_build.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index 056c9df..ff9e679 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -504,13 +504,14 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) > goto err; > > /* > - * DTB must be load below 4GiB and far enough from linux (Linux uses > - * the space after it to decompress) > - * Load the DTB at the end of the first bank, while ensuring it is > - * also below 4G > + * DTB must be loaded below around 0.5GiB and far enough from > + * linux (Linux uses the space after it to decompress). > + * > + * Load the DTB as high as possible in the first bank, while > + * ensuring it is also below 0.5G > */ > end = kinfo->mem.bank[0].start + kinfo->mem.bank[0].size; > - end = MIN(1ull << 32, end); > + end = MIN(kinfo->mem.bank[0].start + (1ull << 29), end); > kinfo->dtb_paddr = end - fdt_totalsize(kinfo->fdt); > /* Align the address to 2Mb. Linux only requires 4 byte alignment */ > kinfo->dtb_paddr &= ~((2 << 20) - 1); >