From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frediano Ziglio Subject: [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section Date: Mon, 29 Sep 2014 17:02:19 +0100 Message-ID: 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: Ian Campbell , Stefano Stabellini , Tim Deegan Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 --- 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