From: Frediano Ziglio <freddy77@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xen.org
Subject: [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
Date: Mon, 29 Sep 2014 17:02:19 +0100 [thread overview]
Message-ID: <CAHt6W4c9cmLGkTANH463u2sZBQ+FmT+_FccJJf-+3PaGtkKT5Q@mail.gmail.com> (raw)
setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1GB.
On system with large memory is possible that there are no blocks of memory
smaller than 1gb leading xenheap_pages to be more than 1gb.
This cause memory errors trying to access heap after the 1gb limit.
I actually consider this patch as RFC as the pages are allocated at the end
of the block found however I don't think is safe to assume that the end is
aligned to 32mb as required.
Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
---
xen/arch/arm/setup.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 446de8a..34b55b4 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -524,6 +524,11 @@ static void __init setup_mm(unsigned long
dtb_paddr, size_t dtb_size)
if ( ! e )
panic("Not not enough space for xenheap");
+#ifdef CONFIG_ARM_32
+ if ( xenheap_pages > 1<<(30-PAGE_SHIFT) )
+ xenheap_pages = 1<<(30-PAGE_SHIFT);
+#endif
+
domheap_pages = heap_pages - xenheap_pages;
printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
--
1.9.1
next reply other threads:[~2014-09-29 16:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 16:02 Frediano Ziglio [this message]
2014-10-01 10:37 ` [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section Ian Campbell
2014-10-01 11:29 ` Ian Campbell
2014-10-01 13:06 ` Julien Grall
-- strict thread matches above, loose matches on Subject: below --
2014-09-29 15:59 Frediano Ziglio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHt6W4c9cmLGkTANH463u2sZBQ+FmT+_FccJJf-+3PaGtkKT5Q@mail.gmail.com \
--to=freddy77@gmail.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).