All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: arm: load FDT below 0.5G
@ 2013-07-23 17:12 Ian Campbell
  2013-07-24 13:44 ` Julien Grall
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Campbell @ 2013-07-23 17:12 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, Ian Campbell, stefano.stabellini

From: Ian Campbell <ian.campbell@citrix.com>

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 <ian.campbell@citrix.com>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-30 10:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23 17:12 [PATCH] xen: arm: load FDT below 0.5G Ian Campbell
2013-07-24 13:44 ` Julien Grall
2013-07-24 14:37   ` Ian Campbell
2013-07-29 14:46     ` Ian Campbell
2013-07-30  9:53       ` Julien Grall
2013-07-30  9:57         ` Ian Campbell
2013-07-30 10:15           ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.