All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: ensure the xenheap is 32MB aligned
@ 2013-09-10 15:57 Ian Campbell
  0 siblings, 0 replies; only message in thread
From: Ian Campbell @ 2013-09-10 15:57 UTC (permalink / raw)
  To: xen-devel
  Cc: julien.grall, tim, Ian Campbell, andre.przywara, stefano.stabellini

My patch 08693f5948d8 "xen: arm: reduce the size of the xen heap to max 1/8
RAM size" unintentionally violated the constraint that the xenheap must be
32MB aligned, since we only explicitly align the end of the heap and
xenheap_pages was not a multiple of 32 pages.

Round xenheap pages up to a 32MB boundary.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index afdb290..6663bc4 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -329,7 +329,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
      * constraints.
      */
     heap_pages = (ram_size >> PAGE_SHIFT);
-    xenheap_pages = max(heap_pages/8, 128UL<<(20-PAGE_SHIFT));
+    xenheap_pages = (heap_pages/8 + 0x1fffUL) & ~0x1fffUL;
+    xenheap_pages = max(xenheap_pages, 128UL<<(20-PAGE_SHIFT));
 
     do
     {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-10 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 15:57 [PATCH] xen/arm: ensure the xenheap is 32MB aligned Ian Campbell

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.