From: Ian Campbell Subject: Re: [PATCH 06/12] arm: avoid allocating the heaps over modules or xen itself. Date: Thu, 29 Nov 2012 17:19:13 +0000 Message-ID: <1354209553.6269.51.camel@zakaz.uk.xensource.com> References: <1352823779.7491.94.camel@zakaz.uk.xensource.com> <1352823804-28482-6-git-send-email-ian.campbell@citrix.com> <20121129170638.GG80627@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121129170638.GG80627@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-11-29 at 17:06 +0000, Tim Deegan wrote: > 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? I should probably try it... I think in this case next_module will return the start of that module, so e = s, and it will also set n to the end of the module. init_boot_pages does the right thing if e <= s (i.e. ignores it) and then we do s = n (so s = module_end) and keep going. So I think it works? > > > + 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; > > + }