From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH v2 1/9] xen/arm: ensure the xenheap is 32MB aligned Date: Fri, 13 Sep 2013 12:40:29 +0100 Message-ID: <1379072437-28099-1-git-send-email-ian.campbell@citrix.com> References: <1379072409.19256.40.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1379072409.19256.40.camel@kazak.uk.xensource.com> 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@linaro.org, tim@xen.org, Ian Campbell , andre.przywara@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- 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 4b31623..1ba2eb3 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -323,7 +323,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