From: Ian Campbell Subject: Re: [Xen-staging] [xen staging] Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround" Date: Thu, 3 Apr 2014 17:57:08 +0100 Message-ID: <1396544228.4211.146.camel@kazak.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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.xensource.com Cc: Julien Grall , Tim Deegan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2014-04-03 at 16:33 +0000, patchbot@xen.org wrote: > commit 1be5c1947fd52f5faaf6b678a829d47b0ec88bfd > Author: Ian Campbell > AuthorDate: Wed Apr 2 13:03:36 2014 +0100 > Commit: Ian Campbell > CommitDate: Thu Apr 3 17:15:41 2014 +0100 > > Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround Julien has just noticed that this breaks boot on the Midway systems. The obvious fix broken the boot on 64-bit instead so for now I've reverted the revert and I'll look into this properly tomorrow. The unrevert is below, I've already pushed it. -----8<------------------ >From d6ca80e03cc062c984401aefba5e277a9d9139a0 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 3 Apr 2014 17:54:34 +0100 Subject: [PATCH] Revert "Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround"" This reverts commit 1be5c1947fd52f5faaf6b678a829d47b0ec88bfd, effectively reinstating 6c21cb36e263de2db8716b477157a5b6cd531e1e. Without this booting dom0 on systems with >4GB of RAM is broken because the guest gets allocated a memory range which it cannot access. Signed-off-by: Ian Campbell --- xen/arch/arm/domain_build.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index a0b73d2..502db84 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -69,12 +69,19 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo) { paddr_t start; paddr_t size; - struct page_info *pg; + struct page_info *pg = NULL; unsigned int order = get_order_from_bytes(dom0_mem); int res; paddr_t spfn; + unsigned int bits; + + for ( bits = PAGE_SHIFT + 1; bits < PADDR_BITS; bits++ ) + { + pg = alloc_domheap_pages(d, order, MEMF_bits(bits)); + if ( pg != NULL ) + break; + } - pg = alloc_domheap_pages(d, order, 0); if ( !pg ) panic("Failed to allocate contiguous memory for dom0"); -- 1.7.10.4