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

Re: [Xen-devel] [RFC PATCH v1 01/33] mm: introduce common help functions to deal with reserved/managed pages

On Tue, Mar 05, 2013 at 08:47:22PM +0100, Sam Ravnborg wrote:
> On Tue, Mar 05, 2013 at 10:54:44PM +0800, Jiang Liu wrote:
> > +static inline void free_initmem_default(int poison)
> > +{
> Why request user to supply the poison argumet. If this is the default
> implmentation then use the default poison value too (POISON_FREE_INITMEM)

That poison value is inappropriate on some architectures like ARM - it's
executable.  The default poison value leads to:

   0:   cccccccc        stclgt  12, cr12, [ip], {204}   ; 0xcc


   4:   cccc            ldmia   r4!, {r2, r3, r6, r7}

And we might as well forget using any kind of poison in that case.

The value which use is an undefined instruction on ARM and Thumb.

Notice the calls to poison_init_mem() in arch/arm/mm/init.c, which are
left by these patches, allowing us to continue using an appropriate
architecture specific value which will help to ensure that people
calling discarded init functions get appropriately bitten.

Xen-devel mailing list



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