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

Re: [Xen-devel] [PATCH v5 07/19] xen: arm: allocate dom0 memory separately from preparing the dtb



On Wed, 2013-11-13 at 21:34 +0000, Julien Grall wrote:
> > @@ -304,6 +292,46 @@ static int fdt_property_interrupts(void *fdt, 
> > gic_interrupt_t *intr,
> >       return res;
> >   }
> >
> > +static int make_memory_node(const struct domain *d,
> > +                            void *fdt,
> > +                            const struct kernel_info *kinfo)
> > +{
> > +    int res, i;
> > +    int nr_cells = XEN_FDT_NODE_REG_SIZE*kinfo->mem.nr_banks;
> 
> What about xzalloc? I don't think it's safe to allocate an uncontrol 
> size (we don't know the size of nr_banks, even if now it's hardcoded).

The stack is 8 pages (32k) which would be enough for 2048 memory banks
of 16 bytes each.

I think that is likely to be plenty, given that the function is called
once at start of day and not from an especially deep call chain.

The xzalloc in make_gic_node is unneccessary as well IMHO (even more so,
since the size is at most 32 bytes or so) but I left it alone here.

Ian.


_______________________________________________
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®.