From: Tim Deegan Subject: Re: [PATCH 06/12] arm: avoid allocating the heaps over modules or xen itself. Date: Thu, 29 Nov 2012 17:06:38 +0000 Message-ID: <20121129170638.GG80627@ocelot.phlegethon.org> References: <1352823779.7491.94.camel@zakaz.uk.xensource.com> <1352823804-28482-6-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1352823804-28482-6-git-send-email-ian.campbell@citrix.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: Ian Campbell Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote: > Signed-off-by: Ian Campbell > --- > xen/arch/arm/setup.c | 89 +++++++++++++++++++++++++++++++++++++++++++------ > 1 files changed, 78 insertions(+), 11 deletions(-) > > @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) > copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE); > > /* Add non-xenheap memory */ > - init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages), > - pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages)); > + s = ram_start; > + while ( s < ram_end ) > + { > + paddr_t n = ram_end; > + > + e = next_module(s, &n); Does this DTRT if there's a module starting at exactly ram_start? > + if ( e == ~(paddr_t)0 ) > + { > + e = n = ram_end; > + } > + > + /* Avoid the xenheap */ > + if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT) > + && (xenheap_mfn_start << PAGE_SHIFT) < e ) > + { > + e = pfn_to_paddr(xenheap_mfn_start); > + n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages); > + } > + > + init_boot_pages(s, e); > + > + s = n; > + }