[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over modules or xen itself.



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 <ian.campbell@xxxxxxxxxx>
> > ---
> >  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;
> > +    }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.