From: Ian Campbell Subject: [PATCH] xen: arm: load FDT below 0.5G Date: Tue, 23 Jul 2013 18:12:08 +0100 Message-ID: <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: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: julien.grall@citrix.com, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- 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); -- 1.8.3.2